Skip to content
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 resource map fix by sequencing matching protected resources keys #7274

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from

Conversation

abhixkj
Copy link

@abhixkj abhixkj commented Aug 25, 2024

Fixes
#7173
and retains the fix for
#7111

@github-actions github-actions bot added the msal-angular Related to @azure/msal-angular package label Aug 25, 2024
@abhixkj
Copy link
Author

abhixkj commented Aug 25, 2024 via email

@abhixkj
Copy link
Author

abhixkj commented Sep 3, 2024

Hi @jo-arroyo can you please review the changes when you have some time, I have fixed the #7111 issue using a different method so that the subsequent issue #7173 doe not happen.

// Storing the resource with the index position in the endpoint URL
if (StringUtils.matchPattern(normalizedKey, normalizedEndpoint)) {
const indexn = endpoint.indexOf(normalizedKey);
absoluteResourcesWithIndex.set(key, Math.max(0, indexn));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Math.max here instead of directly using indexn? What's the scenario where indexn is < 0?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't quite understand what's happening here w.r.t. index. Why are you looking for the index of the key, then later sorting by index? I see comments around what is happening but it would be helpful to also include comments about why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
msal-angular Related to @azure/msal-angular package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants