-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protected Browser Storage #23553
Protected Browser Storage #23553
Conversation
src/Components/Web.Extensions/ref/Microsoft.AspNetCore.Components.Web.Extensions.csproj
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/Microsoft.AspNetCore.Components.Web.Extensions.csproj
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/Microsoft.AspNetCore.Components.Web.Extensions.csproj
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorageResult.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
...Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorageServiceCollectionExtensions.cs
Show resolved
Hide resolved
src/Components/test/testassets/TestServer/ProtectedBrowserStorageStartup.cs
Outdated
Show resolved
Hide resolved
src/Components/test/testassets/TestServer/ProtectedBrowserStorageStartup.cs
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/Microsoft.AspNetCore.Components.Web.Extensions.csproj
Outdated
Show resolved
Hide resolved
src/Components/Web.Extensions/src/ProtectedBrowserStorage/ProtectedBrowserStorage.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. Nice one @MackinnonBuck!
I'm happy to approve now, but @pranavkm left a bunch of good comments to be addressed before merging. Also I left a couple of suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
The only piece of feedback that I have is the same as the one about not needing the JS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great. I'd like to get @javiercn's opinion on the data protection caching.
src/Components/Web.Extensions/src/Microsoft.AspNetCore.Components.Web.Extensions.csproj
Outdated
Show resolved
Hide resolved
Thank you for submitting this for API review. This will be reviewed by @dotnet/aspnet-api-review at the next meeting of the ASP.NET Core API Review group. Please ensure you take a look at the API review process documentation and ensure that:
|
@@ -1,7 +1,7 @@ | |||
| |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio 15 | |||
VisualStudioVersion = 15.0.26124.0 | |||
# Visual Studio Version 16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Pilchie @MackinnonBuck tried to add a project using VS and it changed quite a few GUIDs and version numbers. I think he had to use VS (vs dotnet sln add) to create solution folders. Any idea why VS is producing so much diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - one of those guids is "original C# project guid, so please autodetect whether to use the old project system, or the new SDK project system", and the other is "force use of the new project system".
I forget which is which, but I think the 9A19103F
is the original guid, which VS seems to prefer.
It seems that dotnet sln add
uses the FAE04EC0
one to force to the new project system though.
@davkean - does that match your understanding?
If so, we should probably just update them all, and file an issue on dotnet/sdk
to change dotnet sln add
to use the 9A19103F
ValueTask SetAsync(string key, object value);
ValueTask SetAsync(string key, object value, string protectionPurpose); |
Open question: could we drop the "purpose" parameter altogether and have the framework auto-create a purpose from "key"? We were concerned that having any developer control over "purpose" risks confusing people. For example it might look as if each "purpose" is a separate key-value collection so you could use the same key multiple times with different purposes, when in fact they would overwrite each other. |
I was about to draft an email to @GrabYourPitchforks and @javiercn since they had previously commented on this PR. One of the scenarios where an additional purpose might be useful is if there's a server secret that you do not want to send to the browser (for instance something like the user id). |
Feel free to shoot an email or set up a video chat. :) |
Summary of the changes
AspNetCore.Components.Web.Extensions
GetAsync
to distinguish between nonexistent keys and keys that map to adefault
value.Addresses #18755