Local dev auth bypass for docker-compose #33

Open
opened 2026-06-08 03:20:44 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Follow-up from spike #16 (docs/auth.md — Local Development section). Ships alongside #32 (users + OmniAuth).

Repo

ldraney/palinks

User Story

As a developer
I want to skip Keycloak in local dev
So that I can work without running a Keycloak instance

Context

Local docker-compose dev doesn't have Keycloak. A conditional middleware or initializer check should auto-set a superadmin session in development mode so the full app works locally without auth infrastructure.

File Targets

  • config/initializers/omniauth.rb — skip OmniAuth setup in development
  • app/controllers/application_controller.rb — mock current_user in development
  • Or: config/initializers/dev_auth.rb — dedicated dev auth bypass

Feature Flag

None — development-only behavior, not deployed to production.

Acceptance Criteria

  • In development, app auto-authenticates as superadmin
  • No Keycloak env vars required locally
  • Login/logout buttons still render (for UI testing)
  • Bypass is ONLY active in development (not test, not production)
  • current_user returns a mock or real User record

Test Expectations

  • Unit test: bypass is not active in test environment
  • Run: bundle exec rails test

Constraints

  • Must not affect production or test environments
  • Check Rails.env.development? only

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • project-palinks — project page
  • docs/auth.md — Local Development section
  • #32 — users + OmniAuth (ships together)
### Type Feature ### Lineage Follow-up from spike #16 (`docs/auth.md` — Local Development section). Ships alongside #32 (users + OmniAuth). ### Repo `ldraney/palinks` ### User Story As a developer I want to skip Keycloak in local dev So that I can work without running a Keycloak instance ### Context Local docker-compose dev doesn't have Keycloak. A conditional middleware or initializer check should auto-set a superadmin session in development mode so the full app works locally without auth infrastructure. ### File Targets - `config/initializers/omniauth.rb` — skip OmniAuth setup in development - `app/controllers/application_controller.rb` — mock current_user in development - Or: `config/initializers/dev_auth.rb` — dedicated dev auth bypass ### Feature Flag None — development-only behavior, not deployed to production. ### Acceptance Criteria - [ ] In development, app auto-authenticates as superadmin - [ ] No Keycloak env vars required locally - [ ] Login/logout buttons still render (for UI testing) - [ ] Bypass is ONLY active in development (not test, not production) - [ ] `current_user` returns a mock or real User record ### Test Expectations - [ ] Unit test: bypass is not active in test environment - Run: `bundle exec rails test` ### Constraints - Must not affect production or test environments - Check `Rails.env.development?` only ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `project-palinks` — project page - `docs/auth.md` — Local Development section - #32 — users + OmniAuth (ships together)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/palinks#33
No description provided.