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

chore(Authorization)!: Updates Token Storage Structure #400

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jbottigliero
Copy link
Member

@jbottigliero jbottigliero commented Jan 3, 2025

  • Updates the structure of how tokens are stored on the configured storage system to allow retrieval by scope when necessary.
  • This change allows for multiple tokens, for the same resource server, with different scopes to be managed. This was limitation of storing tokens by {CLIENT_ID}:{RESOURCE_SERVER}.
  • AuthorizationManager.getGlobusAuthToken() and AuthorizationManager.hasGlobusAuthToken() have been deprecated; Use AuthorizationManager.tokens.auth instead.
  • BREAKING CHANGE The authenticated event no longer provides a token as part of the event payload. Originally, this would only provide the Globus Auth token, but your application might never require a Globus Auth token (and only tokens from a specific service).

This has been marked as a breaking change based on the structure change to how tokens are stored; This would only be a breaking change if you are accessing stored tokens in localStorage or sessionStorage directly, which is not advised (use the TokenManager instance instead).

@jbottigliero jbottigliero force-pushed the chore-TokenStorage branch 4 times, most recently from 6e7d522 to f633e45 Compare January 3, 2025 17:18
- Updates the structure of how tokens are stored on the configured storage system to allow retrieval by scope when necessary.
- **Allows for multiple tokens, for the same resource server, with different scopes to be stored.**
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 83.13253% with 14 lines in your changes missing coverage. Please review.

Project coverage is 96.79%. Comparing base (9bc2478) to head (d9e00ba).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/core/authorization/TokenManager.ts 83.78% 11 Missing and 1 partial ⚠️
src/core/authorization/AuthorizationManager.ts 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #400      +/-   ##
==========================================
- Coverage   98.82%   96.79%   -2.04%     
==========================================
  Files          70       70              
  Lines        1191     1247      +56     
  Branches      194      208      +14     
==========================================
+ Hits         1177     1207      +30     
- Misses         14       39      +25     
- Partials        0        1       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant