rock
8177f8b92f
feat(proxy): add /auth/exchange token exchange endpoint
Closes homelab#10 (P3.5)
## Endpoint
`POST /auth/exchange` — RFC 8693-inspired token exchange.
## Flow
1. Validate `subject_token` (user JWT) via gateway's JWKS validator
2. Authenticate service via `client_credentials` against Authentik
3. Verify requested `scope` is subset of service's roles (deny escalation)
4. Return service token + subject identity metadata
## Request
```json
{"subject_token": "<user JWT>", "client_id": "portfolio-agent",
"client_secret": "<secret>", "scope": "memory:read", "resource": "poimen-memory"}
```
## Response
```json
{"access_token": "<service JWT>", "subject": "user-hash",
"acting_party": "portfolio-agent", "scope": "memory:read"}
```
2026-09-09 00:31:10 +00:00
..
2026-09-06 13:45:04 +00:00
2026-09-08 23:43:29 +00:00
2026-09-08 23:08:39 +00:00
2026-08-19 20:54:34 -07:00
2026-08-26 13:47:36 -07:00
2026-08-26 13:47:36 -07:00
2026-09-09 00:31:10 +00:00
2026-08-26 13:47:36 -07:00
2026-08-26 14:05:43 -07:00
2026-09-08 23:20:31 +00:00
2026-08-30 09:45:20 -07:00
2026-08-21 20:46:45 -07:00
2026-08-31 15:01:56 -07:00
2026-08-21 16:49:44 -07:00