Repository navigation
Add App Check debug token management - #1167
Open
kmeretskyi wants to merge 1 commit into
Open
kmeretskyi wants to merge 1 commit into
kmeretskyi wants to merge 1 commit into
Conversation
Adds creating, getting, listing, updating and deleting App Check debug tokens via the App Check REST API v1. Exposed through the transitional AppCheckWithDebugTokens contract to keep the AppCheck contract backwards compatible.
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.
Adds support for managing App Check debug tokens via the App Check REST API v1:
createDebugToken()– registers a debug token; generates a random UUID4 secret if none is given. The secret is only available on the returned object, as the API never returns it again.getDebugToken(),listDebugTokens()(follows pagination),updateDebugToken()(display name),deleteDebugToken()The methods are exposed through a new transitional
Kreait\Firebase\Contract\AppCheckWithDebugTokenscontract (same approach asAppCheckWithReplayProtection) to keep theAppCheckcontract backwards compatible. A note for the next major is added toNEXT_MAJOR_TODO.md.Not included:
exchangeDebugTokenI left out
projects.apps.exchangeDebugTokenon purpose. When tested against a real project, the endpoint returns401 Request is missing required authentication credentialfor service account OAuth credentials, while the same credentials work for alldebugTokensmethods. It only accepts the app's API key, so it is meant to be called by client apps (the debug provider), not by an Admin SDK.Testing
updateMask, UUID4 generation, error conversion)AppCheckTest::testDebugTokenLifecycle(create → get → list → update → delete), run successfully against a real Firebase projectSide note: the integration test bootstrap fails with
UnexpectedValueException: Syntax errorwhenTEST_REGISTRATION_TOKENSis empty (it is JSON-decoded unconditionally); setting it to[]works around it.