Skip to content

Commit 20cbd63

Browse files
authored
Merge branch 'main' into fix/public-did-mediator-routing-keys
2 parents 3b1a00c + 0bbfe72 commit 20cbd63

12 files changed

Lines changed: 563 additions & 4 deletions

.github/workflows/pr-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: PR Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
tests:
8+
name: Tests
9+
uses: ./.github/workflows/tests.yml
10+
with:
11+
python-version: "3.6"
12+
os: "ubuntu-20.04"
13+
14+
tests-indy:
15+
name: Tests (Indy)
16+
uses: ./.github/workflows/tests-indy.yml
17+
with:
18+
python-version: "3.6"
19+
indy-version: "1.16.0"
20+
os: "ubuntu-20.04"

.github/workflows/tests-indy.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Tests (Indy)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
indy-version:
10+
required: true
11+
type: string
12+
os:
13+
required: true
14+
type: string
15+
16+
jobs:
17+
tests:
18+
name: Test Python ${{ inputs.python-version }} on Indy ${{ inputs.indy-version }}
19+
runs-on: ${{ inputs.os }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
23+
- name: Cache image layers
24+
uses: actions/cache@v3
25+
with:
26+
path: /tmp/.buildx-cache-test
27+
key: ${{ runner.os }}-buildx-test-${{ github.sha }}
28+
restore-keys: |
29+
${{ runner.os }}-buildx-test-
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@v1
33+
34+
- name: Build test image
35+
uses: docker/build-push-action@v3
36+
with:
37+
load: true
38+
context: .
39+
file: docker/Dockerfile.indy
40+
target: acapy-test
41+
tags: acapy-test:latest
42+
build-args: |
43+
python_version=${{ inputs.python-version }}
44+
indy_version=${{ inputs.indy-version }}
45+
cache-from: type=local,src=/tmp/.buildx-cache-test
46+
cache-to: type=local,dest=/tmp/.buildx-cache-test-new,mode=max
47+
48+
# Temp fix
49+
# https://github.com/docker/build-push-action/issues/252
50+
# https://github.com/moby/buildkit/issues/1896
51+
- name: Move cache
52+
run: |
53+
rm -rf /tmp/.buildx-cache-test
54+
mv /tmp/.buildx-cache-test-new /tmp/.buildx-cache-test
55+
56+
- name: Run pytest
57+
run: |
58+
docker run --rm acapy-test:latest

.github/workflows/tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
required: true
8+
type: string
9+
os:
10+
required: true
11+
type: string
12+
13+
jobs:
14+
tests:
15+
name: Test Python ${{ inputs.python-version }}
16+
runs-on: ${{ inputs.os }}
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python ${{ inputs.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ inputs.python-version }}
23+
cache: 'pip'
24+
cache-dependency-path: 'requirements*.txt'
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip3 install --no-cache-dir \
29+
-r requirements.txt \
30+
-r requirements.askar.txt \
31+
-r requirements.bbs.txt \
32+
-r requirements.dev.txt
33+
- name: Tests
34+
run: |
35+
pytest

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]

0 commit comments

Comments
 (0)