Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update records write #257

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

andorsk
Copy link
Collaborator

@andorsk andorsk commented Aug 9, 2023

starting point to update records write. needs some work before merge, so adding as draft.

@andorsk andorsk force-pushed the ask/records-write branch from 7752d05 to ecff360 Compare August 9, 2023 13:45
@andorsk andorsk self-assigned this Aug 9, 2023
@andorsk andorsk added the artifact: spec intended for the actual specification label Aug 9, 2023
@andorsk andorsk added the stage: needs review needs review label Aug 23, 2023
@andorsk andorsk marked this pull request as ready for review September 6, 2023 10:04
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated
"type": "object",
"additionalProperties": false,
"required": [
"authorization",
"descriptor",
"recordId"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to keep all 3 in here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andorsk yeah this is just an implementation specific helper-schema that is used when creating a message that has not yet been signed by the signer. But a complete valid RecordsWrite message has to have all of those properties for it to be valid.

spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
spec/spec.md Outdated Show resolved Hide resolved
andorsk and others added 13 commits September 7, 2023 13:13
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: LiranCohen <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
Co-authored-by: Ted Thibodeau Jr <[email protected]>
- The message object ****MUST**** contain a `recordId` property, and its value ****MUST**** be the `recordId` of the logical record with which the entry corresponds. If the message is the initial entry for a new record, the value ****MUST**** be set to the string resulting from the [_Record ID Generation Process_](#recordid-generation).
- The object ****MAY**** contain a `contextId` property. If present, its value ****MUST**** be the deterministic ID for a contextually linked set of objects.
- The object ****MAY**** contain an `attestation` property. If present, its value ****MUST**** be a `string` representing the signing conditions detailed below. If the property is not present, evaluators ****MUST**** treat it as if its value was set to `optional`.
- If the message object is attached to a Protocol, the value of its `contextId` property ****MUST**** be a [_Computed Context ID_](#computed-context-ids). If the message is not attached to a Protocol, it ****MUST NOT**** contain a `contextId` property.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be folded into the rules described on line 841 or into bullet points under a single contextId line.

- The object ****MAY**** contain an `encryption` property, and if present its value ****Must**** be a string that matches one of the [Supported Encryption Formats](#supported-encryption-format), indicating the encryption format with which the data is encrypted. The absence of this property indicates the data is not encrypted.
- The object ****MAY**** include a `parentId` property if the currently active entry for the record is a `RecordsDelete` or a `CollectionWrite` that has a declared Commit Strategy. The object ****MUST NOT**** contain a `parentId` under any other circumstance. If present, the value of the `parentId` property ****MUST**** be the stringified [Version 1 CID](https://docs.ipfs.io/concepts/content-addressing/#identifier-formats) of the [DAG CBOR](https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-cbor.md) encoded `descriptor` object of the previous `RecordsWrite` or `RecordsDelete` entry the message is intended to overwrite.
- The object ****MAY**** contain a `protocol` property. If present, its value ****MUST**** be a URI that denotes the Protocol of which the object is a part.
- If the object contains a `protocol` property, the object ****MUST**** also contain a `protocolVersion` property. If present, its value ****MUST**** be a [SemVer](https://semver.org/) string that denotes the version of the Protocol of which the object is a part.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we currently do not use a protocolVersion property. I think there were talks of this in the past, but at the moment it's not used.

However there is a protocolPath property, and when it is specified the protocol property MUST be specified as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifact: spec intended for the actual specification stage: needs review needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants