Added to docs

This commit is contained in:
Caleb Gardner
2024-05-17 22:07:40 -05:00
parent abfc67d10f
commit b6bc9240d9
+32 -2
View File
@@ -2,6 +2,36 @@
This is a purposefully "simple" application backend made specifically for _my_ apps. It's purpose is to collect minimal (only what's absolutely necessary) amounts of data while still fulfilling all my needs. I've found that other, off the shelf options such as Firebase are a bit heavy on the data collection. Plus I like to make things :P. This is a purposefully "simple" application backend made specifically for _my_ apps. It's purpose is to collect minimal (only what's absolutely necessary) amounts of data while still fulfilling all my needs. I've found that other, off the shelf options such as Firebase are a bit heavy on the data collection. Plus I like to make things :P.
## DB Structure
### API Key
```json
{
appName: "app name",
key: "API Key",
death: -1, // unix timestamp when the key is no longer valid. -1 means there is not expected expiration (that can change in the future)
perm: {
user: true, // create and login users
log: true, // log users
crash: true, // crash reports
// further permissions can be added as needed
}
}
```
### User
```json
{
id: "UUID",
username: "username",
password: "hashed password",
salt: "password salt",
passwordChange: 0, // unix timestamp of last password change
}
```
## Standard Header ## Standard Header
Any request might or might not need these values. These values can be authenticated via the `TODO` function. Any request might or might not need these values. These values can be authenticated via the `TODO` function.
@@ -28,7 +58,7 @@ If an error status code is returned then the body will be as follows.
> TODO: Add the ability to create users and log-in through third-parties (such as Google). > TODO: Add the ability to create users and log-in through third-parties (such as Google).
All requsests pertaining to users requires the `X-API-Key` header. All requsests pertaining to users requires the `X-API-Key` header and the key must have the `users` permission.
### Create User ### Create User
@@ -81,6 +111,6 @@ Return:
```json ```json
{ {
token: "JWT Token", token: "JWT Token",
timeout: 0, timeout: 0, // login attempt timeout (in seconds). If non-zero, token will be empty.
} }
``` ```