-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add BrowserId support to Tokenserver load tests (#1219)
Closes #1213
- Loading branch information
Showing
5 changed files
with
156 additions
and
263 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import functions_framework | ||
import json | ||
|
||
from flask import abort, Response | ||
|
||
|
||
# GCP doesn't allow us to define multiple routes in a single Cloud Function, | ||
# so we handle routing here. | ||
@functions_framework.http | ||
def mock_fxa_server(request): | ||
if request.path == '/v1/verify': | ||
body = json.loads(request.json['token']) | ||
response = json.dumps(body['body']) | ||
|
||
return Response(response=response, content_type='application/json', | ||
status=body['status']) | ||
elif request.path == '/v1/jwks': | ||
return {'keys': [{'fake': 'RSA key'}]} | ||
else: | ||
abort(404) |
Oops, something went wrong.