-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[v5] Changes to Configuration - CacheOptions (Config #2) #7697
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
base: msal-v5
Are you sure you want to change the base?
Conversation
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.
LGTM but somebody else should weigh in on whether to block redirects with memory storage
…tication-library-for-js into config-change-cache
…tication-library-for-js into config-change-cache
…tication-library-for-js into config-change-cache
…tication-library-for-js into config-change-cache
@@ -724,7 +720,7 @@ describe("BrowserCacheManager tests", () => { | |||
).toBe(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME); | |||
}); | |||
|
|||
it("clearTokensWithClaimsInCache clears all access tokens with claims in tokenKeys", async () => { | |||
it("clearTokensAndKeysWithClaims clears all access tokens with claims in tokenKeys", async () => { |
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.
Fixed naming, clearTokensWithClaimsInCache
is not a function
@@ -99,19 +99,6 @@ describe("In Memory Storage Tests", function () { | |||
await page.close(); | |||
}); | |||
|
|||
it("Performs loginRedirect", async () => { |
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 e2e test has been removed as loginRedirect is not supported with memory storage now that storeAuthStateInCookies
is removed.
if ( | ||
config.cache.claimsBasedCachingEnabled && |
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.
Doesn't this change the behavior here? We are effectively defaulting this option to false so this block would never be hit. Do I have that right?
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.
We're removing claimsBasedCachingEnabled
so this block would be hit as long as request.claims
is set. In my discussion with @sameerag, the consensus was that claims still need to be able to be set on request for CAE purposes but we never want to cache claims.
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.
I guess I'm confused how this works today then when claimsBasedCachingEnabled
is false? Do we have a bug today?
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.
It works the way @jo-arroyo described above, claims are added to the request but never cached. The bug is if this is true
and user calls claims per request with a high frequency, the cache starts hitting its limit and requests fail post that point.
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.
Let's chat offline, I think we're conflating 2 related but different things and I think this specific change is incorrect.
*/ | ||
claimsBasedCachingEnabled?: boolean; | ||
}; | ||
export type CacheOptions = {}; |
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.
Do we want to remove this altogether since it's empty?
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.
+1
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.
Good point, done.
Co-authored-by: Thomas Norling <[email protected]>
This PR updates the CacheOptions for MSAL Browser v5, including the removal of implementation, tests, and doc references for the following options:
temporaryCacheLocation
claimsBasedCachingEnabled
storeAuthStateInCookie
secureCookies
cacheMigrationEnabled
Deprecation notices for the above options were added in #7707