... | ... | @@ -4,7 +4,9 @@ The blog client is a [BSP client](BSP) that synchronises blog posts among groups |
|
|
|
|
|
The client's identifier is `org.briarproject.briar.blog`.
|
|
|
|
|
|
Each blog has its own group. The [group descriptor](BSP#group-identifiers) is a [BDF list](BDF) with two elements: `author` (list) and `rss` (boolean). The `author` list has three elements: `formatVersion` (int), `nickname` (string) and `publicKey` (raw).
|
|
|
Each blog has its own BSP group. The [group descriptor](BSP#group-identifiers) is a [BDF list](BDF) with two elements: `author` (list) and `rss` (boolean).
|
|
|
|
|
|
`author` is a list with three elements: `formatVersion` (int), `nickname` (string) and `publicKey` (raw). This identifies the user who publishes the blog.
|
|
|
|
|
|
`rss` indicates whether the blog contains an imported RSS feed or a user's personal blog. `nickname` is used as the blog's title. Posts are signed with the private key corresponding to `publicKey`.
|
|
|
|
... | ... | @@ -16,20 +18,30 @@ The signature covers a BDF list with three elements: `groupId` (unique ID), `tim |
|
|
|
|
|
**1: COMMENT** - A pointer to a reblogged post or comment, with an optional comment. The message body is a BDF list with five elements: `messageType` (int), `comment` (string or null), `parentOriginalId` (unique ID), `parentId` (unique ID), and `signature` (raw).
|
|
|
|
|
|
`parentOriginalId` is the ID of a post or comment in this group or another group. `parentId` is the ID of the parent message, which is a post, comment, wrapped post or wrapped comment in this group that had the ID `parentOriginalId` in the group where it was originally posted. The signature covers a BDF list with five elements: `groupId` (unique ID), `timestamp` (int), `comment` (string or null), `parentOriginalId` (unique ID), and `parentId` (unique ID). The group ID and timestamp are taken from the message header. The public key from the group descriptor is used for verifying the signature.
|
|
|
`parentOriginalId` is the ID of a post or comment in this blog or another blog. `parentId` is the ID of this comment's parent, which is a post, comment, wrapped post or wrapped comment in this blog, which had the ID `parentOriginalId` in the blog where the parent was originally posted.
|
|
|
|
|
|
The signature covers a BDF list with five elements: `groupId` (unique ID), `timestamp` (int), `comment` (string or null), `parentOriginalId` (unique ID), and `parentId` (unique ID). The group ID and timestamp are taken from the message header. The public key from the group descriptor is used for verifying the signature.
|
|
|
|
|
|
**2: WRAPPED_POST** - A reblogged post from another blog. The message body is a BDF list with five elements: `messageType` (int), `copiedGroupDescriptor` (list), `copiedTimestamp` (int), `copiedContent` (string), and `copiedSignature` (raw).
|
|
|
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where the post was originally posted. `copiedTimestamp`, `copiedContent` and `copiedSignature` are copied from the original post. The public key from the original group descriptor is used for verifying the signature. The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments.
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where this post was originally posted. `copiedTimestamp`, `copiedContent` and `copiedSignature` are copied from the original post. The public key from the copied group descriptor is used for verifying the signature.
|
|
|
|
|
|
The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments.
|
|
|
|
|
|
**3: WRAPPED_COMMENT** - A reblogged comment from another blog. The message body is a BDF list with eight elements: `messageType` (int), `copiedGroupDescriptor` (list), `copiedTimestamp` (int), `copiedComment` (string or null), `copiedParentOriginalId` (unique ID), `copiedParentId` (unique ID), `copiedSignature` (raw), and `parentId` (unique ID).
|
|
|
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where the comment was originally posted. `copiedTimestamp`, `copiedComment`, `copiedParentOriginalId`, `copiedParentId` and `copiedSignature` are copied from the original comment. The public key from the original group descriptor is used for verifying the signature. The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments. `parentId` is the ID of the parent message, which is a post, comment, wrapped post or wrapped comment in this group that had the ID `copiedParentOriginalId` in the group where the parent was originally posted, and the ID `copiedParentId` in the group where the comment was originally posted.
|
|
|
`copiedGroupDescriptor` is the descriptor of the blog where this comment was originally posted. `copiedTimestamp`, `copiedComment`, `copiedParentOriginalId`, `copiedParentId` and `copiedSignature` are copied from the original comment. The public key from the copied group descriptor is used for verifying the signature.
|
|
|
|
|
|
The original group ID must be calculated, as it is covered by the signature. The original message ID must also be calculated, as it is referenced by comments.
|
|
|
|
|
|
`parentId` is the ID of this comment's parent, which is a post, comment, wrapped post or wrapped comment in this blog, which had the ID `copiedParentOriginalId` in the blog where the parent was originally posted, and the ID `copiedParentId` in the blog where this comment was originally posted.
|
|
|
|
|
|
### Validity policy
|
|
|
|
|
|
* A post is valid if it is well-formed and has a valid signature.
|
|
|
* A comment is valid if it is well-formed, has a valid signature, and references a valid message of any type in the same group.
|
|
|
* A comment is valid if it is well-formed, has a valid signature, and references a valid message of any type in the same blog, with a matching original ID.
|
|
|
* A wrapped post is valid if a valid post can be reconstructed from it.
|
|
|
* A wrapped comment is valid if a valid comment can be reconstructed from it, and it references a valid message of any type in the same blog, with a matching original ID.
|
|
|
|
|
|
### Storage policy
|
|
|
|
... | ... | |