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
[msal-browser] Adding exports and other changes for extensibility #4459
Conversation
Codecov Report
*This pull request uses carry forward flags. Click here to find out more.
|
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.
Please confirm the changes that don't match the extensibility changes are not regressions before committing.
@@ -250,8 +249,6 @@ export abstract class StandardInteractionClient extends BaseInteractionClient { | |||
} | |||
} | |||
|
|||
this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || "", validatedRequest.account || null); |
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.
Changes in this file, like the RedirectClient.ts look unrelated to the intent of the PR, maybe you need to re-sync with other updates.
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.
updating cache entries is part of the "extensiblity" changes, those are now done in their respective interaction handlers
@@ -106,7 +106,8 @@ export enum ApiId { | |||
export enum InteractionType { | |||
Redirect = "redirect", | |||
Popup = "popup", | |||
Silent = "silent" | |||
Silent = "silent", | |||
None = "none" |
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 change also looks unrelated to the intent of your PR.
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.
also related to enums available for downstream packages
@@ -44,6 +44,7 @@ export class SilentIframeClient extends StandardInteractionClient { | |||
...request, | |||
prompt: PromptValue.NONE | |||
}, InteractionType.Silent); | |||
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null); |
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.
Can we put this in initializeAuthorizationRequest
?
Can you also explain what this is for?
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 is to update temporary cache values. Using InitializeAuthorizationRequest makes it harder to control when the cache values are updated. For some broker scenarios, we don't want to update cache entries when we initialize the request, but after we send the request up to the broker.
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 see now that's where it used to be... Can we add a comment explaining this? This feels like something that may get moved back at some point without realizing what it affects. Not sure I like taking a dependency on implementation details like this
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 have the same inclination that this may get "optimized" at some point.
Least case add a comment, Best case make a commented helper API with instructions regarding the sequence ,
processReqBeforeDispatch(browserStorage, request: BaseReqType)
.
May prevent someone moving this later that way and any other functionality we may add before request dispatch for broker. Could be an overkill, will let you do the trade off.
@@ -44,6 +44,7 @@ export class SilentIframeClient extends StandardInteractionClient { | |||
...request, | |||
prompt: PromptValue.NONE | |||
}, InteractionType.Silent); | |||
this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || "", silentRequest.account || null); |
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.
nit: Should we replace "" with Constants.EMPTY_STRING
?
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.
Approved with comments
🎉 Handy links: |
This PR adds additional exported files and other changes to further support extensibility in other libraries.