Introduces a new COB type to store repository identity documents. The reason for this change is to: 1. Simplify the code, as the identity document logic resembled a COB, yet it had custom logic. This allows existing COB code to be used for identities. 2. Make identity document update logic more flexible, since COB actions can be added in the future. 3. Re-purpose existing tools around COBs to work on identities, eg. `rad cob`. 4. Unify the concept of an identity change proposal, with regular identity changes. This means we can remove the `id.proposal` COB in favor of using the `id` COB itself. Notes ----- * Each repository has one Identity COB. * The `Proposal` COB has been repurposed into the `Identity` COB. * Identity documents are stored as *embeds* inside the Identity COB actions. * The action that contains new document versions is called `revision`, just like the Patches COB. * The namespaced `rad/id` ref is a symbolic reference to that Identity COB. * The canonical `rad/id` ref is a direct reference to the commit in the Identity COB that contains the latest *accepted* revision of the document. * All commands for managing identities have been folded into `rad id`. Hence `rad delegate` and `rad edit` are removed. * The concept of "rebasing" an identity document is gone. * The `rad id` output has been updated to match the style of other commands. * When a revision has enough signatures, it is automatically adopted as the current identity, there is no longer the need for a "commit" action. * When an identity revision is proposed, and the current identity has a threshold of `1`, that identity is automatically accepted due to the above point. * The idea of "verifying a peer's identity branch" no longer applies, as COBs cannot be verified one history at a time. * Since the root commit of the Identity COB does not have a "Resource" to point to (it would have to point to itself, which is impossible), we've made the resource id optional for COBs.
5.3 KiB
At some point in the lifetime of a Radicle project you may want to
collaborate with someone else allowing them to become a project
maintainer. This requires adding them as a delegate and possibly
editing the threshold for passing new changes to the identity of the
project.
For cases where threshold > 1, it is necessary to gather a quorum of
signatures to update the Radicle identity. To do this, we use the rad id
command. For now, since we are the only delegate, and treshold is 1, we
can update the identity ourselves.
Let's add Bob as a delegate using their DID,
did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn, and update the
threshold to 2.
$ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delegate did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn --threshold 2
✓ Identity revision d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f created
╭───────────────────────────────────────────────────────────────────╮
│ Title Add Bob │
│ Revision d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f │
│ Blob 7109c1c201c223dd4e9fdb10f7330dc6f0310258 │
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
│ State accepted │
│ Quorum yes │
│ │
│ Add Bob as a delegate │
├───────────────────────────────────────────────────────────────────┤
│ ✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) │
╰───────────────────────────────────────────────────────────────────╯
@@ -1,13 +1,14 @@
{
"payload": {
"xyz.radicle.project": {
"defaultBranch": "master",
"description": "Radicle Heartwood Protocol & Stack",
"name": "heartwood"
}
},
"delegates": [
- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn"
],
- "threshold": 1
+ "threshold": 2
}
Before moving on, let's take a few notes on this output. The first thing we'll notice is that the difference between the current identity document and the proposed changes are shown. Specifically, we changed the delegates and threshold:
"delegates": [
- "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi"
+ "did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
+ "did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn"
],
...
- "threshold": 1
+ "threshold": 2
Next we have the number of signatures from delegates, which includes our own:
✓ did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
Finally, we can see whether the Quorum was reached:
Quorum yes
Since the threshold was previously 1, this change is now in effect. We
can verify that by listing the current identity document:
$ rad inspect --identity
{
"payload": {
"xyz.radicle.project": {
"defaultBranch": "master",
"description": "Radicle Heartwood Protocol & Stack",
"name": "heartwood"
}
},
"delegates": [
"did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi",
"did:key:z6MkedTZGJGqgQ2py2b8kGecfxdt2yRdHWF6JpaZC47fovFn"
],
"threshold": 2
}
We can also look at the document's COB directly:
$ rad cob show --object 2317f74de0494c489a233ca6f29f2b8bff6d4f15 --type xyz.radicle.id --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
commit d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f
parent 2317f74de0494c489a233ca6f29f2b8bff6d4f15
author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
date Thu, 15 Dec 2022 17:28:04 +0000
{
"blob": "7109c1c201c223dd4e9fdb10f7330dc6f0310258",
"description": "Add Bob as a delegate",
"parent": "2317f74de0494c489a233ca6f29f2b8bff6d4f15",
"signature": "z3sne3sdReZ4AtgxQmn7R1pQnz7E9ZEUoRfCJDJ8ytgnBMFW4DJqRHuBz2h1NK4QdGEy3QCpyVoJKfE95tNoivXwz",
"title": "Add Bob",
"type": "revision"
}
commit 2317f74de0494c489a233ca6f29f2b8bff6d4f15
author z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
date Thu, 15 Dec 2022 17:28:04 +0000
{
"blob": "d96f425412c9f8ad5d9a9a05c9831d0728e2338d",
"parent": null,
"signature": "z5nGqUvrmfiSyLjNCHWTWYvVMcPUZcvo9TxPKzEKXYBdSgUzbrqf1cYsmpGgbQvYunnsrLSsubEmxZaRdKM4quqQR",
"title": "Initial revision",
"type": "revision"
}
Note that once a revision is accepted, it can't be edited, redacted or otherwise acted upon:
$ rad id redact d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f
✗ Error: [..]
$ rad id reject d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f
✗ Error: [..]
$ rad id accept d067ffc7bf65d318dd68ca4b8c7adf61a369ea2f
✗ Error: [..]