Creating documentation

This commit is contained in:
Zeeshaun Masood
2026-01-20 14:06:31 -06:00
parent faa9a5e9d5
commit d003f67273
9 changed files with 155 additions and 9 deletions
+49
View File
@@ -0,0 +1,49 @@
# AuthApi document shapes
This service expects JSON request bodies for its auth endpoints and stores user
documents in MongoDB.
Inbound JSON documents
- RegisterRequest (`POST /api/auth/register`)
```json
{
"username": "string",
"password": "string",
"email": "string (optional)"
}
```
- LoginRequest (`POST /api/auth/login`)
```json
{
"username": "string",
"password": "string"
}
```
- RefreshRequest (`POST /api/auth/refresh`)
```json
{
"username": "string",
"refreshToken": "string"
}
```
- ChangeRoleRequest (`POST /api/auth/role`)
```json
{
"username": "string",
"newRole": "USER | SUPER"
}
```
Stored documents (MongoDB)
- User
```json
{
"id": "string (ObjectId)",
"username": "string",
"passwordHash": "string",
"role": "USER | SUPER",
"email": "string (optional)",
"refreshToken": "string (optional)",
"refreshTokenExpiry": "string (optional, ISO-8601 datetime)"
}
```
+12
View File
@@ -0,0 +1,12 @@
# AuthApi
## Document shapes
See `DOCUMENTS.md` for request payloads and stored document shapes.
## Endpoints
- `POST /api/auth/register` Register a new user.
- `POST /api/auth/login` Issue access and refresh tokens.
- `POST /api/auth/refresh` Refresh an access token.
- `POST /api/auth/logout` Revoke the current access token.
- `POST /api/auth/role` Update a user's role (SUPER only).
- `GET /api/auth/users` List users (SUPER only).