Onboard watchstate into Authentik (oauth2-proxy, admin-team-gated) #26
Reference in New Issue
Block a user
Delete Branch "benvin/watchstate-oidc"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Onboard watchstate (internal media watch-state sync admin tool) into Authentik so it can sit behind oauth2-proxy doing OIDC against Authentik (issuer identity.k8s.syd1.au.unkin.net). Deployed in-cluster at watchstate.k8s.syd1.au.unkin.net (no public domain); access must be restricted to the admin team only.
How
Mirrors the existing in-cluster admin-tool pattern (logviewer / traefik) 1:1:
config/providers_oauth2/watchstate.yaml— confidential OAuth2/OIDC provider + application. Redirect URIhttps://watchstate.k8s.syd1.au.unkin.net/oauth2/callback(oauth2-proxy), openid/email/profile scopes, launch URL set. client_secret read from Vault kvkubernetes/namespace/watchstate/default/oauth-credentials(seeded out of band, not committed).config/permissions/akP-watchstate-admin.yaml— permission group bound to the watchstate application; the module turns this into the gatingauthentik_policy_binding, so only members (and children) can authorize.config/roles/akR-global-admin.yaml— nestakP-watchstate-admininto the existing admin-team role, so exactly the global admins reach watchstate. No new admin group created.Validation
yamllint + pre-commit (end-of-file/trailing-whitespace/yamllint) pass locally. tofu-validate/tflint run in CI plan (need provider init). No HCL touched.
Note: the kv secret must be pre-seeded with a
client_secretkey before apply/plan resolves the data source.