-
Notifications
You must be signed in to change notification settings - Fork 518
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
Make mediation invitation parameter idempotent #1413
Make mediation invitation parameter idempotent #1413
Conversation
Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
To ease Aca-py's deployment in scenarios where command line arguments cannot be changed easily, make `--mediatior-invitation` and `--mediator-connections-invite` available to the `provision` command. `provision` stores the mediator invite to be used by `start` command. If the invitation changed, `start` updates the stored invite and uses the new one. Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
Whenever the conductor needs to setup a new mediation connection (eg: the invitation url provided by the command line arguments has changed), clear the old default mediator settings prior to setting up the new connection and default mediator. Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
Codecov Report
@@ Coverage Diff @@
## main #1413 +/- ##
==========================================
- Coverage 95.32% 95.30% -0.02%
==========================================
Files 482 483 +1
Lines 29154 29237 +83
==========================================
+ Hits 27791 27865 +74
- Misses 1363 1372 +9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
aries_cloudagent/core/conductor.py
Outdated
print("Attempting to connect to mediator...") | ||
del mgr | ||
except Exception as e: | ||
print(e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra print statement
I don't really understand what the goal is here. It seems like it's meant to store the mediation invitation if you add the argument to the provision command, but the conductor startup process is still looking for the |
Our issue is that in an automated scalable environment, new aca-py instances are spinned up with the same arguments as the original instance, thus retaining the However, I agree with your point that the conductor should not necessarily require the |
c048354
to
62dcf77
Compare
|
||
return updated_record | ||
|
||
async def get_mediation_invite_record( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this method should store and return the provided invitation, if any. At the moment it does not return the provided invitation if there is no stored invitation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I missed a case. Good catch
Mediation invite can be: * Specified at provision time and repeated at start time without creating more connections that necessary * Specified at provision and not repeated afterwards Stored invite is updated if a new invite is provided through arguments. Signed-off-by: Clément Humbert <clement.humbert@sicpa.com>
52903d8
to
59a62b1
Compare
To ease Aca-py's deployment in scenarios where command line arguments
cannot be changed easily, make
--mediator-invitation
and--mediator-connections-invite
available to theprovision
command.provision
stores the mediator invite to be used by the agent (effectively "provisioning" it).start
uses the stored invite. Once used, it does not establish connection again.If the invitation changes, the stored value is replaced by the new one, the default mediator is cleared and the new invitation
is used to establish connection.
Boy-scouting: I split the mediation invite tests apart from the other ones for the sake of easier comprehension/code management.