Skip to content

Commit

Permalink
fix: test bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zicchio committed Jan 14, 2025
1 parent 6379289 commit e16e5a9
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_build_authorization_request_claims():

# case 0: minimal config
config = {
"scope": ["family_name", "given_name"],
"scopes": ["family_name", "given_name"],
"expiration_time": 1,
"presentation_definition": {
"id": "global-id",
Expand Down Expand Up @@ -73,15 +73,16 @@ def test_build_authorization_request_claims():

assert "aud" not in claims
assert "nonce" in claims
assert "presentation_definition" in claims
assert claims["response_mode"] == "direct_post.jwt"
assert claims["scope"] in ("familiy_name given_name", "given_name family_name")
assert claims["scope"] in ("family_name given_name", "given_name family_name")
assert claims["exp"] > claims["iat"]
assert claims["client_id"] == client_id
assert claims["response_type"] == "vp_token"

# case 1: config with aud
config_aud = {
"scope": ["family_name", "given_name"],
"scopes": ["family_name", "given_name"],
"expiration_time": 1,
"aud": "https://self-issued.me/v2",
"presentation_definition": {
Expand Down Expand Up @@ -115,15 +116,16 @@ def test_build_authorization_request_claims():

assert claims["aud"] == "https://self-issued.me/v2"
assert "nonce" in claims
assert "presentation_definition" in claims
assert claims["response_mode"] == "direct_post.jwt"
assert claims["scope"] in ("familiy_name given_name", "given_name family_name")
assert claims["scope"] in ("family_name given_name", "given_name family_name")
assert claims["exp"] > claims["iat"]
assert claims["client_id"] == client_id
assert claims["response_type"] == "vp_token"

# case 2: config with response mode
config_rmode = {
"scope": ["family_name", "given_name"],
"scopes": ["family_name", "given_name"],
"expiration_time": 1,
"response_mode": "direct_post",
"presentation_definition": {
Expand Down Expand Up @@ -157,8 +159,8 @@ def test_build_authorization_request_claims():

assert claims["response_mode"] == "direct_post"
assert "nonce" in claims
assert claims["response_mode"] == "direct_post.jwt"
assert claims["scope"] in ("familiy_name given_name", "given_name family_name")
assert "presentation_definition" in claims
assert claims["scope"] in ("family_name given_name", "given_name family_name")
assert claims["exp"] > claims["iat"]
assert claims["client_id"] == client_id
assert claims["response_type"] == "vp_token"

0 comments on commit e16e5a9

Please sign in to comment.