Skip to content

Commit

Permalink
fix warnings in tests (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillp authored Oct 1, 2024
1 parent 8d0ca66 commit abbcdf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_invalid_auth(token_endpoint: str) -> None:
OAuth2Client(
token_endpoint,
client_secret="client_secret",
private_key=Jwk.generate_for_kty("EC", crv="P-256"),
private_key=Jwk.generate(alg="ES256"),
)


Expand Down Expand Up @@ -1386,7 +1386,7 @@ def test_pushed_authorization_request_error(


def test_jwt_bearer_grant(requests_mock: RequestsMocker, oauth2client: OAuth2Client, token_endpoint: str) -> None:
key = Jwk.generate_for_kty("EC", alg="ES256")
key = Jwk.generate(alg="ES256")
assertion = Jwt.sign({"iat": 1661759343, "exp": 1661759403, "sub": "some_user_id"}, key)
scope = "my_scope"

Expand Down Expand Up @@ -1438,8 +1438,8 @@ class CustomBearerToken(BearerToken):


def test_client_jwks() -> None:
private_key = Jwk.generate_for_alg(SignatureAlgs.RS256).with_kid_thumbprint()
id_token_decryption_key = Jwk.generate_for_alg(KeyManagementAlgs.ECDH_ES_A256KW).with_kid_thumbprint()
private_key = Jwk.generate(alg=SignatureAlgs.RS256).with_kid_thumbprint()
id_token_decryption_key = Jwk.generate(alg=KeyManagementAlgs.ECDH_ES_A256KW, crv="P-256").with_kid_thumbprint()
client = OAuth2Client(
authorization_endpoint="https://as.local/authorize",
token_endpoint="https://as.local/token",
Expand Down Expand Up @@ -1481,7 +1481,7 @@ def test_client_authorization_server_jwks() -> None:


def test_client_id_token_decryption_key() -> None:
decryption_key = Jwk.generate(alg=KeyManagementAlgs.ECDH_ES_A256KW)
decryption_key = Jwk.generate(alg=KeyManagementAlgs.ECDH_ES_A256KW, crv="P-256")
assert (
OAuth2Client(
"https://as.local/token", client_id="client_id", id_token_decryption_key=decryption_key
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def test_invalid_id_token(token_endpoint: str) -> None:
BearerToken(access_token="an_access_token", expires_in=60, id_token="foo")

sig_jwk = Jwk.generate(alg=SignatureAlgs.RS256).with_kid_thumbprint()
enc_jwk = Jwk.generate(alg=KeyManagementAlgs.ECDH_ES_A256KW).with_kid_thumbprint()
enc_jwk = Jwk.generate(alg=KeyManagementAlgs.ECDH_ES_A256KW, crv="P-256").with_kid_thumbprint()
as_jwks = sig_jwk.public_jwk().as_jwks()

issuer = "http://issuer.local"
Expand Down

0 comments on commit abbcdf0

Please sign in to comment.