Skip to content

Commit

Permalink
fix: adding fields description and error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed Jul 9, 2024
1 parent c5284e4 commit 982c7ac
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions docs/specs/servers/blockchain/blockchain-permissions-api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Blockchain API Sessions and Permissions

This API is **unstable**, not yet production ready and can be changed at any time.

## Sessions permissions storage

### Get permissions list for account
Expand Down Expand Up @@ -77,15 +79,18 @@ The POST request body should be in JSON format and following schema:

#### Success response body:

Response will contain a new generated ECDSA key and PCI of the new permission.
Response will contain a new generated key and PCI of the new permission.

```typescript
{
key: string,
pci: string
pci: string,
key: string
}
```

* `pci` - New unique permission controller identifier.
* `key` - Generated signing (private) ECDSA P256 key in DER, SEC1 format encoded by Base64.

#### Response error codes:

* `400 Bad request` - Wrong format in request.
Expand All @@ -110,7 +115,7 @@ The POST request body should be in JSON format and following schema:
context: {
{
signer: {
type: string,
permissionType: string,
ids: [string]
},
expiry: number,
Expand All @@ -126,16 +131,17 @@ The POST request body should be in JSON format and following schema:
```

* `pci` - PCI to revoke.
* `signature` - Signature signed by the key provided during the permission creation.
* `signature` - Signature of canonicalized JSON `context` object signed by the key provided during the permission creation. The signature must be provided as DER, SEC1 and encoded in Base64 format.
* `context` - Permissions context object to update.

#### Success response body:

* `202 Accepted` - Successfully updated.
* `200 Ok` - Successfully updated.

#### Response error codes:

* `400 Bad request` - Wrong format in request.
* `401 Unauthorized` - Wrong signature.

## Revoke permission

Expand All @@ -158,12 +164,13 @@ The POST request body should be in JSON format and following schema:
```

* `pci` - PCI to revoke.
* `signature` - Signature signed by the key provided during the permission creation.
* `signature` - Signature of signed `pci` field by the key provided during the permission creation. The signature must be provided as DER, SEC1 and encoded in Base64 format.

#### Success response body:

* `202 Accepted` - Successfully revoked.
* `200 Ok` - Successfully revoked.

#### Response error codes:

* `400 Bad request` - Wrong format in request.
* `401 Unauthorized` - Wrong signature.

0 comments on commit 982c7ac

Please sign in to comment.