From 6c7d97b2303963cdb8be1283354dc3b075b31171 Mon Sep 17 00:00:00 2001 From: inexcode Date: Wed, 2 Feb 2022 23:39:22 +0300 Subject: [PATCH] Other updates --- src/rest-api/api.md | 40 ++++++++++++++++----------------- src/rest-api/auth.md | 8 +++++++ src/rest-api/vulnerabilities.md | 2 +- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/rest-api/api.md b/src/rest-api/api.md index f3d2a51..d6162d9 100644 --- a/src/rest-api/api.md +++ b/src/rest-api/api.md @@ -66,7 +66,7 @@ API available as Swagger documentation, markdown version is below. -### o_cserv +### ocserv | Method | URI | Name | Summary | |---------|---------|--------|---------| @@ -163,9 +163,9 @@ DELETE /auth/tokens #### Parameters -| Name | Source | Type | Go type | Separator | Required | Default | Description | -|------|--------|------|---------|-----------| :------: |---------|-------------| -| token | `body` | [DeleteAuthTokensBody](#delete-auth-tokens-body) | `DeleteAuthTokensBody` | | ✓ | | Token's name to delete | +| Name | Source | Type | Required | Default | Description | +|------|--------|------| :------: |---------|-------------| +| token | `body` | [DeleteAuthTokensBody](#delete-auth-tokens-body) | ✓ | | Token's name to delete | #### All responses | Code | Status | Description | @@ -180,9 +180,9 @@ DELETE /auth/tokens **Properties** -| Name | Type | Go type | Required | Default | Description | Example | -|------|------|---------|:--------:| ------- |-------------|---------| -| token | string| `string` | ✓ | | Token name to delete | | +| Name | Type | Required | Default | Description | Example | +|------|------|:--------:| ------- |-------------|---------| +| token | string| ✓ | | Token name to delete | | @@ -197,10 +197,10 @@ DELETE /services/ssh/keys/{username} #### Parameters -| Name | Source | Type | Go type | Separator | Required | Default | Description | -|------|--------|------|---------|-----------| :------: |---------|-------------| -| username | `path` | string | `string` | | ✓ | | User to delete keys for | -| public_key | `body` | [DeleteServicesSSHKeysUsernameBody](#delete-services-ssh-keys-username-body) | `DeleteServicesSSHKeysUsernameBody` | | ✓ | | Key to delete | +| Name | Source | Type | Required | Default | Description | +|------|--------|------| :------: |---------|-------------| +| username | `path` | string | ✓ | | User to delete keys for | +| public_key | `body` | [DeleteServicesSSHKeysUsernameBody](#delete-services-ssh-keys-username-body) | ✓ | | Key to delete | #### All responses | Code | Status | Description | @@ -215,9 +215,9 @@ DELETE /services/ssh/keys/{username} **Properties** -| Name | Type | Go type | Required | Default | Description | Example | -|------|------|---------|:--------:| ------- |-------------|---------| -| public_key | string| `string` | ✓ | | | | +| Name | Type | Required | Default | Description | Example | +|------|------|:--------:| ------- |-------------|---------| +| public_key | string| ✓ | | | | @@ -232,9 +232,9 @@ DELETE /users/{username} #### Parameters -| Name | Source | Type | Go type | Separator | Required | Default | Description | -|------|--------|------|---------|-----------| :------: |---------|-------------| -| username | `path` | string | `string` | | ✓ | | User to delete | +| Name | Source | Type | Required | Default | Description | +|------|--------|------| :------: |---------|-------------| +| username | `path` | string | ✓ | | User to delete | #### All responses | Code | Status | Description | @@ -261,9 +261,9 @@ GET /api/version Status: OK ###### Schema -| Name | Type | Go type | Required | Default | Description | Example | -|------|------|---------|:--------:| ------- |-------------|---------| -| version | string| `string` | | | API version | | +| Name | Type | Required | Default | Description | Example | +|------|------|:--------:| ------- |-------------|---------| +| version | string| | | API version | | ##### 401 - Unauthorized Status: Unauthorized diff --git a/src/rest-api/auth.md b/src/rest-api/auth.md index 17257a2..192ffc6 100644 --- a/src/rest-api/auth.md +++ b/src/rest-api/auth.md @@ -1 +1,9 @@ # Authorization +## Before 1.2.0 +At that time, only one access token could be used. It is declared during nixos-infect stage and generated by the mobile app. +## After 1.2.0 +New auth system was introduced in 1.2.0. See [[migrations#Create tokens JSON file]] for details on migration to the new system. +### Tokens storage +### Token control +### New device token creation +### Recovery token diff --git a/src/rest-api/vulnerabilities.md b/src/rest-api/vulnerabilities.md index 265ebc3..3aa8d61 100644 --- a/src/rest-api/vulnerabilities.md +++ b/src/rest-api/vulnerabilities.md @@ -1,5 +1,5 @@ # SPCVE-0001 -**API versions affected**: [[changelog#Input sanitization added swagger 17 Nov 2021 https git selfprivacy org SelfPrivacy selfprivacy-rest-api pulls 5|All pre-1.1.0 releases]] +**API versions affected**: [[changelog#Input sanitization added swagger https git selfprivacy org SelfPrivacy selfprivacy-rest-api pulls 5|All pre-1.1.0 releases]] **SelfPrivacy app versions affected:** ≤0.2.4; fixed in 0.3.0