Skip to content

Commit 8a6d6cd

Browse files
committed
tests: adapted tests
1 parent dd087b2 commit 8a6d6cd

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

pyeudiw/tests/satosa/test_backend.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ def test_request_endpoint_post(self, context):
10081008
context.request_method = "POST"
10091009
context.request = {
10101010
"wallet_metadata": {
1011+
"alg_values_supported": ["ES256"],
10111012
"vp_formats_supported": {
10121013
"dc+sd-jwt": {
10131014
"sd-jwt_alg_values": ["ES256"],
@@ -1050,6 +1051,7 @@ def test_request_endpoint_post(self, context):
10501051
header = decode_jwt_header(request_object_jwt)
10511052
payload = decode_jwt_payload(request_object_jwt)
10521053
assert header["alg"]
1054+
assert header["alg"] == "ES256"
10531055
assert header["kid"]
10541056
assert header["typ"] == "oauth-authz-req+jwt"
10551057
assert payload["scope"] == " ".join(CONFIG["authorization"]["scopes"])
@@ -1065,6 +1067,7 @@ def test_request_endpoint_post(self, context):
10651067

10661068
assert document["request_object"]["wallet_metadata"] == {
10671069
"client_id_prefixes_supported": None,
1070+
"alg_values_supported": ["ES256"],
10681071
"vp_formats_supported": {
10691072
"dc+sd-jwt": {
10701073
"sd-jwt_alg_values": ["ES256"],
@@ -1075,6 +1078,26 @@ def test_request_endpoint_post(self, context):
10751078

10761079
assert document["request_object"]["wallet_nonce"] == "qPmxiNFCR3QTm19POc8u"
10771080

1081+
context.request = {
1082+
"wallet_metadata": {
1083+
"alg_values_supported": ["RS256"],
1084+
"vp_formats_supported": {
1085+
"dc+sd-jwt": {
1086+
"sd-jwt_alg_values": ["ES256"],
1087+
"kb-jwt_alg_values": ["ES256"]
1088+
}
1089+
}
1090+
},
1091+
"wallet_nonce": "qPmxiNFCR3QTm19POc8u"
1092+
}
1093+
1094+
1095+
req_resp = self.backend.request_endpoint(context)
1096+
1097+
assert req_resp
1098+
assert req_resp.status == "400"
1099+
1100+
10781101
def test_trust_parameters_in_response(self, context):
10791102
internal_data = InternalData()
10801103
context.http_headers = dict(

0 commit comments

Comments
 (0)