-
Notifications
You must be signed in to change notification settings - Fork 0
MessageData
Äkwav edited this page Oct 1, 2019
·
2 revisions
When commands are sent they take the form of MessageData.
Usually it is serialized via MessagePack, but that is hard to read so here we use json.
A serialized MessageData looks like this:
{
"senderId":[1,5],
"receiverId":[2,7],
"slug":"msg",
"data":"[encrypted] hi",
"i":29,
"headers":[{"Authorization=Token"}]
"x":"signature"
}
- the senderId is the one sending the message, he has to be authorized.
- the receiverId (SourceReference) is the one to who the message should be delivered
- slug is the unique indentifier
- data is some payload
- headers contains additional information about the message like Authorization (type 1)
- i is a counter (may include the time)
-
xis the signature created by signing everything else with thesecretKeyof theResourcebehindsenderId. If that Resource doesn't have aKeyPairthis field is set to null.
-
Authorization(Id:1) may contain a Token that Authorizes thesenderto execute the command.
Is created by signing everything else with the secretKey of the Resource behind senderId. If that Resource doesn't have a KeyPair this field is set to null.
If a publicKey is known but the field isn't set the command has to be dropped.
Has to be incremented by at least one every message.
Is an unique identifier for the command that should be executed on the receivers side.