From 3a18de01bbf5b5c0bcb87d4176fde14840629ae2 Mon Sep 17 00:00:00 2001 From: Ethan Donowitz <8703826+ethowitz@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:04:17 -0400 Subject: [PATCH] test: run the Tokenserver E2E tests without a cached JWK (#1390) --- tokenserver-settings/src/lib.rs | 3 ++- tools/integration_tests/run.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tokenserver-settings/src/lib.rs b/tokenserver-settings/src/lib.rs index 7d6590f8..ab254750 100644 --- a/tokenserver-settings/src/lib.rs +++ b/tokenserver-settings/src/lib.rs @@ -29,7 +29,8 @@ pub struct Settings { pub fxa_oauth_request_timeout: u64, /// The JWK to be used to verify OAuth tokens. Passing a JWK to the PyFxA Python library /// prevents it from making an external API call to FxA to get the JWK, yielding substantial - /// performance benefits. + /// performance benefits. This value should match that on the `/v1/jwks` endpoint on the FxA + /// Auth Server. pub fxa_oauth_primary_jwk: Option, /// A secondary JWK to be used to verify OAuth tokens. This is intended to be used to enable /// seamless key rotations on FxA. diff --git a/tools/integration_tests/run.py b/tools/integration_tests/run.py index 3849cc70..f0ffc183 100644 --- a/tools/integration_tests/run.py +++ b/tools/integration_tests/run.py @@ -75,4 +75,19 @@ if __name__ == "__main__": finally: terminate_process(the_server_subprocess) + # Run the Tokenserver end-to-end tests without the JWK cached + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KTY"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__ALG"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KID"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__FXA_CREATED_AT"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__USE"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__N"] + del os.environ["SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__E"] + + the_server_subprocess = start_server() + try: + res |= run_end_to_end_tests() + finally: + terminate_process(the_server_subprocess) + sys.exit(res)