sicpa-dlab / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
1 stars 0 forks source link

Bug: Idempotency in mediator invitation flag #111

Open dbluhm opened 3 years ago

dbluhm commented 3 years ago

ACA-Py has the argument --mediator-invitation which is used to automate the process of connecting to a mediator, coordinating mediation, and setting that mediator as the default for future connections. The intent of this flag was to be used once on first startup; however, accounting for this in typical deployment scenarios is not trivial where no facilities exist for changing the startup command after the first run.

I think we could solve this a number of different ways but here are my suggestions:

My personal preference is for the first option since this operation aligns with the intent of the provision command. However, we should consult with Matteo to see which option is more conducive to real world deployments.

burdettadam commented 3 years ago

Invitations are stored with connection records? We could also check if the connection has been created with the same invitation as the one provided in the configuration and handle it correctly if it's been used already.

dbluhm commented 3 years ago

I don't believe the stored invitations are searchable by any value other than connection ID which would mean we'd either have to add tags to invitation records that make the invitation searchable or iterate through all connections and check the attached invitation. In the first scenario, the tag would have to be some value from within the invitation or the whole invitation URL itself. This is feasible but I lean towards just having one record type for last seen mediator invitation just because it's really simple.