[Ch 11] Integration — auth, database, and API token generation #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Type
Feature
Lineage
Standalone — scoped from platform-playbook chapter 11 for the full-stack mdview vision.
Repo
ldraney/mdviewUser Story
As a developer
I want to log in via Keycloak and generate API tokens
So that I can authenticate the CLI through the cluster
Context
This is the core integration ticket. Everything is provisioned (database, Keycloak, deployment) — now wire it together in the app. Users log in via Keycloak SSO, generate API tokens from a web UI, and use those tokens from the CLI. The CLI authenticates via token header; the cluster proxies authenticated requests to the mdview container.
File Targets
Gemfile— addomniauth_openid_connect,omniauth-rails_csrf_protectionapp/controllers/sessions_controller.rb— create OmniAuth callback handlerapp/models/api_token.rb— create (user_id, token_digest, name, last_used_at)app/controllers/api_tokens_controller.rb— create (generate, revoke, list)app/views/api_tokens/— token management UIconfig/initializers/omniauth.rb— Keycloak provider configapp/controllers/application_controller.rb— auth enforcement + token middlewaredb/migrate/— users table, api_tokens tableFiles the agent should NOT touch:
app/controllers/markdown_controller.rb— keep rendering logic separate from authFeature Flag
none — this is core functionality, not a toggleable feature
Acceptance Criteria
Authorization: Bearer <token>headerlast_used_atupdates on useTest Expectations
bundle exec rspecConstraints
Checklist
Related
project-mdview— project this affects