Commit 2ae27f3
feat: adding support for alternate bearer token (#715)
## Problem
Currently we are using codewhisperer server for q and atx logins, with
updated auth from kiro and atx, we will need to store 2 bearer tokens
and respective profiles for separate connections in one server.
## Solution
Add support for alternate bearer token credentials
Changes:
• **New credential type**: Added bearer-alternate as a supported
credential type alongside existing iam and bearer types
• **Credential routing**: Enhanced credential update handler to route
credentials to alternate storage when credentialkey is set to
bearer-alternate
• **Storage separation**: Maintains separate storage for regular bearer
credentials and alternate bearer credentials
• **Provider interface**: Updated CredentialsProvider to handle
getting/checking alternate credentials via the bearer-alternate type
• **Cleanup handling**: Ensures both regular and alternate credentials
are cleared during deletion operations
• **Test coverage**: Added comprehensive test to verify alternate
credential routing and storage isolation
Key files modified:
• runtimes/runtimes/auth/auth.ts - Core authentication logic
• runtimes/server-interface/auth.ts - Type definitions
• runtimes/runtimes/auth/auth.test.ts - Test coverage
This enables language servers to handle multiple bearer token contexts
simultaneously without credential conflicts.
## License
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
---------
Co-authored-by: Pranav Firake <pranavfi@amazon.com>1 parent 9460c66 commit 2ae27f3
File tree
3 files changed
+93
-45
lines changed- runtimes/runtimes/auth
3 files changed
+93
-45
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments