...
- Pico A receives a
wrangler:subscription
event that includes the following attributes:name
- name of subscription (if none is supplied, a random subscription name will be generated)name_space
- name space for subscription (if none is suppliedshared
will be used as the name space)my_role
- Pico A's role in the subscription (if none is supplied,peer
will be used for the role)subscriber_role
- Pico B's role in the subscription (also defaults topeer
).subscriber_eci
- Pico B's well known ECI. Pico A must receive an ECI to contact Pico B. (This eci will be stored after the subscription has been accepted. Events should be sent to the outbound eci, not the original subscriber eci.)channel_type
- the channel type for Pico A's yet to be created inbound ECI (if none is supplied,subs
will be used).attrs
- the attributes for this subscription. These are used for Pico A's incoming channel's attributes. If none are supplied, the default is "status".
- Pico A sends a
wrangler:pending_subscription
event to Pico B, using the channel given by thesubscriber_eci
in step one with the following attributes:name
- name of subscription.name_space
- name space for subscription.my_role
- Pico B's role in the subscription.subscriber_role
- Pico A's role in the subscription.outbound_eci
- Pico A's newly created inbound ECI.channel_type
- the channel type for Pico B's yet to be created inbound ECI (the same as Pico A's).attributes
- the attributes for this subscription. These are used for Pico B's incoming channel's attributes.
Pico A also raises an internalwrangler:pending_subscription
event with the corresponding attributes above. - Upon receiving the
wrangler:pending_subscription
event, Pico B, creates a pending subscription (channel mentioned above) and raises thewrangler:inbound_pending_subscription_added
event. Pico A raises thewrangler:outbound_pending_subscription_added
event.
The state of each Picos subscription is static at this point. Pico A has an outgoing pending subscription and Pico B has an incoming pending subscription. - If Pico B wants to approve the subscription request, it raises the
wrangler:pending_subscription_approval
event with an attribute namedsubscription_name
giving the name of the channel/subscription to approve. Upon successfully creating the subscription. Pico B:- sends the
wrangler:pending_subscription_approved
event to Pico A on Pico B'soutbound_eci
value stored in its subscription. - raises the
wrangler:subscription_added
event
- sends the
- Upon receiving the
wrangler:pending_subscription_approved
event, Pico A adds an outbound_eci to the subscription on its side and raises thewrangler:subscription_added
event.- Pico A then raises the wrangler:sending_key event to faclitate a key exchange with the pico it is subscribing to.
- If Pico B wants to reject the subscription, it raises the
wrangler:subscription_cancellation
event (internally) with an attribute namedsubscription_name
- the name of the channel/subscription to reject. Pico B:- sends the
wrangler:subscription_removal
event to Pico A on Picos B outbound_eci, which then raises thewrangler:subscription_removed
event to itself. - raises the
wrangler:subscription_removal
event, which raises thewrangler:subscription_removed
event.
- sends the
...
Code Block |
---|
{ "eci": "cj3n6fe0w0003v8id271a0rlz", // pico B's new eci "name": "namespace:name", "type": "subssubscription", "attributes": { "subscription_name": "name", "name_space": "namespace", "relationship": "peer 2<->peer 1", "my_role": "peer 2", "subscriber_role": "peer 1", "outbound_eci": "cj3lyamf30003pi0n6u39rsqs", "status": "inbound", "attributes": "status", "subscriber_host": "http://localhost:8080", "sid": "namespace:name" } } |
wrangler:subscription_removed
...
Name | Value |
---|---|
channel_name | full subscription name(e.g. "namespace:name") |
...
verify_key | public cryptographic key used to verify digital signatures |
other_verify_key | the public crytpographic key from the pico that this pico is subscribed to. Used to verify digitally signed messages |
encryption_public_key | the public key that can can be used by another channel to create a shared secret, in conjuction with that channl's private key, to allow encryption and decryption. |
other_encryption_public_key | the public cryptographic key form the pico that this pico is subscribed to. It is used to allow encryption of channel messages. |
example value of getSubscriptions(){channel_name
}: (pico A)
Code Block |
---|
{ "eci": "cj3lyamf30003pi0n6u39rsqs", // pico A's new eci "name": "namespace:name", "type": "subscription", "verify_key": "F9S4uC6bZ9pDBZMPeKUHCHrhdMkrTq9GExj8HHtGDTKq", "other_verify_key": "GjmSgqkBpAcCkt9H179pqgrQ27zPn336aaNHHHtFspAz", "encryption_public_key": "3cyFiAMRpq1Q4ciEzSoQNzAQHr9voTCu9P46Kyx6qCUz", "typeother_encryption_public_key": "subs7y9dqgw7KucvYToAguuBP4Shf1cqtnhUF93waBR799e3", "attributes": { "subscription_name": "name", "name_space": "namespace", "relationship": "peer 1<->peer 2", "my_role": "peer 1", "subscriber_role": "peer 2", "subscriber_eci": "cj3ly7c9m0002pl0nk2zklk4g", "status": "status"subscribed", // changed "attributes": "status", "subscriber_host": "subscribedhttp://localhost:8081", // changed "attributesoutbound_eci": "statuscj3n6fe0w0003v8id271a0rlz", } } // now available to pico "subscriber_hostA |
example value of getSubscriptions(){channel_name
}: (pico B)
Code Block |
---|
{ "eci": "http://localhost:8081cj3n6fe0w0003v8id271a0rlz", // pico B's new eci "sidname": "namespace:name", "outbound_ecitype": "cj3n6fe0w0003v8id271a0rlzsubscription", } } // now available to pico A |
...
Code Block |
---|
{ "eci "verify_key": "GjmSgqkBpAcCkt9H179pqgrQ27zPn336aaNHHHtFspAz", "other_verify_key": "cj3n6fe0w0003v8id271a0rlzF9S4uC6bZ9pDBZMPeKUHCHrhdMkrTq9GExj8HHtGDTKq", // pico B's new eci "nameencryption_public_key": "namespace:name7y9dqgw7KucvYToAguuBP4Shf1cqtnhUF93waBR799e3", "typeother_encryption_public_key": "subs3cyFiAMRpq1Q4ciEzSoQNzAQHr9voTCu9P46Kyx6qCUz", "attributes": { "subscription_name": "name", "name_space": "namespace", "relationship": "peer 2<->peer 1", "my_role": "peer 2", "subscriber_role": "peer 1", "outbound_eci": "cj3lyamf30003pi0n6u39rsqs", "status": "subscribed", // changed "attributes: "status", "subscriber_host": "http://localhost:8080", "sid": "namespace:name" } } |
Subscription Functions
...