Skip to content

Commit b8ddd3a

Browse files
authored
Merge branch 'main' into fix/dependencies-format
2 parents d10dc39 + 0bbfe72 commit b8ddd3a

8 files changed

Lines changed: 190 additions & 4 deletions

demo/bdd_support/agent_backchannel_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ def aries_container_receive_credential(
130130
def aries_container_request_proof(
131131
the_container: AgentContainer,
132132
proof_request: dict,
133+
explicit_revoc_required: bool = False,
133134
):
134135
return run_coroutine(
135136
the_container.request_proof,
136137
proof_request,
138+
explicit_revoc_required=explicit_revoc_required,
137139
)
138140

139141

demo/features/0454-present-proof.feature

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Feature: RFC 0454 Aries agent present proof
9898
| Acme | --revocation --public-did --multitenant | --multitenant | driverslicense_v2 | Data_DL_MaxValues | DL_age_over_19_v2 |
9999

100100
@T003-RFC0454.1 @GHA
101-
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't
101+
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, neither credential is revoked
102102
Given we have "4" agents
103103
| name | role | capabilities |
104104
| Acme1 | issuer1 | <Acme1_capabilities> |
@@ -117,8 +117,28 @@ Feature: RFC 0454 Aries agent present proof
117117
| issuer1 | Acme1_capabilities | issuer2 | Acme2_capabilities | Bob_cap | Schema_name_1 | Credential_data_1 | Schema_name_2 | Credential_data_2 | Proof_request |
118118
| Acme1 | --revocation --public-did | Acme2 | --public-did | | driverslicense_v2 | Data_DL_MaxValues | health_id | Data_DL_MaxValues | DL_age_over_19_v2_with_health_id |
119119

120+
@T003-RFC0454.1f
121+
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, neither credential is revoked, fails due to requesting request-level revocation
122+
Given we have "4" agents
123+
| name | role | capabilities |
124+
| Acme1 | issuer1 | <Acme1_capabilities> |
125+
| Acme2 | issuer2 | <Acme2_capabilities> |
126+
| Faber | verifier | <Acme1_capabilities> |
127+
| Bob | prover | <Bob_cap> |
128+
And "<issuer1>" and "Bob" have an existing connection
129+
And "Bob" has an issued <Schema_name_1> credential <Credential_data_1> from "<issuer1>"
130+
And "<issuer2>" and "Bob" have an existing connection
131+
And "Bob" has an issued <Schema_name_2> credential <Credential_data_2> from "<issuer2>"
132+
And "Faber" and "Bob" have an existing connection
133+
When "Faber" sends a request for proof presentation <Proof_request> to "Bob"
134+
Then "Faber" has the proof verification fail
135+
136+
Examples:
137+
| issuer1 | Acme1_capabilities | issuer2 | Acme2_capabilities | Bob_cap | Schema_name_1 | Credential_data_1 | Schema_name_2 | Credential_data_2 | Proof_request |
138+
| Acme1 | --revocation --public-did | Acme2 | --public-did | | driverslicense_v2 | Data_DL_MaxValues | health_id | Data_DL_MaxValues | DL_age_over_19_v2_with_health_id_r2 |
139+
120140
@T003-RFC0454.2 @GHA
121-
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, and the revocable credential is revoked
141+
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, and the revocable credential is revoked, and the proof checks for revocation and fails
122142
Given we have "4" agents
123143
| name | role | capabilities |
124144
| Acme1 | issuer1 | <Acme1_capabilities> |
@@ -137,3 +157,25 @@ Feature: RFC 0454 Aries agent present proof
137157
Examples:
138158
| issuer1 | Acme1_capabilities | issuer2 | Acme2_capabilities | Bob_cap | Schema_name_1 | Credential_data_1 | Schema_name_2 | Credential_data_2 | Proof_request |
139159
| Acme1 | --revocation --public-did | Acme2 | --public-did | | driverslicense_v2 | Data_DL_MaxValues | health_id | Data_DL_MaxValues | DL_age_over_19_v2_with_health_id |
160+
| Acme1 | --revocation --public-did | Acme2 | --public-did | | driverslicense_v2 | Data_DL_MaxValues | health_id | Data_DL_MaxValues | DL_age_over_19_v2_with_health_id_r2 |
161+
162+
@T003-RFC0454.3 @GHA
163+
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, and the revocable credential is revoked, and the proof doesn't check for revocation and passes
164+
Given we have "4" agents
165+
| name | role | capabilities |
166+
| Acme1 | issuer1 | <Acme1_capabilities> |
167+
| Acme2 | issuer2 | <Acme2_capabilities> |
168+
| Faber | verifier | <Acme1_capabilities> |
169+
| Bob | prover | <Bob_cap> |
170+
And "<issuer1>" and "Bob" have an existing connection
171+
And "Bob" has an issued <Schema_name_1> credential <Credential_data_1> from "<issuer1>"
172+
And "<issuer1>" revokes the credential
173+
And "<issuer2>" and "Bob" have an existing connection
174+
And "Bob" has an issued <Schema_name_2> credential <Credential_data_2> from "<issuer2>"
175+
And "Faber" and "Bob" have an existing connection
176+
When "Faber" sends a request with explicit revocation status for proof presentation <Proof_request> to "Bob"
177+
Then "Faber" has the proof verified
178+
179+
Examples:
180+
| issuer1 | Acme1_capabilities | issuer2 | Acme2_capabilities | Bob_cap | Schema_name_1 | Credential_data_1 | Schema_name_2 | Credential_data_2 | Proof_request |
181+
| Acme1 | --revocation --public-did | Acme2 | --public-did | | driverslicense_v2 | Data_DL_MaxValues | health_id | Data_DL_MaxValues | DL_age_over_19_v2_with_health_id_no_revoc |
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"presentation": {
3+
"comment": "This is a comment for the send presentation.",
4+
"requested_attributes": {
5+
"address_attrs": {
6+
"cred_type_name": "Schema_DriversLicense_v2",
7+
"revealed": true,
8+
"cred_id": "replace_me"
9+
},
10+
"health_attrs": {
11+
"cred_type_name": "Schema_Health_ID",
12+
"revealed": true,
13+
"cred_id": "replace_me"
14+
}
15+
},
16+
"requested_predicates": {
17+
"age": {
18+
"cred_type_name": "Schema_DriversLicense_v2",
19+
"cred_id": "replace me"
20+
}
21+
},
22+
"self_attested_attributes": {}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"presentation": {
3+
"comment": "This is a comment for the send presentation.",
4+
"requested_attributes": {
5+
"address_attrs": {
6+
"cred_type_name": "Schema_DriversLicense_v2",
7+
"revealed": true,
8+
"cred_id": "replace_me"
9+
},
10+
"health_attrs": {
11+
"cred_type_name": "Schema_Health_ID",
12+
"revealed": true,
13+
"cred_id": "replace_me"
14+
}
15+
},
16+
"requested_predicates": {
17+
"age": {
18+
"cred_type_name": "Schema_DriversLicense_v2",
19+
"cred_id": "replace me"
20+
}
21+
},
22+
"self_attested_attributes": {}
23+
}
24+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"presentation_proposal": {
3+
"requested_attributes": {
4+
"address_attrs": {
5+
"name": "address",
6+
"restrictions": [
7+
{
8+
"schema_name": "Schema_DriversLicense_v2",
9+
"schema_version": "1.0.1"
10+
}
11+
]
12+
},
13+
"health_attrs": {
14+
"name": "health_id_num",
15+
"restrictions": [
16+
{
17+
"schema_name": "Schema_Health_ID",
18+
"schema_version": "1.0.0"
19+
}
20+
]
21+
}
22+
},
23+
"requested_predicates": {
24+
"age": {
25+
"name": "age",
26+
"p_type": ">",
27+
"p_value": 19,
28+
"restrictions": [
29+
{
30+
"schema_name": "Schema_DriversLicense_v2",
31+
"schema_version": "1.0.1"
32+
}
33+
]
34+
}
35+
},
36+
"version": "0.1.0"
37+
}
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"presentation_proposal": {
3+
"requested_attributes": {
4+
"address_attrs": {
5+
"name": "address",
6+
"restrictions": [
7+
{
8+
"schema_name": "Schema_DriversLicense_v2",
9+
"schema_version": "1.0.1"
10+
}
11+
]
12+
},
13+
"health_attrs": {
14+
"name": "health_id_num",
15+
"restrictions": [
16+
{
17+
"schema_name": "Schema_Health_ID",
18+
"schema_version": "1.0.0"
19+
}
20+
]
21+
}
22+
},
23+
"requested_predicates": {
24+
"age": {
25+
"name": "age",
26+
"p_type": ">",
27+
"p_value": 19,
28+
"restrictions": [
29+
{
30+
"schema_name": "Schema_DriversLicense_v2",
31+
"schema_version": "1.0.1"
32+
}
33+
]
34+
}
35+
},
36+
"version": "0.1.0"
37+
}
38+
}

demo/features/steps/0454-present-proof.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ def step_impl(context, verifier, request_for_proof, prover):
4343
context.proof_exchange = proof_exchange
4444

4545

46+
@when(
47+
'"{verifier}" sends a request with explicit revocation status for proof presentation {request_for_proof} to "{prover}"'
48+
)
49+
def step_impl(context, verifier, request_for_proof, prover):
50+
agent = context.active_agents[verifier]
51+
52+
proof_request_info = read_proof_req_data(request_for_proof)
53+
54+
proof_exchange = aries_container_request_proof(
55+
agent["agent"], proof_request_info, explicit_revoc_required=True
56+
)
57+
58+
context.proof_request = proof_request_info
59+
context.proof_exchange = proof_exchange
60+
61+
4662
@then('"{verifier}" has the proof verified')
4763
def step_impl(context, verifier):
4864
agent = context.active_agents[verifier]

demo/runners/agent_container.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ async def receive_credential(
928928

929929
return matched
930930

931-
async def request_proof(self, proof_request):
931+
async def request_proof(self, proof_request, explicit_revoc_required: bool = False):
932932
log_status("#20 Request proof of degree from alice")
933933

934934
if self.cred_type == CRED_FORMAT_INDY:
@@ -963,7 +963,7 @@ async def request_proof(self, proof_request):
963963
] = non_revoked
964964
non_revoked_supplied = True
965965

966-
if not non_revoked_supplied:
966+
if not non_revoked_supplied and not explicit_revoc_required:
967967
# else just make it global
968968
indy_proof_request["non_revoked"] = non_revoked
969969

@@ -1010,6 +1010,8 @@ async def verify_proof(self, proof_request):
10101010
print("No proof received")
10111011
return None
10121012

1013+
# log_status(f">>> last proof received: {self.agent.last_proof_received}")
1014+
10131015
if self.cred_type == CRED_FORMAT_INDY:
10141016
# return verified status
10151017
return self.agent.last_proof_received["verified"]

0 commit comments

Comments
 (0)