diff options
| author | rubenwardy <rw@rubenwardy.com> | 2019-11-22 14:33:22 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2019-11-27 01:06:58 +0000 |
| commit | 4ce388c8aa5d5502408609983535a9812d41d6d1 (patch) | |
| tree | 5ad9123949ca2068dfe975284d0f1b3acdf5b437 /app/flatpages | |
| parent | cb5451fe5d49e0eda379e3cd636c54e8ea1a3f8e (diff) | |
| download | cheatdb-4ce388c8aa5d5502408609983535a9812d41d6d1.tar.xz | |
Add API Token creation
Diffstat (limited to 'app/flatpages')
| -rw-r--r-- | app/flatpages/help.md | 1 | ||||
| -rw-r--r-- | app/flatpages/help/api.md | 51 | ||||
| -rw-r--r-- | app/flatpages/help/ranks_permissions.md | 15 |
3 files changed, 67 insertions, 0 deletions
diff --git a/app/flatpages/help.md b/app/flatpages/help.md index 553111d..0087f26 100644 --- a/app/flatpages/help.md +++ b/app/flatpages/help.md @@ -4,3 +4,4 @@ title: Help * [Ranks and Permissions](ranks_permissions) * [Content Ratings and Flags](content_flags) * [Reporting Content](reporting) +* [API](api) diff --git a/app/flatpages/help/api.md b/app/flatpages/help/api.md new file mode 100644 index 0000000..95e23d2 --- /dev/null +++ b/app/flatpages/help/api.md @@ -0,0 +1,51 @@ +title: API + +## Authentication + +Not all endpoints require authentication. +Authentication is done using Bearer tokens: + + Authorization: Bearer YOURTOKEN + +You can use the `/api/whoami` to check authentication. + +## Endpoints + +### Misc + +* GET `/api/whoami/` - Json dictionary with the following keys: + * `is_authenticated` - True on successful API authentication + * `username` - Username of the user authenticated as, null otherwise. + * 403 will be thrown on unsupported authentication type, invalid access token, or other errors. + +### Packages + +* GET `/api/packages/` - See [Package Queries](#package-queries) +* GET `/api/packages/<username>/<name>/` + +### Topics + +* GET `/api/topics/` - Supports [Package Queries](#package-queries), and the following two options: + * `show_added` - Show topics which exist as packages, default true. + * `show_discarded` - Show topics which have been marked as outdated, default false. + +### Minetest + +* GET `/api/minetest_versions/` + + +## Package Queries + +Example: + + /api/packages/?type=mod&type=game&q=mobs+fun&hide=nonfree&hide=gore + +Supported query parameters: + +* `type` - Package types (`mod`, `game`, `txp`). +* `q` - Query string +* `random` - When present, enable random ordering and ignore `sort`. +* `hide` - Hide content based on [Content Flags](content_flags). +* `sort` - Sort by (`name`, `views`, `date`, `score`). +* `order` - Sort ascending (`Asc`) or descending (`desc`). +* `protocol_version` - Only show packages supported by this Minetest protocol version. diff --git a/app/flatpages/help/ranks_permissions.md b/app/flatpages/help/ranks_permissions.md index 9252930..1740c55 100644 --- a/app/flatpages/help/ranks_permissions.md +++ b/app/flatpages/help/ranks_permissions.md @@ -220,6 +220,21 @@ title: Ranks and Permissions <th>✓</th> </tr> <tr> + <td>Create Token</td> + <th></th> <!-- new --> + <th></th> + <th>✓</th> <!-- member --> + <th></th> + <th>✓</th> <!-- trusted member --> + <th></th> + <th>✓</th> <!-- editor --> + <th></th> + <th>✓</th> <!-- moderator --> + <th>✓<sup>2</sup></th> + <th>✓</th> <!-- admin --> + <th>✓</th> + </tr> + <tr> <td>Set Rank</td> <th></th> <!-- new --> <th></th> |
