-
Notifications
You must be signed in to change notification settings - Fork 168
Dev Merge #105
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
Dev Merge #105
Conversation
Updated APICall and OAuth helper logic to handle both legacy 'oauth_con_id' and new 'oauthService' or component ID for OAuth configuration. This improves compatibility with different OAuth setups and ensures correct token retrieval and header generation.
Add support for new and old OAuth id for configuration in API calls
Caution Review failedThe pull request is closed. WalkthroughVersion bumps in core and SDK packages. Core API call logic updated to activate OAuth using either legacy or new configuration and to append OAuth headers. OAuth helper now resolves token keys and prefixes with fallbacks to component IDs, supporting both configuration shapes without changing public interfaces. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client as Caller
participant APICall as APICall.class
participant OAuth as OAuth.helper
participant Store as Token Store
Client->>APICall: execute(request, config)
alt OAuth enabled (legacy oauth_con_id or new oauthService)
APICall->>OAuth: retrieveOAuthTokens(config)
note right of OAuth: Resolve tokenKey: oauth_con_id<br/>or OAUTH_<componentId>_TOKENS
OAuth->>Store: get(tokenKey)
Store-->>OAuth: tokens | null
alt No tokens
OAuth->>OAuth: getClientCredentialToken(config)
note right of OAuth: Prefix from oauth_con_id split<br/>or fallback to componentId
OAuth->>Store: save(tokenKey, tokens)
Store-->>OAuth: ok
end
OAuth-->>APICall: oauthHeaders
APICall->>APICall: headers = headers + oauthHeaders
else OAuth not enabled
APICall->>APICall: use existing headers
end
APICall-->>Client: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge Base: Disabled due to data retention organization setting 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
Bug Fixes
Chores
Refactor