Skip to content

Commit 3c8807f

Browse files
hwcopelandclaude
andcommitted
feat(auth): add static API token support for simple user onboarding
Replace the OAuth2 client_credentials flow with direct API tokens stored in MySQL. Admins generate tokens via POST /api/v1/tokens (cluster-internal only) and hand them to users. The auth middleware checks static tokens before falling back to JWT/OIDC validation. - Add api_tokens table, token CRUD endpoints (create/list/revoke) - Modify auth middleware to check static tokens first - Update quickstart docs to reflect the simpler token flow - Remove stale onboarding.md (auto-generated, heavily outdated) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 357dd58 commit 3c8807f

6 files changed

Lines changed: 203 additions & 376 deletions

File tree

rke2/chem/compute-infrastructure/docs/onboarding.md

Lines changed: 0 additions & 338 deletions
This file was deleted.

rke2/chem/compute-infrastructure/docs/quickstart-qe.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,16 @@ https://khemeia.hwcopeland.net/api/v1/qe/
88

99
## Authentication
1010

11-
All external API requests require a JWT token from Authentik. Internal cluster requests (pods, E2E tests) are exempt.
11+
All external API requests require an API token. Internal cluster requests (pods, E2E tests) are exempt.
1212

13-
### Get a Token
13+
### Set your token
14+
15+
Ask Hampton for an API token, then export it:
1416

1517
```bash
16-
# Client credentials grant (no browser needed)
17-
TOKEN=$(curl -sf -X POST https://auth.hwcopeland.net/application/o/token/ \
18-
-d "grant_type=client_credentials" \
19-
-d "client_id=docking-controller" \
20-
-d "client_secret=<your-client-secret>" \
21-
-d "scope=openid" | jq -r '.access_token')
22-
23-
# Token is valid for 1 hour
24-
echo $TOKEN
18+
export TOKEN="paste-your-token-here"
2519
```
2620

27-
Your client secret is in Bitwarden under `docking-controller-oidc` in the `k8s-secrets` folder.
28-
29-
### Use the Token
30-
3121
Add it to every request:
3222

3323
```bash
@@ -161,4 +151,4 @@ The `executable` field accepts any QE binary:
161151

162152
## Job Ownership
163153

164-
All jobs are tagged with your Authentik username (`submitted_by` field). You can see this in the job details.
154+
All jobs are tagged with your username (`submitted_by` field). You can see this in the job details.

0 commit comments

Comments
 (0)