Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use default wallet type askar for alice/faber demo and bdd tests #1761

Merged
merged 16 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ There are several demos available for ACA-Py mostly (but not only) aimed at deve
- [Multi-ledger](#multi-ledger)
- [DID Exchange](#did-exchange)
- [Endorser](#endorser)
- [Run Askar Backend](#run-askar-backend)
- [Run Indy-SDK Backend](#run-indy-sdk-backend)
- [Learning about the Alice/Faber code](#learning-about-the-alicefaber-code)
- [OpenAPI (Swagger) Demo](#openapi-swagger-demo)
- [Performance Demo](#performance-demo)
Expand Down Expand Up @@ -247,12 +247,12 @@ Note that you can't (currently) use the DID Exchange protocol to connect with an

This is described in [Endorser.md](Endorser.md)

### Run Askar Backend
### Run Indy-SDK Backend

This runs using the askar libraries instead of indy-sdk:
This runs using the indy-sdk libraries instead of askar:

```bash
./run_demo faber --wallet-type askar
./run_demo faber --wallet-type indy
```

### Mediation
Expand Down Expand Up @@ -404,14 +404,20 @@ You can also run the demo against a postgres database using the following:

(Obvs you need to be running a postgres database - the command to start postgres is in the yml file provided above.)

You can tweak the number of credentials issued using the `--count` and `--batch` parameters, and you can run against an Askar database using the `--wallet-type askar` option.
You can tweak the number of credentials issued using the `--count` and `--batch` parameters, and you can run against an Askar database using the `--wallet-type askar` option (or run using indy-sdk using `--wallet-type indy`).

An example full set of options is:

```bash
./run_demo performance --arg-file demo/postgres-indy-args.yml -c 10000 -b 10 --wallet-type askar
```

Or:

```bash
./run_demo performance --arg-file demo/postgres-indy-args.yml -c 10000 -b 10 --wallet-type indy
```

## Coding Challenge: Adding ACME

Now that you have a solid foundation in using ACA-Py, time for a coding challenge. In this challenge, we extend the Alice-Faber command line demo by adding in ACME Corp, a place where Alice wants to work. The demo adds:
Expand Down
2 changes: 1 addition & 1 deletion demo/alice-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PYTHONPATH=.. ../bin/aca-py start \
--outbound-transport http \
--admin 0.0.0.0 8031 \
--admin-insecure-mode \
--wallet-type indy \
--wallet-type askar \
--wallet-name alice.agent420695 \
--wallet-key alice.agent420695 \
--preserve-exchange-records \
Expand Down
2 changes: 1 addition & 1 deletion demo/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ services:
--tails-server-base-url 'https://tails-test.vonx.io' \
--notify-revocation \
--monitor-revocation-notification \
--wallet-type 'indy' \
--wallet-type 'askar' \
--wallet-name 'acapy_agent_wallet' \
--wallet-key 'key' \
--wallet-storage-type 'postgres_storage' \
Expand Down
2 changes: 1 addition & 1 deletion demo/faber-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PYTHONPATH=.. ../bin/aca-py start \
--outbound-transport http \
--admin 0.0.0.0 8021 \
--admin-insecure-mode \
--wallet-type indy \
--wallet-type askar \
--wallet-name faber.agent916333 \
--wallet-key faber.agent916333 \
--preserve-exchange-records \
Expand Down
16 changes: 15 additions & 1 deletion demo/features/0453-issue-credential.feature
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,19 @@ Feature: RFC 0453 Aries agent issue credential
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --revocation --public-did | | driverslicense | Data_DL_NormalizedValues |
| --revocation --public-did --did-exchange | --did-exchange | driverslicense | Data_DL_NormalizedValues |
| --revocation --public-did --mediation | --mediation | driverslicense | Data_DL_NormalizedValues |
| --revocation --public-did --multitenant | --multitenant | driverslicense | Data_DL_NormalizedValues |

@T004.1-RFC0453
Scenario Outline: Issue a credential with revocation, with the Issuer beginning with an offer, and then revoking the credential
Given we have "2" agents
| name | role | capabilities |
| Acme | issuer | <Acme_capabilities> |
| Bob | holder | <Bob_capabilities> |
And "Acme" and "Bob" have an existing connection
And "Bob" has an issued <Schema_name> credential <Credential_data> from "Acme"
Then "Acme" revokes the credential
And "Bob" has the credential issued

Examples:
| Acme_capabilities | Bob_capabilities | Schema_name | Credential_data |
| --revocation --public-did --mediation | --mediation | driverslicense | Data_DL_NormalizedValues |
4 changes: 2 additions & 2 deletions demo/features/0454-present-proof.feature
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Feature: RFC 0454 Aries agent present proof
| Acme | --revocation --public-did --mediation | | driverslicense_v2 | Data_DL_MaxValues | DL_age_over_19_v2 |
| Acme | --revocation --public-did --multitenant | --multitenant | driverslicense_v2 | Data_DL_MaxValues | DL_age_over_19_v2 |

@T003-RFC0454.1
@T003-RFC0454.1 @GHA
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't
Given we have "4" agents
| name | role | capabilities |
Expand All @@ -117,7 +117,7 @@ Feature: RFC 0454 Aries agent present proof
| issuer1 | Acme1_capabilities | issuer2 | Acme2_capabilities | Bob_cap | Schema_name_1 | Credential_data_1 | Schema_name_2 | Credential_data_2 | Proof_request |
| 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 |

@T003-RFC0454.2
@T003-RFC0454.2 @GHA
Scenario Outline: Present Proof for multiple credentials where the one is revocable and one isn't, and the revocable credential is revoked
Given we have "4" agents
| name | role | capabilities |
Expand Down
2 changes: 1 addition & 1 deletion demo/local-indy-args.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ auto-ping-connection: true
# curl -d '{"seed":"my_seed_000000000000000000000000", "role":"TRUST_ANCHOR", "alias":"My Agent"}' -X POST http://localhost:9000/register
# note that the env var name is configured in argparse.py
# seed = comes from ACAPY_WALLET_SEED
wallet-type: indy
wallet-type: askar
wallet-name: testwallet
# wallet-key = comes from ACAPY_WALLET_KEY
# run a local postgres (docker) like:
Expand Down
2 changes: 1 addition & 1 deletion demo/runners/support/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __init__(
else seed
)
self.storage_type = params.get("storage_type")
self.wallet_type = params.get("wallet_type") or "indy"
self.wallet_type = params.get("wallet_type") or "askar"
self.wallet_name = (
params.get("wallet_name") or self.ident.lower().replace(" ", "") + rand_name
)
Expand Down
2 changes: 1 addition & 1 deletion demo/runners/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def progress(*args, **kwargs):


def check_requires(args):
wtype = args.wallet_type or "indy"
wtype = args.wallet_type or "askar"

if wtype == "indy":
try:
Expand Down