feat(profile-sync-controller): add getCustomerServiceToken method and messenger action#9442
Merged
Conversation
montelaidev
reviewed
Jul 10, 2026
montelaidev
reviewed
Jul 10, 2026
montelaidev
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
References
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1982
Checklist
Note
Medium Risk
Introduces a new authentication surface that mints audience-scoped tokens for support tooling; behavior follows existing token-exchange patterns but expands who can obtain CS credentials from the wallet.
Overview
Adds
getCustomerServiceTokenend-to-end so wallet clients can obtain a short-lived token for Customer Service tooling. The flow mirrors existing bearer-token APIs: resolve the SRP (optionalentropySourceId), ensure sign-in and an unlocked wallet at the controller layer, obtain an OIDC access token (logging in if needed), thenPOST /api/v2/customer-service/tokenwithAuthorization: Bearerto exchange it for a customer-service–scopedaccess_token.AuthenticationControllerexposes the method and registersAuthenticationController:getCustomerServiceTokenon the messenger. The SDK addsCUSTOMER_SERVICE_TOKEN_URL,getCustomerServiceTokenin services (withSignInError/RateLimitedErrorhandling), and delegates from SRP and SIWE JWT bearer flows plus the auth facade. Tests and nock fixtures cover success, missing token, HTTP errors, rate limits, not signed in, locked wallet, and endpoint failure.Reviewed by Cursor Bugbot for commit da16264. Bugbot is set up for automated code reviews on this repo. Configure here.