POST /auth/token: exchanges username+password for JWT via upstream
identity provider (grant_type=password).
POST /auth/refresh: exchanges refresh_token for new JWT.
Both proxy to Authentik token endpoint using config from P3.7.
Upstream responses forwarded verbatim. No credentials logged or
leaked in responses. authClient interface extracted for testability.
15 tests covering: success, custom scope, missing fields, invalid
JSON, wrong method, not configured, upstream error, credential
rejection, token expiry, no credential leak.
Closes homelab#6
Closes homelab#8
Co-authored-by: poimen <[email protected]>
rock
merged commit a51c14426f into main2026-09-09 00:00:16 +00:00
rock
deleted branch feat/p3.1-auth-token2026-09-09 00:00:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes homelab#6 (P3.1) and homelab#8 (P3.3)
Endpoints
/auth/token{username, password, scope?}/auth/refresh{refresh_token, scope?}Both proxy to Authentik
tokenUrl(from P3.7 config). Upstream response forwarded verbatim — client sees Authentik errors directly.Design
authClientinterface extracted for testability (stub in tests,http.Clientin prod)openid roles permissionstokenUrl/clientIdnot configuredTests
15 tests: success, custom scope, missing username/password, invalid JSON, wrong HTTP method, not configured (503), upstream error (502), bad credentials forwarded (400), expired refresh (401), no credential leak.