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

Raise an event when a DID exchange results in a connection being established #644

Open
b1conrad opened this issue Sep 6, 2023 · 3 comments · May be fixed by #648
Open

Raise an event when a DID exchange results in a connection being established #644

b1conrad opened this issue Sep 6, 2023 · 3 comments · May be fixed by #648

Comments

@b1conrad
Copy link
Member

b1conrad commented Sep 6, 2023

We need the dido library to raise an event at the moment when a DID exchange results in a connection being established. This needs to happen both for the pico receiving the invitation and the one that generated it. An application ruleset (that uses io.picolabs.did-o as a module) would react to this event and maintain a list of connections, on top of the didMap function that the did-o ruleset already provides (the app ruleset is not part of what is asked for here, but is the rationale).

Event attributes need to include

  1. the role of this pico (whether "inviter" or "invitee")
  2. the label from the invitation
  3. the DID that this pico is going to use going forward
  4. the DID that the other pico has communicated for use going forward
  5. anything else that is available and might be useful
@b1conrad
Copy link
Member Author

b1conrad commented Sep 9, 2023

On the invitee side of a new connection, it might suffice to add this to the receive_invite rule:

     }
     fired {
       raise dido event "send_trust_ping" attributes event:attrs.put("did", invite{"from"})
+      raise dido event "invitation_accepted" attributes {
+        "invite":invite, "my_did":new_did{"id"}
+      }
     }
   }

The dido:invitation_accepted event could then be selected by a rule (in another ruleset) that could obtain

  1. the role would be "invitee"
  2. the label would be event:attrs{["invite","label"]}
  3. the DID for this pico would be event:attrs{"my_did"}
  4. the DID for the other pico would be event:attrs{["invite","from"]}
  5. anything else out of event:attrs{"invite"}, such as perhaps the time when the invitation was created (computed as time:new(event:attrs{["invite","created_time"]}*1000))

@joshmann35
Copy link
Contributor

@b1conrad This is doable, and I'm in the process of implementing it.

joshmann35 added a commit that referenced this issue Sep 12, 2023
@joshmann35 joshmann35 linked a pull request Sep 12, 2023 that will close this issue
@b1conrad
Copy link
Member Author

Can we have a brief meeting, at your convenience, to talk through this? @joshmann35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants