Add info on signature and seq keys to readme

This commit is contained in:
Kristóf Tóth 2018-07-30 09:34:13 +02:00
parent a04b078513
commit 3bc30ab503
1 changed files with 6 additions and 2 deletions

View File

@ -76,20 +76,24 @@ The TFW message format:
```text
{
"key: "some identifier used for addressing",
"key: ...some identifier used for addressing...,
"data":
{
...
JSON object carrying anything, preferably cats
...
},
"trigger": "FSM action"
"trigger": ...FSM action...,
"signature": ...HMAC signature for authenticated messages...,
"seq": ...sequence number...
}
```
- The `key` field is used by TFW for addressing and every message must have one (it can be an empty string though)
- The `data` object can contain anything you might want to send
- The `trigger` key is an optional field that triggers an FSM action with that name from the current state (whatever that might be)
- The `signature` field is present on authenticated messages (such as `fsm_update`s)
- The `seq` key is a counter incremented with each proxied message in the TFW server
To mirror messages back to their sources you can use a special messaging format, in which the message to be mirrored is enveloped inside the `data` field of the outer message: