FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(appcheck): Verify one-time tokens for replay protection by yvonnep165 · Pull Request #976 · firebase/firebase-admin-python · GitHub

feat(appcheck): Verify one-time tokens for replay protection - #976

Open
yvonnep165 wants to merge 7 commits into
mainfrom
yp-verify-one-time-token
Open

feat(appcheck): Verify one-time tokens for replay protection#976
yvonnep165 wants to merge 7 commits into
mainfrom
yp-verify-one-time-token

Conversation

Copy link
Copy Markdown
Contributor

This PR adds support for App Check one-time token verification for replay protection by adding an optional consume parameter to app_check.verify_token(). The returned claims dictionary will contain an already_consumed boolean key indicating whether the token was previously consumed.

yvonnep165 self-assigned this Aug 17, 2026
yvonnep165 added release-note release:stage Stage a release candidate labels Aug 17, 2026

gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request adds support for stateful token verification in Firebase App Check by introducing a consume parameter to the verify_token function. When enabled, the service calls the App Check backend to mark the token as consumed, providing replay protection, and returns an already_consumed flag. Corresponding unit tests have also been added. The review feedback suggests improving error handling by using _utils.handle_platform_error_from_requests instead of _utils.handle_requests_error to propagate detailed GCP error messages to developers.

Comment thread firebase_admin/app_check.py Outdated

jonathanedey left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with one comment, Thanks!


verified_claims['app_id'] = verified_claims.get('sub')

if consume:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's validate consume is a bool here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for taking a look at this! Validation is added.

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

Labels

release:stage Stage a release candidate release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL