-
Notifications
You must be signed in to change notification settings - Fork 895
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
Add public token API to AppCheck #5033
Conversation
🦋 Changeset detectedLatest commit: 99f0293 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs |
Co-authored-by: Kevin Cheung <[email protected]>
…rebase-js-sdk into ch-appcheck-tokenapi
packages/app-check/src/api.test.ts
Outdated
const app = getFakeApp({ automaticDataCollectionEnabled: true }); | ||
const fakePlatformLoggingProvider = getFakePlatformLoggingProvider(); | ||
stub(internalApi, 'getToken').resolves({ | ||
token: 'a-token-string', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be the dummy token in this case, right? Can you add a comment here to clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified.
@@ -264,7 +277,11 @@ function createTokenRefresher( | |||
|
|||
// getToken() always resolves. In case the result has an error field defined, it means the operation failed, and we should retry. | |||
if (result.error) { | |||
throw result.error; | |||
if (onError) { | |||
onError(result.error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant. Notifying listeners are already handled in getToken()
which calls notifyTokenListeners()
.
Here we should always throw to trigger retries. (Just revert the changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted.
Create public
getToken()
andonTokenChanged()
methods.Proposal (internal link):
go/app-check-sdk-get-token-3p-api
For docs reviewers:
The only public doc comments are in
packages/firebase/index.d.ts