Skip to content

Commit b247fe7

Browse files
committed
add meta.md doc
1 parent 4c7f92b commit b247fe7

File tree

4 files changed

+83
-2
lines changed

4 files changed

+83
-2
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
additional_fields = {
2+
? "ref" => reference_type,
3+
? "template" => reference_type,
4+
? "reply" => reference_type,
5+
? "section" => text,
6+
? "collabs" => [+any],
7+
}
8+
9+
reference_type = UUID / [UUID, UUID]
10+
11+
UUID = #6.37(bytes)

docs/src/architecture/08_concepts/signed_doc/cddl/signed_doc_meta.cddl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ signed_doc_meta = {
1010
3 => text / int, ; "content type"
1111
? "Content-Encoding" / "content-encoding" => "br", ; payload content encoding
1212

13+
~meta.additional_fields,
14+
1315
* metadata-key => metadata-value
1416
}
1517

1618
metadata-key = int / text
1719
metadata-value = any
1820

19-
UUID = #6.37(bytes)
21+
UUID = #6.37(bytes)
22+
23+
;# include additional_meta as meta
Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,65 @@
1-
Something
1+
2+
<!-- markdownlint-disable max-one-sentence-per-line code-block-style -->
3+
??? note "Additional Metadata fields: `additional_meta.cddl`"
4+
5+
```CDDL
6+
{{ include_file('src/architecture/08_concepts/signed_doc/cddl/additional_meta.cddl', indent=4) }}
7+
```
8+
<!-- markdownlint-enable max-one-sentence-per-line code-block-style -->
9+
10+
## `ref` Document Reference
11+
12+
This is a reference to another document.
13+
The purpose of the `ref` will vary depending on the document [`type`](./spec.md#type).
14+
15+
The `ref` can be either a single [UUID] or a [CBOR] Array of Two [UUID].
16+
17+
If the `ref` is a single [UUID], it is a reference to the document of that [`id`](./spec.md#id).
18+
If the `ref` is a [CBOR] array, it has the form `[<id>,<ver>]` where:
19+
20+
* `<id>` = the [UUID] of the referenced documents [`id`](./spec.md#id)
21+
* `<ver>` = the [UUID] of the referenced documents [`ver`](./spec.md#ver).
22+
23+
## `template` Template Reference
24+
25+
If the document was formed from a template, this is a reference to that template document.
26+
The format is the same as the [CBOR] Array form of [`ref`](#ref-document-reference).
27+
28+
It is invalid not to reference the template that formed a document.
29+
If this is missing from such documents, the document will itself be considered invalid.
30+
31+
Template references must explicitly reference both the Template Document ID, and Version.
32+
33+
## `reply` Reply Reference
34+
35+
This is a reply to another document.
36+
The format is the same as the [CBOR] Array form of [`ref`](#ref-document-reference).
37+
38+
`reply` is always referencing a document of the same type, and that document must `ref` reference the same document `id`.
39+
However, depending on the document type, it may reference a different `ver` of that `id`.
40+
41+
## `section` Section Reference
42+
43+
This is a reference to a section of a document.
44+
It is a CBOR String, and contains a [JSON Path] identifying the section in question.
45+
46+
Because this metadata field uses [JSON Path], it can only be used to reference a document whose payload is [JSON].
47+
48+
## `collabs` Authorized Collaborators
49+
50+
This is a list of entities other than the original author that may also publish versions of this document.
51+
This may be updated by the original author, or any collaborator that is given "author" privileges.
52+
53+
The latest `collabs` list in the latest version, published by an authorized author is the definitive
54+
list of allowed collaborators after that point.
55+
56+
The `collabs` list is a [CBOR] Array.
57+
The contents of the array are TBD.
58+
59+
However, they will contain enough information such that each collaborator can be uniquely identified and validated.
60+
61+
*Note: An Author can unilaterally set the `collabs` list to any list of collaborators.
62+
It does NOT mean that the listed collaborators have agreed to collaborate, only that the Author
63+
gives them permission to.*
64+
65+
This list can impact actions that can be performed by the `Proposal Action Document`.

docs/src/architecture/08_concepts/signed_doc/spec.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ It fully inherits an original [COSE] design and specifies the details of differe
4848

4949
To uniquely specify a Catalyst Signed Document type, version etc., as it was mentioned before,
5050
a list of different metadata fields is specified.
51+
5152
Also as you can see from the specification,
5253
it is allowed to add any number of additional metadata fields, which could be specified for each `type` of document.
54+
A full list of considered additional metadata fields defined [here](./meta.md).
5355

5456
All these fields will be encoded as the [COSE] `protected` header
5557

0 commit comments

Comments
 (0)