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

fix: did:mailto format per DID-core spec #31

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions w3-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ sequenceDiagram
participant Email as 📬<br/><br/>alice@web.mail

Agent ->> W3: access/authorize
Note right of Agent:🎟<br/>with: did:key:zAgent<br/>as: did:mailto:alice@web.mail
Note right of Agent:🎟<br/>with: did:key:zAgent<br/>as: did:mailto:web.mail:alice
W3 ->> Email: ✉️ Verification email
Email ->> W3: 🔗 Approve
W3 -->> Agent: ./update
Expand Down Expand Up @@ -72,7 +72,7 @@ User agent MAY invoke `access/authorize` capability request an authorization to
att: [{
with: "did:key:zAgent",
can: "access/authorize",
nb: { as: "did:mailto:alice@web.mail" }
nb: { as: "did:mailto:web.mail:alice" }
}]
}
```
Expand All @@ -81,13 +81,13 @@ Authority over the account MUST be verified by the capability provider as descri

#### authorize `with`

Resource MUST be a [`did:key`][] identifier of an agent that is requesting an authorization to sign [UCAN][]s issued by the [`did:mailto`][] principal in the [`nb.as`][issue `as`] field.
Resource MUST be a [`did:key`][] identifier of an agent that is requesting an authorization to sign [UCAN][]s issued by the [`did:mailto`][] principal in the [`nb.as`][authorize `as`] field.

> Please note that `with` field identifies requesting agent, which MAY be different from `iss` field identifying issuing agent.

#### authorize `as`

Value MUST be a [`did:mailto`][] identifier of the account that the agent wishes to represent via [`did:key`][] in the [`with`][issue `with`] field. It MUST be a valid [`did:mailto`][] identifier.
Value MUST be a [`did:mailto`][] identifier of the account that the agent wishes to represent via [`did:key`][] in the [`with`][authorize `with`] field. It MUST be a valid [`did:mailto`][] identifier.

## Email validation

Expand All @@ -102,7 +102,7 @@ Issued by trusted authority (usually one handling invocation that contains this
```ts
{
iss: "did:web:web3.storage",
aud: "did:mailto:alice@web.mail",
aud: "did:mailto:web.mail:alice",
att: [{
with: "did:web:web3.storage",
can: "./update",
Expand Down Expand Up @@ -137,7 +137,7 @@ When an agent creates a new space, it MAY delegate all capabilities or a subset,
```ts
{
iss: "did:key:zAliceSpace",
aud: "did:mailto:alice@web.mail",
aud: "did:mailto:web.mail:alice",
att: [{ with: "did:key:zAliceSpace", can: "*" }],
exp: null,
sig: "..."
Expand All @@ -154,7 +154,7 @@ Issued by an agent on behalf of an account to the service, with proof that the a

```ts
{
iss: "did:mailto:alice@web.mail",
iss: "did:mailto:web.mail:alice",
aud: "did:web:web3.storage",
att: [{
with: "did:mailto:web.mail",
Expand All @@ -163,10 +163,10 @@ Issued by an agent on behalf of an account to the service, with proof that the a
}],
prf: [
// Proof that did:key:zAgent may sign UCAN ☝️
// did:mailto:alice@web.mail
// did:mailto:web.mail:alice
{
iss: "did:web:web3.storage",
aud: "did:mailto:alice@web.mail",
aud: "did:mailto:web.mail:alice",
att: [{
with: "did:web:web3.storage",
can: "./update",
Expand All @@ -179,7 +179,7 @@ Issued by an agent on behalf of an account to the service, with proof that the a
// account to access space
{
iss: "did:key:zAliceSpace",
aud: "did:mailto:alice@web.mail",
aud: "did:mailto:web.mail:alice",
att: [{ with: "did:key:zAliceSpace", can: "*" }],
exp: null,
sig: "..."
Expand Down Expand Up @@ -211,18 +211,18 @@ Issued by an agent on behalf of an account to the service as a request for all v

```ts
{
iss: "did:mailto:alice@web.mail",
iss: "did:mailto:web.mail:alice",
aud: "did:web:web3.storage",
att: [{
with: "did:mailto:alice@web.mail",
with: "did:mailto:web.mail:alice",
can: "access/claim"
}],
prf: [
// proof that did:key:zAgent may represent
// did:mailto:alice@web.mail
// did:mailto:web.mail:alice
{
iss: "did:web:web3.storage",
aud: "did:mailto:alice@web.mail",
aud: "did:mailto:web.mail:alice",
att: [{
with: "did:web:web3.storage",
can: "./update",
Expand Down