openwallet-foundation / acapy

ACA-Py is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://aca-py.org
Apache License 2.0
416 stars 514 forks source link

dynamic ledger authorization table lookup for endorsers #1624

Open burdettadam opened 2 years ago

burdettadam commented 2 years ago

Currently, assumptions are made about the auth table stored on indy ledgers during checks for an endorser. For example, the role of an endorser will always have the authority to endorse new did (nyms) transactions. This assumption does not hold true for all indy ledgers since Indy ledgers allow customization of the auth table.

We could instead, retrieve the auth table from a ledger and encapsulate permissions logic to act accordingly. It is also worth noting if a ledgers fee table is active, the auth table behavior can change as well.

This issue hinders multi-ledger support.

swcurran commented 2 years ago

I'd like to have a discussion about this if you are interested. What I've been thinking:

Note that this service can also be a Trust Registry, that might give a VC to the authors to indicate their authority to issue credentials and/or respond to requests for information about issuer DIDs about their authority to issue credentials.

We (BC Gov) think we need this such that we have one Endorser across all of BC Gov, so it is aware of all issuers in the Enterprise and serves as a central repository (Trust Registry) for BC Gov. We think this can be built relatively generically, so that it can be deployed in other organizations and tuned as needed.

burdettadam commented 2 years ago

Brilliant! You have put a lot more thought into this than I have, but I recognize the need. ACA-Py would still need a process for looking up the auth table and then retrieving the required signatures/fees for a transaction. Separating concerns of an endorser into an "aries-endorser-service" would make things easier to implement. @frostyfrog has put some thought into the endorser's topic as well. @frostyfrog, do you have any insights to share?

TheTechmage commented 2 years ago

Funny that this was brought up, @dbluhm had recommended that I code up something similar to the aries-mediator-service as an endorser service. The initial goal of which is to handle endorsement requests in an automated manner. As I've been experimenting with ACA-Py to figure out Author/Endorser transactions, however, I've noticed that there are inconsistent responses from ACA-Py. Particularly when publishing SCHEMAs and CRED_DEFs. For instance, when I'm working directly against an agent with ENDORSER privileges to create a SCHEMA, I get a SchemaSendResultSchema formatted response. However, when I work against an agent with AUTHOR privileges, I get a TxnOrSchemaSendResultSchema formatted response with the sent property being UNSET.

The inconsistent behavior means that you can't have one code path in an application that's written against ACA-Py. As soon as an agent host switches to using the Author-Endorser workflow, the code in applications that rely on certain API calls may break if they don't account for the change in behavior.