test: run the Tokenserver E2E tests without a cached JWK (#1390)

This commit is contained in:
Ethan Donowitz 2022-10-25 14:04:17 -04:00 committed by GitHub
parent 0ae5fd2059
commit 3a18de01bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -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<Jwk>,
/// A secondary JWK to be used to verify OAuth tokens. This is intended to be used to enable
/// seamless key rotations on FxA.

View File

@ -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)