Skip to content

Commit f28e37f

Browse files
committed
fix(fac): Use v1beta endpoint for verifyAppCheckToken
Updated _AppCheckService._VERIFY_URL_FORMAT to point to the v1beta endpoint (https://firebaseappcheck.googleapis.com/v1beta/projects/{project_id}:verifyAppCheckToken) for replay protection verification.
1 parent cbacb02 commit f28e37f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎firebase_admin/app_check.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class _AppCheckService:
5454
_APP_CHECK_ISSUER = 'https://firebaseappcheck.googleapis.com/'
5555
_JWKS_URL = 'https://firebaseappcheck.googleapis.com/v1/jwks'
5656
_VERIFY_URL_FORMAT = (
57-
'https://firebaseappcheck.googleapis.com/v1/projects/{project_id}:verifyAppCheckToken'
57+
'https://firebaseappcheck.googleapis.com/v1beta/projects/{project_id}:verifyAppCheckToken'
5858
)
5959
_project_id = None
6060
_scoped_project_id = None

‎tests/test_app_check.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_verify_token_with_consume_true_not_consumed(self, mocker):
319319
assert payload == expected
320320

321321
expected_url = (
322-
f"https://firebaseappcheck.googleapis.com/v1/projects/{PROJECT_ID}:verifyAppCheckToken"
322+
f"https://firebaseappcheck.googleapis.com/v1beta/projects/{PROJECT_ID}:verifyAppCheckToken"
323323
)
324324
mock_body.assert_called_once_with(
325325
"post", expected_url, json={"app_check_token": "encoded"}
@@ -340,7 +340,7 @@ def test_verify_token_with_consume_true_already_consumed(self, mocker):
340340
assert payload == expected
341341

342342
expected_url = (
343-
f"https://firebaseappcheck.googleapis.com/v1/projects/{PROJECT_ID}:verifyAppCheckToken"
343+
f"https://firebaseappcheck.googleapis.com/v1beta/projects/{PROJECT_ID}:verifyAppCheckToken"
344344
)
345345
mock_body.assert_called_once_with(
346346
"post", expected_url, json={"app_check_token": "encoded"}

0 commit comments

Comments
 (0)