FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

Fix trailing slash

Merged Robin Goodall requested to merge fix-trailing-slash into main
Files
6
@@ -251,6 +251,23 @@ class APIGatewayAuthTestCase(TestCase):
self.mock_verify_token.call_args[1]["certs_url"], "https://issuer.invalid/certs"
)
def test_default_audience(self):
_, auth = self.auth.authenticate(
self.request_with_headers(
{
"x-api-org-name": "test",
"x-api-developer-app-class": "public",
"x-api-oauth2-user": str(Identifier("a123", IdentifierSchemes.CRSID)),
}
)
)
self.mock_verify_token.assert_called_once()
self.assertEqual(self.mock_verify_token.call_args[0][0], self.expected_token)
self.assertEqual(
set(self.mock_verify_token.call_args[1]["audience"]),
{"http://testserver/", "http://testserver"},
)
def test_bad_id_token(self):
with self.assertRaisesMessage(AuthenticationFailed, "Invalid API Gateway token"):
self.auth.authenticate(
Loading