fix: ensure consitant naming of keys

This commit is contained in:
JustTemmie 2025-04-29 21:39:17 +02:00
parent 25b75bee87
commit 0f993c39ec
4 changed files with 21 additions and 19 deletions

View file

@ -9,15 +9,17 @@ Sends a friend request to the given user. Friend requests can be accepted by hav
## Request ## Request
| Name | Type | Description | | Name | Type | Description |
| ------------ | ------ | ---------------------------------------------------------------------------------------------- | |--------------|--------|------------------------------------------------------------------------------------------------|
| access_token | string | **Required**: The user's auth token. | | access_token | string | **Required**: The user's auth token. |
| identifier | string | **Required**: The gorb ID of the user they want to friend. | | uuid | string | **Required**: The UUID of the user they want to befriend. |
| server | string | The instance that user is on, can be left out if it's a local friend request. |
| message | string | A message to send along with the friend request, for example to find to tell them who you are. | | message | string | A message to send along with the friend request, for example to find to tell them who you are. |
```json ```json
{ {
"access_token": "gwLhWXD9wrqL3DwxXZ0VHUeOjr8am1yO", "access_token": "gwLhWXD9wrqL3DwxXZ0VHUeOjr8am1yO",
"identifier": "@radial_4740@gorb.app", "uuid": "dcb445f1-16e7-4cd9-ac19-af07acaeb865",
"server": "gorb.app",
"message": "Heyo, Kira here" "message": "Heyo, Kira here"
} }
``` ```
@ -27,7 +29,7 @@ Sends a friend request to the given user. Friend requests can be accepted by hav
## Responses ## Responses
| Status | Description | | Status | Description |
| ------ | ----------------------------------------------------------------------------- | |--------|-------------------------------------------------------------------------------|
| 200 | Friend request sucessfully sent. | | 200 | Friend request sucessfully sent. |
| 400 | The post request included poorly formated data. | | 400 | The post request included poorly formated data. |
| 401 | The recipient is not accepting friend requests from the sender at the moment. | | 401 | The recipient is not accepting friend requests from the sender at the moment. |

View file

@ -10,14 +10,14 @@ Authenticates the user, and issues an access token for future requests.
| Name | Type | Description | | Name | Type | Description |
|-------------|--------|-----------------------------------------------------------------------------------------------------------------| |-------------|--------|-----------------------------------------------------------------------------------------------------------------|
| identifier | string | User's gorb ID. One of identifier and email **must** be implemented. | | user_id | string | User's gorb ID. One of identifier and email **must** be implemented. |
| email | string | User's email. One of identifier and email **must** be implemented. | | email | string | User's email. One of identifier and email **must** be implemented. |
| password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client). | | password | string | **Required**: The user's password (we need to figure out how exactly we're hashing + salting it on the client). |
| device_name | string | Name to help the user identify the device in their session list. | | device_name | string | Name to help the user identify the device in their session list. |
```json ```json
{ {
"identifier": "radial_4740", "user_id": "radial_4740",
"password": "9r89mhs4czu4", "password": "9r89mhs4czu4",
"device_name": "Laptop" "device_name": "Laptop"
} }
@ -40,15 +40,15 @@ Authenticates the user, and issues an access token for future requests.
| Name | Type | Description | | Name | Type | Description |
|---------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------| |---------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------|
| access_token | string | **Required**: The access token that will be used for further authentication. | | access_token | string | **Required**: The access token that will be used for further authentication. |
| user_id | string | **Required**: The full gorb ID for the account. | | user_id | string | **Required**: The account's local gorb ID. |
| uuid | string | **Required**: The account's UUID | | uuid | string | **Required**: The account's UUID. |
| expires_in | int | How many seconds until the token expires and is invalidated. | | expires_in | int | How many seconds until the token expires and is invalidated. |
| refresh_token | string | The refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. | | refresh_token | string | The refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. |
```json ```json
{ {
"access_token": "35e404d160b0eac766cb85cf513670baa627d1e918c4813c3f099e31de300b63", "access_token": "35e404d160b0eac766cb85cf513670baa627d1e918c4813c3f099e31de300b63",
"user_id": "@radial_4740@gorb.app", "user_id": "radial_4740",
"uuid": "dcb445f1-16e7-4cd9-ac19-af07acaeb865", "uuid": "dcb445f1-16e7-4cd9-ac19-af07acaeb865",
"expires_in": 86400, "expires_in": 86400,
"refresh_token": "d9ce91b7b643d5580ea605ad09ba1e13aef704c412194c00c592b96a62049587" "refresh_token": "d9ce91b7b643d5580ea605ad09ba1e13aef704c412194c00c592b96a62049587"

View file

@ -41,15 +41,15 @@ Registers the user, and issues an access token for future requests.
| Name | Type | Description | | Name | Type | Description |
|---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------| |---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| access_token | string | **Required**: The JWT access token that will be used for further authentication. | | access_token | string | **Required**: The JWT access token that will be used for further authentication. |
| user_id | string | **Required**: The full gorb ID for the account. | | user_id | string | **Required**: The account's local gorb ID. |
| uuid | string | **Required**: The account's UUID | | uuid | string | **Required**: The account's UUID. |
| expires_in | int | How many seconds until the token expires and is invalidated. | | expires_in | int | How many seconds until the token expires and is invalidated. |
| refresh_token | string | The JWT refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. | | refresh_token | string | The JWT refresh token that will be used to refresh the access token. Required for avoiding users having to log in after access token expiration. |
```json ```json
{ {
"access_token": "13aa5fe2ae5874fb9616e68c25632a146552584ac238a3e4ede08174fbfc4f45", "access_token": "13aa5fe2ae5874fb9616e68c25632a146552584ac238a3e4ede08174fbfc4f45",
"user_id": "@radial_4740@gorb.app", "user_id": "radial_4740",
"uuid": "dcb445f1-16e7-4cd9-ac19-af07acaeb865", "uuid": "dcb445f1-16e7-4cd9-ac19-af07acaeb865",
"expires_in": 86400, "expires_in": 86400,
"refresh_token": "8556a85b8912a78572cd67b21350e188039f656a0781dab20fab7b72a11d2a93" "refresh_token": "8556a85b8912a78572cd67b21350e188039f656a0781dab20fab7b72a11d2a93"

View file

@ -11,34 +11,34 @@ No request parameters or request body.
## Responses ## Responses
| Status | Description | | Status | Description |
| ------ | ----------------------------------------------- | |--------|-------------------------------------------------|
| 200 | Support information for the server. | | 200 | Support information for the server. |
| 404 | No contact information has been made available. | | 404 | No contact information has been made available. |
### 200 response ### 200 response
| Name | Type | Description | | Name | Type | Description |
| ------------ | ------------- | ----------------------------------------- | |--------------|---------------|-------------------------------------------|
| contacts | list[Contact] | A list of server administators. | | contacts | list[Contact] | A list of server administators. |
| support_page | string | The URL of a webpage that may help users. | | support_page | string | The URL of a webpage that may help users. |
#### Contact #### Contact
| Name | Type | Description | | Name | Type | Description |
| ------------- | ------ | ----------------------------------------------------------- | |---------------|--------|-------------------------------------------------------------|
| email_address | string | Email address for the administrator. | | email_address | string | Email address for the administrator. |
| gorb_id | string | The gorb ID for the administrator. | | user_id | string | The local user ID for the administrator in question. |
| role | string | **Required**: A simple description of this responsible for. | | role | string | **Required**: A simple description of this responsible for. |
```json ```json
{ {
"contacts": [ "contacts": [
{ {
"email_address": "admin@gorbatron.org", "email_address": "admin@gorb.app",
"role": "Main Administrator" "role": "Main Administrator"
}, },
{ {
"email_address": "moderator@gorbatron.org", "email_address": "moderator@gorb.app",
"gorb_id": "@moderator@gorbatron.org", "user_id": "moderator",
"role": "Content Moderator" "role": "Content Moderator"
} }
], ],