Skip to content

Commit 6d5d8b6

Browse files
fix(appcheck): Use v1beta endpoint for verifyAppCheckToken (#987)
* 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. * chore(fac): Fix line length lint in test_app_check.py
1 parent 46edf94 commit 6d5d8b6

2 files changed

Lines changed: 5 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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ 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}"
323+
":verifyAppCheckToken"
323324
)
324325
mock_body.assert_called_once_with(
325326
"post", expected_url, json={"app_check_token": "encoded"}
@@ -340,7 +341,8 @@ def test_verify_token_with_consume_true_already_consumed(self, mocker):
340341
assert payload == expected
341342

342343
expected_url = (
343-
f"https://firebaseappcheck.googleapis.com/v1/projects/{PROJECT_ID}:verifyAppCheckToken"
344+
f"https://firebaseappcheck.googleapis.com/v1beta/projects/{PROJECT_ID}"
345+
":verifyAppCheckToken"
344346
)
345347
mock_body.assert_called_once_with(
346348
"post", expected_url, json={"app_check_token": "encoded"}

0 commit comments

Comments
 (0)