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

Bug: Idempotency in mediator invitation flag #111

Open
dbluhm opened this issue Aug 23, 2021 · 2 comments
Open

Bug: Idempotency in mediator invitation flag #111

dbluhm opened this issue Aug 23, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@dbluhm
Copy link
Collaborator

dbluhm commented Aug 23, 2021

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:

  • Create a new argument for the provision command that takes the mediator invitation and stores it. Then, on startup, ACA-Py will see this stored mediator invitation and use it to establish mediation (following the already established behavior of the --mediator-invitation argument on the start command, just not using the argument). Provision provides the correct setup semantics for this interaction but ACA-Py cannot engage in a DIDComm protocol until it is fully started, hence the actual mediation establishment only happening after startup.
  • Make the --mediator-invitation argument idempotent. This might be accomplished by storing the invitation passed in the argument and for each startup after where the invitation has not changed, do not attempt to establish a connection, coordinate mediation, or reset the default mediator.

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
Copy link

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
Copy link
Collaborator Author

dbluhm commented Aug 23, 2021

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.

@chumbert chumbert self-assigned this Sep 3, 2021
@xvilapueyo xvilapueyo added the bug Something isn't working label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants