Skip to content

Commit

Permalink
Proposal for a new user data type for profile-linked documents
Browse files Browse the repository at this point in the history
  • Loading branch information
Wes Biggs committed Jun 3, 2024
1 parent f782332 commit d46a05f
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 2 deletions.
1 change: 1 addition & 0 deletions .spellcheckerdict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CalVer
CC0
Changelog
changeType
cid
[Cc]odec('s)?
contentHash
cryptographic
Expand Down
4 changes: 3 additions & 1 deletion pages/DSNP/Announcements.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ Each Announcement has an enumerated type for use when separating out a stream of
| 2 | [Broadcast](Types/Broadcast.md) | a public post | YES | YES |
| 3 | [Reply](Types/Reply.md) | a public response to a Broadcast | YES | YES |
| 4 | [Reaction](Types/Reaction.md) | a public visual reply to a Broadcast | no | no |
| 5 | [Profile](Types/Profile.md) | a profile | YES | no |
| 5 | ~~[Profile](Types/Profile.md)~~<sup>b</sup> | ~~a profile~~ | ~~YES~~ | ~~no~~ |
| 6 | [Update](Types/Update.md) | an update to content| YES | no |
| 7 | [Public Key](Types/PublicKey.md) | a public key for secure communication | no | no |

<sup>a</sup> Since DSNP version 1.2, social graph changes use [User Data](UserData.md) operations as described in the [Graph](Graph.md) section.

<sup>b</sup> Since DSNP version 1.3, profile changes use [User Data](UserData.md) operations.

## Announcement Validation

There is no guarantee that, at time of creation, a given Announcement will be from the `fromId` claimed in the Announcement.
Expand Down
48 changes: 48 additions & 0 deletions pages/DSNP/Types/CID.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# CID

A Content IDentifier is represented by the CID object type.

## Serialization

CID object serialization MUST conform to the following [Avro](https://avro.apache.org) schema:

```
{
"namespace": "org.dsnp",
"name": "CID",
"type": "record",
"doc": "Content IDentifier for external document",
"fields": [
{
"name": "cid",
"type": "string",
"doc": "Content IDentifier of document"
},
{
"name": "type",
"type": "int",
"doc": "Type of document"
}
]
}
```

## Generation

### cid

- MUST be a valid value per the [Content IDentifier](https://github.com/multiformats/cid) specification.

It should be possible to locate the content item associated with a CID on a content-addressed distributed file system.

### type

- MUST be a supported DSNP linked document type.

#### Supported Linked Document Types

| Value | Description | Specification | Content Type | DSNP Version Added |
| --- | --- | --- | --- |
| 1 | Activity Content Profile with DSNP extensions | [DSNP Profile](../../ActivityContent/Types/Profile.md) | `application/json` | 1.3 |

All other document type values are reserved for future expansion.
1 change: 1 addition & 0 deletions pages/DSNP/UserData.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ DSNP implementations MUST support the following User Data Types:
| <a name="private-follows">`privateFollows`</a> | 1.2 | `curve25519xsalsa20poly1305` | [`DEFLATE`](https://en.wikipedia.org/wiki/Deflate) | [GraphEdge](Types/GraphEdge.md) |
| <a name="private-connections">`privateConnections`</a> | 1.2 | `curve25519xsalsa20poly1305` | [`DEFLATE`](https://en.wikipedia.org/wiki/Deflate) | [GraphEdge](Types/GraphEdge.md) |
| <a name="private-connection-prids">`privateConnectionPRIds`</a> | 1.2 | NONE | NONE | [PRId](Types/PRId.md) |
| <a name="linked-cids">`linkedCIDs`</a> | 1.3 | NONE | NONE | [CID](Types/CID.md) |

Data for each data type is initially formatted as a stream of Avro objects that should conform to the schema specified.
Avro file- and block-level information (including in-stream schema) is omitted.
Expand Down
3 changes: 2 additions & 1 deletion pages/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@
- [User Data](DSNP/UserData.md)
- [Graph Edge](DSNP/Types/GraphEdge.md)
- [PRId](DSNP/Types/PRId.md)
- [CID](DSNP/Types/CID.md)
- [Batch Publications](DSNP/BatchPublications.md)
- [Announcements](DSNP/Announcements.md)
- [Tombstone](DSNP/Types/Tombstone.md)
- [Broadcast](DSNP/Types/Broadcast.md)
- [Reply](DSNP/Types/Reply.md)
- [Reaction](DSNP/Types/Reaction.md)
- [Profile](DSNP/Types/Profile.md)
- [Update](DSNP/Types/Update.md)
- [Public Key](DSNP/Types/PublicKey.md)
- [Migrated Announcements](DSNP/Migrated.md)
- [Graph Change](DSNP/Types/GraphChange.md)
- [Profile](DSNP/Types/Profile.md)
- [Operations](DSNP/Operations.md)
- [State Change Records](DSNP/Records.md)
- [Serializations](DSNP/Serializations.md)
Expand Down

0 comments on commit d46a05f

Please sign in to comment.