Skip to content

Commit 3910831

Browse files
ui almost done
1 parent 0c9104d commit 3910831

77 files changed

Lines changed: 4382 additions & 517 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
target/
2+
node_modules/
3+
.git/
4+
.env
5+
.venv
6+
__pycache__/
7+
pangolin_ui/node_modules
8+
pangolin_ui/.svelte-kit
9+
*.log
10+
.DS_Store

admin_token.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Missing or invalid authorization header

docs/api/authentication.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,34 @@ Pangolin implements a secure authentication system based on JSON Web Tokens (JWT
44

55
## Authentication Flow
66

7-
1. **Login**: Users authenticate against the `/api/v1/login` endpoint using their credentials.
7+
1. **Login**: Users authenticate against the `/api/v1/users/login` endpoint using their credentials.
8+
- **Root Login**: Omit `tenant-id` or set to `null`
9+
- **Tenant-Scoped Login**: Include `tenant-id` with tenant UUID
810
2. **Token Issuance**: Upon successful authentication, the server returns a signed JWT.
911
3. **Authenticated Requests**: Clients must include this JWT in the `Authorization` header of subsequent requests:
1012
```
1113
Authorization: Bearer <token>
1214
```
1315
16+
### Login Examples
17+
18+
**Root Login**:
19+
```bash
20+
curl -X POST http://localhost:8080/api/v1/users/login \
21+
-H "Content-Type: application/json" \
22+
-d '{"username":"admin","password":"password","tenant-id":null}'
23+
```
24+
25+
**Tenant-Scoped Login** (for users with duplicate usernames across tenants):
26+
```bash
27+
curl -X POST http://localhost:8080/api/v1/users/login \
28+
-H "Content-Type: application/json" \
29+
-d '{"username":"user","password":"pass123","tenant-id":"<tenant-uuid>"}'
30+
```
31+
32+
> [!IMPORTANT]
33+
> Use `tenant-id` (kebab-case), not `tenant_id` (underscore).
34+
1435
## Root User
1536

1637
A "Root User" is configured via environment variables to bootstrap the system. This user has full administrative privileges.

0 commit comments

Comments
 (0)