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

UserId fix for malformed ID read from auth sessions #974

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

tyaginidhi
Copy link
Contributor

@tyaginidhi tyaginidhi commented Jun 12, 2024

NOTE wil consider moving to jsonwebtoken to directly get ID post sync with vscode auth contact point.

This pull request primarily focuses on modifying how user IDs are extracted from account IDs in the AuthenticationProvider.ts file. The extraction logic has been changed in four different authentication functions. Instead of using pop() to get the last segment of the ID after splitting it by '/', the updated code uses shift() to get the first segment after splitting the ID by either '.' or '/'.

Here are the primary changes:

  • src/common/services/AuthenticationProvider.ts - intelligenceAPIAuthentication function: Updated the extraction of userId from session?.account.id by splitting it with a regular expression and using shift() instead of pop().
  • src/common/services/AuthenticationProvider.ts - dataverseAuthentication function: Same change as above for userId extraction.
  • src/common/services/AuthenticationProvider.ts - graphClientAuthentication function: Updated the userId extraction logic in the telemetry event.
  • src/common/services/AuthenticationProvider.ts - bapServiceAuthentication function: Similar change as above for userId extraction in the telemetry event.

@tyaginidhi tyaginidhi marked this pull request as ready for review June 12, 2024 12:17
@tyaginidhi tyaginidhi requested review from a team as code owners June 12, 2024 12:17
@tyaginidhi tyaginidhi enabled auto-merge (squash) June 12, 2024 12:23
@tyaginidhi tyaginidhi merged commit ac34172 into main Jun 12, 2024
6 checks passed
@tyaginidhi tyaginidhi deleted the users/nityagi/UserIdMalformerIssue branch June 12, 2024 12:30
tyaginidhi added a commit that referenced this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants