Skip to content

Commit

Permalink
docs: add w3 plan basic spec
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jan 18, 2024
1 parent 98630cb commit e55868a
Showing 1 changed file with 123 additions and 0 deletions.
123 changes: 123 additions & 0 deletions w3-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Space

![status:reliable](https://img.shields.io/badge/status-reliable-green.svg?style=flat-square)

## Editors

- [Vasco Santos], [Protocol Labs]

## Authors

- [Vasco Santos], [Protocol Labs]


Check failure on line 13 in w3-plan.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Multiple consecutive blank lines [Expected: 1; Actual: 2]

w3-plan.md:13 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
## Abstract

A Plan

- [Capabilities](#capabilities)
- [`plan/get`](#planget)
- [`plan/set`](#planset)

## Language

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119](https://datatracker.ietf.org/doc/html/rfc2119).


Check failure on line 26 in w3-plan.md

View workflow job for this annotation

GitHub Actions / markdown-link-check

Multiple consecutive blank lines [Expected: 1; Actual: 2]

w3-plan.md:26 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
## Capabilities

### `plan/get`

Capability can be invoked to get information about the plan that the account is currently signed up for.

> `did:mailto:web.mail:alice` invokes `plan/get` capability provided by `did:web:web3.storage`
```json
{
"iss": "did:mailto:web.mail:alice",
"aud": "did:web:web3.storage",
"att": [
{
"with": "did:mailto:web.mail:alice",
"can": "plan/get"
}
],
"prf": [],
"sig": "..."
}
```

#### Plan Get Failure

```json
{
"ran": "bafy...planGet",
"out": {
"error": {
"name": "PlanNotFound"
}
}
}
```

#### Plan Get Success

```json
{
"ran": "bafy...planGet",
"out": {
"ok": {
"product": "did:web:starter.web3.storage",
"updatedAt": "2024-01-05T06:56:26.074Z"
}
}
}
```

### `plan/set`

Capability can be invoked to change a billing plan of an account.

> `did:mailto:web.mail:alice` invokes `plan/set` capability provided by `did:web:web3.storage`
```json
{
"iss": "did:mailto:web.mail:alice",
"aud": "did:web:web3.storage",
"att": [
{
"with": "did:mailto:web.mail:alice",
"can": "plan/set",
"nb": {
"product": "did:web:starter.web3.storage"
}
}
],
"prf": [],
"sig": "..."
}
```

#### Plan Set Failure

```json
{
"ran": "bafy...planSet",
"out": {
"error": {
"name": "AccountNotFound"
}
}
}
```

#### Plan Set Success

```json
{
"ran": "bafy...planSet",
"out": {
"ok": {}
}
}
```

0 comments on commit e55868a

Please sign in to comment.