Spec points
- RSA7b: "The clientId attribute of the Auth object is derived from the tokenDetails that are returned from an explicit auth request, or from the authCallback."
- RSA12: Wildcard clientId (
*) should be accessible via auth.clientId.
Observed behaviour
For REST clients, auth.clientId is only set from ClientOptions.clientId (via _userSetClientId during construction). It is not extracted from:
tokenDetails.clientId passed in the constructor
TokenDetails.clientId returned by authCallback
TokenDetails.clientId returned by authorize()
The _uncheckedSetClientId method exists but is only called from the Realtime ConnectionManager (on CONNECTED), never from REST token acquisition paths (_saveTokenOptions, _ensureValidAuthCredentials).
Failing tests (5)
| Test |
Expected |
Actual |
RSA7b - clientId from TokenDetails |
auth.clientId === 'token-client-id' |
undefined |
RSA7b - clientId from authCallback TokenDetails |
auth.clientId === 'callback-client-id' |
undefined |
RSA7 - clientId updated after authorize() |
auth.clientId updates after authorize() |
undefined |
RSA12 - Wildcard clientId |
auth.clientId === '*' |
undefined |
RSA7 - case 5: clientId inherited from token |
auth.clientId === 'token-client' |
undefined |
Reproduction
RUN_DEVIATIONS=1 npx mocha --grep "RSA7b|RSA12|RSA7 - case 5|RSA7 - clientId updated" test/uts/rest/auth/client_id.test.ts
From PR #2191, branch uts-rest.
┆Issue is synchronized with this Jira Task by Unito
Spec points
*) should be accessible viaauth.clientId.Observed behaviour
For REST clients,
auth.clientIdis only set fromClientOptions.clientId(via_userSetClientIdduring construction). It is not extracted from:tokenDetails.clientIdpassed in the constructorTokenDetails.clientIdreturned byauthCallbackTokenDetails.clientIdreturned byauthorize()The
_uncheckedSetClientIdmethod exists but is only called from the RealtimeConnectionManager(on CONNECTED), never from REST token acquisition paths (_saveTokenOptions,_ensureValidAuthCredentials).Failing tests (5)
RSA7b - clientId from TokenDetailsauth.clientId === 'token-client-id'undefinedRSA7b - clientId from authCallback TokenDetailsauth.clientId === 'callback-client-id'undefinedRSA7 - clientId updated after authorize()auth.clientIdupdates afterauthorize()undefinedRSA12 - Wildcard clientIdauth.clientId === '*'undefinedRSA7 - case 5: clientId inherited from tokenauth.clientId === 'token-client'undefinedReproduction
RUN_DEVIATIONS=1 npx mocha --grep "RSA7b|RSA12|RSA7 - case 5|RSA7 - clientId updated" test/uts/rest/auth/client_id.test.tsFrom PR #2191, branch
uts-rest.┆Issue is synchronized with this Jira Task by Unito