aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-06 15:27:01 -0700
committerDrew DeVault <sir@cmpwn.com>2019-03-06 15:27:01 -0700
commit4109e8c49cb256e3e3a1f691342b18612ecb16eb (patch)
tree1bab819df0f37dac93f098f2334917423f3bcb1d
parent22705b007f95068b8d82282902ed14a2c0bf7819 (diff)
downloadsr.ht-docs-4109e8c49cb256e3e3a1f691342b18612ecb16eb.tar.gz
Standardize layout/language of oauth scopes
-rw-r--r--meta.sr.ht/user-api.md68
-rw-r--r--paste.sr.ht/api.md12
2 files changed, 41 insertions, 39 deletions
diff --git a/meta.sr.ht/user-api.md b/meta.sr.ht/user-api.md
index 8e78b80..36ceac8 100644
--- a/meta.sr.ht/user-api.md
+++ b/meta.sr.ht/user-api.md
@@ -81,16 +81,16 @@ resource](../api-conventions.md#user-resource).
### GET /api/user/profile
-**OAuth scope**: `profile:read`
-
Returns the authenticated user's [user resource](#user-resource).
-### PUT /api/user/profile
+**OAuth scope**: `profile:read`
-**OAuth scope**: `profile:update`
+### PUT /api/user/profile
Updates the authenticated user's profile.
+**OAuth scope**: `profile:update`
+
**Request body**
```json
@@ -114,22 +114,22 @@ Updated [user resource](#user-resource).
### GET /api/user/audit-log
-**OAuth scope**: `audit-log:read`
-
List of [audit log entry resources](#audit-log-entry-resource).
-### GET /api/user/ssh-keys
+**OAuth scope**: `audit-log:read`
-**OAuth scope**: `keys:read`
+### GET /api/user/ssh-keys
List of [SSH key resources](#ssh-key-resource).
-### POST /api/user/ssh-keys
+**OAuth scope**: `keys:read`
-**OAuth scope**: `keys:write`
+### POST /api/user/ssh-keys
Creates a new [SSH key resource](#ssh-key-resource).
+**OAuth scope**: `keys:write`
+
**Request body**
```json
@@ -144,38 +144,38 @@ The new [SSH key resource](#ssh-key-resource).
### GET /api/user/ssh-keys/:id
-**OAuth scope**: `keys:read`
-
Retrieves an [SSH key resource](#ssh-key-resource).
-### PUT /api/user/ssh-keys/:id
+**OAuth scope**: `keys:read`
-**OAuth scope**: `keys:write`
+### PUT /api/user/ssh-keys/:id
Updates the "last_used" time of this SSH key resource.
+**OAuth scope**: `keys:write`
+
**Response**
The updated [SSH key resource](#ssh-key-resource).
### DELETE /api/user/ssh-keys/:id
-**OAuth scope**: `keys:write`
-
Deletes this SSH key resource.
-### GET /api/user/pgp-keys
+**OAuth scope**: `keys:write`
-**OAuth scope**: `keys:read`
+### GET /api/user/pgp-keys
List of [PGP key resources](#pgp-key-resource).
-### POST /api/user/pgp-keys
+**OAuth scope**: `keys:read`
-**OAuth scope**: `keys:write`
+### POST /api/user/pgp-keys
Creates a new [PGP key resource](#pgp-key-resource).
+**OAuth scope**: `keys:write`
+
**Request body**
```json
@@ -190,16 +190,16 @@ The new [PGP key resource](#pgp-key-resource).
### GET /api/user/pgp-keys/:id
-**OAuth scope**: `keys:read`
-
Retrieves a [PGP key resource](#pgp-key-resource).
-### DELETE /api/user/pgp-keys/:id
+**OAuth scope**: `keys:read`
-**OAuth scope**: `keys:write`
+### DELETE /api/user/pgp-keys/:id
Deletes this PGP key resource.
+**OAuth scope**: `keys:write`
+
## Webhooks
### /api/user/...
@@ -209,30 +209,30 @@ endpoints](../api-conventions.md#webhooks)
#### profile:update
-**OAuth scope**: `profile:read`
-
Issued when the user's profile (bio, email, etc) is updated.
+**OAuth scope**: `profile:read`
+
**Request body**
The updated [user resource](#user-resource).
#### ssh-key:add
-**OAuth scope**: `keys:read`
-
Issued when the user adds an SSH key to their account.
+**OAuth scope**: `keys:read`
+
**Request body**
The new [SSH key resource](#ssh-key-resource).
#### ssh-key:remove
-**OAuth scope**: `keys:read`
-
Issued when the user removes an SSH key from their account.
+**OAuth scope**: `keys:read`
+
**Request body**
```json
@@ -243,20 +243,20 @@ Issued when the user removes an SSH key from their account.
#### pgp-key:add
-**OAuth scope**: `keys:read`
-
Issued when the user adds a PGP key to their account.
+**OAuth scope**: `keys:read`
+
**Request body**
The new [PGP key resource](#pgp-key-resource).
#### pgp-key:remove
-**OAuth scope**: `keys:read`
-
Issued when the user removes a PGP key from their account.
+**OAuth scope**: `keys:read`
+
**Request body**
```json
diff --git a/paste.sr.ht/api.md b/paste.sr.ht/api.md
index 49fde09..e5766f9 100644
--- a/paste.sr.ht/api.md
+++ b/paste.sr.ht/api.md
@@ -75,16 +75,16 @@ The new [paste resource](#paste-resource).
### GET /api/pastes/:sha
-**OAuth scope**: `pastes:read`
-
Retrieves a [paste resource](#paste-resource).
-### GET /api/blobs/:sha
-
**OAuth scope**: `pastes:read`
+### GET /api/blobs/:sha
+
Retrieves a [blob resource](#blob-resource).
+**OAuth scope**: `pastes:read`
+
## Webhooks
### /api/pastes/...
@@ -94,7 +94,9 @@ endpoints](../api-conventions.md#webhooks)
#### paste:create
-Issued when a new paste is created. Requires `paste:read` OAuth scope.
+Issued when a new paste is created.
+
+**OAuth scope**: `paste:read`
**Request body**