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

feat: an AuthorizationManager instance can now be provided as a SDKOption; This allows auto-configuration of Authorization headers for requests made using the SDK. #165

Merged
merged 2 commits into from
May 17, 2024

Conversation

jbottigliero
Copy link
Collaborator

@jbottigliero jbottigliero commented May 9, 2024

  • Removes getTokenForScope method.
  • The shared serviceRequest method has been updated to retrieve tokens from an AuthorizationManager, when passed via SDKOptions

This change will allow calls like:

const manager = sdk.authorization.create({ ..., scopes: 'transfer...' });
sdk.transfer.endpointSearch({...}, { manager });

Rather than:

const manager = sdk.authorization.create({ ..., scopes: 'transfer...' });
sdk.transfer.endpointSearch({ 
  headers: { 
    Authorization: `Bearer ${manager.tokens.transfer.access_token}`
  }
};

Copy link

codecov bot commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.11%. Comparing base (69fe19c) to head (661d0f5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #165      +/-   ##
==========================================
- Coverage   99.12%   99.11%   -0.01%     
==========================================
  Files          63       62       -1     
  Lines         915      909       -6     
  Branches      123      125       +2     
==========================================
- Hits          907      901       -6     
  Misses          8        8              

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

…tion; This allows auto-configuration of Authorization headers for requests made using the SDK.
@jbottigliero jbottigliero merged commit 7abad5e into main May 17, 2024
9 checks passed
@jbottigliero jbottigliero deleted the feat-SDKOptions-manager branch May 17, 2024 15:47
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.

None yet

1 participant