Skip to content

Commit

Permalink
fix: removing translation layer for jwcrypto library
Browse files Browse the repository at this point in the history
  • Loading branch information
LadyCodesItBetter committed Nov 12, 2024
1 parent dff5316 commit 938c71a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyeudiw/oauth2/dpop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def proof(self):
data,
protected={
'typ': "dpop+jwt",
'jwk': self.private_jwk.public_key
'jwk': self.private_jwk.serialize()
}
)
return jwt
Expand Down
9 changes: 5 additions & 4 deletions pyeudiw/tests/oauth2/test_dpop.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from cryptojwt.jwk.ec import new_ec_key
from cryptojwt.jwk.rsa import new_rsa_key

PRIVATE_JWK = new_ec_key('P-256')
PUBLIC_JWK = PRIVATE_JWK.public_key
PRIVATE_JWK_EC = new_ec_key('P-256')
PRIVATE_JWK = PRIVATE_JWK_EC.serialize(private=True)
PUBLIC_JWK = PRIVATE_JWK_EC.serialize()


WALLET_INSTANCE_ATTESTATION = {
Expand Down Expand Up @@ -68,7 +69,7 @@ def wia_jws(jwshelper):
return wia


def test_create_validate_dpop_http_headers(wia_jws, private_jwk=PRIVATE_JWK):
def test_create_validate_dpop_http_headers(wia_jws, private_jwk=PRIVATE_JWK_EC):
# create
header = decode_jwt_header(wia_jws)
assert header
Expand Down Expand Up @@ -108,7 +109,7 @@ def test_create_validate_dpop_http_headers(wia_jws, private_jwk=PRIVATE_JWK):
)
assert dpop.is_valid

other_jwk = new_rsa_key().public_key
other_jwk = new_rsa_key().serialize()
dpop = DPoPVerifier(
public_jwk=other_jwk,
http_header_authz=f"DPoP {wia_jws}",
Expand Down

0 comments on commit 938c71a

Please sign in to comment.