From 0211348abc0146fb097db1c273c4ec291de29de0 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Tue, 29 Apr 2025 18:01:15 +0200 Subject: [PATCH 1/2] chore: fixed table formatting and added periods --- API/client-server/v1/friend-request.md | 22 +++++++++++----------- API/client-server/v1/stats.md | 18 +++++++++--------- API/client-server/v1/support.md | 26 +++++++++++++------------- API/client-server/versions.md | 14 +++++++------- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/API/client-server/v1/friend-request.md b/API/client-server/v1/friend-request.md index 7efb5ac..c791e40 100644 --- a/API/client-server/v1/friend-request.md +++ b/API/client-server/v1/friend-request.md @@ -8,11 +8,11 @@ Sends a friend request to the given user. Friend requests can be accepted by hav ## Request -| Name | Type | Description | -|--------------|--------|-----------------------------------------------------------------------------------------------| -| access_token | string | **Required**: The user's auth token | -| identifier | string | **Required**: The gorb ID of the user they want to friend | -| message | string | A message to send along with the friend request, for example to find to tell them who you are | +| Name | Type | Description | +| ------------ | ------ | ---------------------------------------------------------------------------------------------- | +| access_token | string | **Required**: The user's auth token. | +| identifier | string | **Required**: The gorb ID of the user they want to friend. | +| message | string | A message to send along with the friend request, for example to find to tell them who you are. | ```json { @@ -26,9 +26,9 @@ Sends a friend request to the given user. Friend requests can be accepted by hav ## Responses -| Status | Description | -|--------|------------------------------------------------------------------------------| -| 200 | Friend request sucessfully sent | -| 400 | The post request included poorly formated data | -| 401 | The recipient is not accepting friend requests from the sender at the moment | -| 403 | Invalid access token | \ No newline at end of file +| Status | Description | +| ------ | ----------------------------------------------------------------------------- | +| 200 | Friend request sucessfully sent. | +| 400 | The post request included poorly formated data. | +| 401 | The recipient is not accepting friend requests from the sender at the moment. | +| 403 | Invalid access token. | \ No newline at end of file diff --git a/API/client-server/v1/stats.md b/API/client-server/v1/stats.md index 1976bc0..dbd9ad1 100644 --- a/API/client-server/v1/stats.md +++ b/API/client-server/v1/stats.md @@ -10,18 +10,18 @@ No request parameters or request body. ## Responses -| Status | Description | -|--------|---------------------------------| -| 200 | The current stats of the server | +| Status | Description | +| ------ | -------------------------------- | +| 200 | The current stats of the server. | ### 200 response -| Name | Type | Description | -|--------------|--------|--------------------------------------------------------------------------------------------| -| accounts | int | The number of signed up accounts | -| uptime | int | How many seconds the server has been running | -| version | string | The current server version | -| build_number | string | The hash of the last commit in the git repo? (maybe we want to define this some other way) | +| Name | Type | Description | +| ------------ | ------ | ------------------------------------------------------------------------------------------- | +| accounts | int | The number of signed up accounts. | +| uptime | int | How many seconds the server has been running. | +| version | string | The current server version. | +| build_number | string | The hash of the last commit in the git repo? (maybe we want to define this some other way). | ```json { diff --git a/API/client-server/v1/support.md b/API/client-server/v1/support.md index c185481..edc9848 100644 --- a/API/client-server/v1/support.md +++ b/API/client-server/v1/support.md @@ -10,24 +10,24 @@ No request parameters or request body. ## Responses -| Status | Description | -|--------|------------------------------------------------| -| 200 | Support information for the server | -| 404 | No contact information has been made available | +| Status | Description | +| ------ | ----------------------------------------------- | +| 200 | Support information for the server. | +| 404 | No contact information has been made available. | ### 200 response -| Name | Type | Description | -|--------------|---------------|------------------------------------------| -| contacts | list[Contact] | A list of server administators | -| support_page | string | The URL of a webpage that may help users | +| Name | Type | Description | +| ------------ | ------------- | ----------------------------------------- | +| contacts | list[Contact] | A list of server administators. | +| support_page | string | The URL of a webpage that may help users. | #### Contact -| Name | Type | Description | -|---------------|--------|------------------------------------------------------------| -| email_address | string | Email address for the administrator | -| gorb_id | string | The gorb ID for the administrator | -| role | string | **Required**: A simple description of this responsible for | +| Name | Type | Description | +| ------------- | ------ | ----------------------------------------------------------- | +| email_address | string | Email address for the administrator. | +| gorb_id | string | The gorb ID for the administrator. | +| role | string | **Required**: A simple description of this responsible for. | ```json { diff --git a/API/client-server/versions.md b/API/client-server/versions.md index 0d8ea42..3f056c9 100644 --- a/API/client-server/versions.md +++ b/API/client-server/versions.md @@ -10,16 +10,16 @@ No request parameters or request body. ## Responses -| Status | Description | -|--------|--------------------------------------| -| 200 | The versions supported by the server | +| Status | Description | +| ------ | ------------------------------------- | +| 200 | The versions supported by the server. | ### 200 response -| Name | Type | Description | -|-------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------| -| unstable_features | dict[string:bool] | Unstable features that are supported by the server. Features not listed here indicate that a feature isn't supported. | -|versions|list[string]|**Required**: The supported protocol versions +| Name | Type | Description | +| -------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- | +| unstable_features | dict[string:bool] | Unstable features that are supported by the server. Features not listed here indicate that a feature isn't supported. | +| versions | list[string] | **Required**: The supported protocol versions. | ```json { From 6e4423e08babea500c42ad25e5b42f794d26e874 Mon Sep 17 00:00:00 2001 From: SauceyRed Date: Tue, 29 Apr 2025 18:05:11 +0200 Subject: [PATCH 2/2] chore: fix formatting, add periods, and change example tokens to opaque ones (hex) --- API/client-server/v1/login.md | 28 +++++++++++++------------- API/client-server/v1/register.md | 34 ++++++++++++++++---------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/API/client-server/v1/login.md b/API/client-server/v1/login.md index 9758fe5..c936ef2 100644 --- a/API/client-server/v1/login.md +++ b/API/client-server/v1/login.md @@ -10,10 +10,10 @@ Authenticates the user, and issues an access token for future requests. | Name | Type | Description | | ----------- | ------ | -------------------------------------------------------------------------------------------------------------- | -| identifier | 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 | -| 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 | +| identifier | 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. | +| 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. | ```json { @@ -27,11 +27,11 @@ Authenticates the user, and issues an access token for future requests. ## Responses -| Status | Description | -| ------ | ---------------------------------------------- | -| 200 | Authentication successful | -| 400 | The post request included poorly formated data | -| 403 | Part of the cridentials are invalid. | +| Status | Description | +| ------ | ---------------------------------------------- | +| 200 | Authentication successful. | +| 400 | The post request included poorly formated data. | +| 403 | Part of the cridentials are invalid. | --- @@ -39,16 +39,16 @@ Authenticates the user, and issues an access token for future requests. | Name | Type | Description | | ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -| 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 | -| expires_in | int | How many seconds until the token expires and is invalidated | +| 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. | +| 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. | ```json { - "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NTk2MTg0MH0.MZsOfeOm98K2sgtJ3hIDy0iyX27tDJRgW5iSayBJIDM", + "access_token": "35e404d160b0eac766cb85cf513670baa627d1e918c4813c3f099e31de300b63", "user_id": "@radial_4740:gorb.app", "expires_in": 86400, - "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NjQ4MDI0MH0.OvUDelrhELNBhizvAj7wm13YpDLYluI4sPeBmT5sPUg" + "refresh_token": "d9ce91b7b643d5580ea605ad09ba1e13aef704c412194c00c592b96a62049587" } ``` diff --git a/API/client-server/v1/register.md b/API/client-server/v1/register.md index 43cfe85..94afb85 100644 --- a/API/client-server/v1/register.md +++ b/API/client-server/v1/register.md @@ -10,10 +10,10 @@ Registers the user, and issues an access token for future requests. | Name | Type | Description | | ----------- | ------ | -------------------------------------------------------------------------------------------------------------- | -| identifier | string | **Required** User's desired ID | -| email | string | **Required** User's email | -| 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 | +| identifier | string | **Required** User's desired ID. | +| email | string | **Required** User's email. | +| 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. | ```json { @@ -28,29 +28,29 @@ Registers the user, and issues an access token for future requests. ## Responses -| Status | Description | -| ------ | ----------------------------------------------------------------------------------------------------------------------------- | -| 200 | Registration successful | -| 400 | The post request included poorly formated data | -| 403 | Signups are disabled, gorb ID not available, email already in use, or password doesn't meet the minimum security requirements | +| Status | Description | +| ------ | ------------------------------------------------------------------------------------------------------------------------------ | +| 200 | Registration successful. | +| 400 | The post request included poorly formated data. | +| 403 | Signups are disabled, gorb ID not available, email already in use, or password doesn't meet the minimum security requirements. | --- ### 200 -| Name | Type | Description | -| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -| 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 | -| 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. | +| Name | Type | Description | +| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------- | +| 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. | +| 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. | ```json { - "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NTk2MTg0MH0.MZsOfeOm98K2sgtJ3hIDy0iyX27tDJRgW5iSayBJIDM", + "access_token": "13aa5fe2ae5874fb9616e68c25632a146552584ac238a3e4ede08174fbfc4f45", "user_id": "@radial_4740:gorb.app", "expires_in": 86400, - "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJAcmFkaWFsXzQ3NDA6Z29yYi5hcHAiLCJpZGVudGlmaWVyIjoicmFkaWFsXzQ3NDAiLCJpYXQiOjE3NDM4ODgyNDAsImV4cCI6MTc0NjQ4MDI0MH0.OvUDelrhELNBhizvAj7wm13YpDLYluI4sPeBmT5sPUg" + "refresh_token": "8556a85b8912a78572cd67b21350e188039f656a0781dab20fab7b72a11d2a93" } ```