Skip to content

chore: local dev auth bypass - #445

Open
mdiapenabc wants to merge 8 commits into
devfrom
chore/local-dev-auth-bypass
Open

chore: local dev auth bypass#445
mdiapenabc wants to merge 8 commits into
devfrom
chore/local-dev-auth-bypass

Conversation

@mdiapenabc

Copy link
Copy Markdown
Collaborator

Description

Developers need to run CSA on a laptop without deploy env dependencies: S3, authentication.... This PR adds a DEPLOY_ENV=local workflow: Colima Postgres, filesystem-backed ICM/MIS/CRA mocks, auth bypass, persona-based seed data, Makefile pipeline commands, and mock CRA RSP/WKL generators for end-to-end batch testing.

What changed

  • Local auth: Backend accepts local-dev-token when DEPLOY_ENV=local; frontend skips Keycloak when VITE_APP_ENV=LOCAL
  • Filesystem integrations: LocalIcmDataSource and LocalFileStorageService read from .local/storage/; CRA uses MockCraTransferService (no MinIO/S3 on laptop)
  • Seed overhaul : 32 baseline contacts + staging; 10 incremental cases after data-fetch + eligibility; persona generator and fixture writers under backend/prisma/local-dev/
  • Makefile :make db, install, data-fetch, run-eligibility, generate-cra-response, generate-cra-wkl, poll-cra-response, backend/frontend with optional BACKEND_WATCH=0
  • CRA mock tools: Scripts to generate RSP/WKL from outbound files with uniform or mixed outcomes (RESPONSE_OUTCOME, WKL_OUTCOME)
  • CRA job fix : CraModule imported in API jobs module so Send to CRA works from the local API process
  • Docker: Colima-oriented compose updates; optional MinIO profile removed; .local/storage mounted for app profile
  • Docs: Root, backend, and frontend READMEs with src layout, setup steps, and local CRA flow

How to test

  • make env && make install && make db: Postgres up, 32 contacts seeded, fixtures in .local/storage/`
  • make dev — UI at http://localhost:5173, API at http://localhost:3000/api (no Keycloak)
  • `make data-fetch && make run-eligibility: 42 contacts total
  • Create a batch in UI, send to CRA, then:
    • make generate-cra-response && make poll-cra-response: acknowledgement applied
    • make generate-cra-wkl && make poll-cra-response: contacts move to In Pay
  • npm test in backend/: including prisma/local-dev/*.spec.ts

Enable laptop development without Keycloak or ICM via DEPLOY_ENV=local and
VITE_APP_ENV=LOCAL, with Makefile targets, docker-compose updates, CRA file
storage under .local/storage, and seed cleanup for related tables.
Add persona-based seeding, filesystem ICM/MIS/CRA integrations, Makefile
targets for ingest/eligibility and mock RSP/WKL generation, and remove the
optional MinIO docker profile in favor of .local/storage for laptop dev.
Refresh backend and frontend READMEs with src layout and setup steps,
correct seed contact counts in the root README, and add root .nvmrc plus
make install for first-time setup.
@mdiapenabc
mdiapenabc marked this pull request as ready for review August 8, 2026 15:40
CSAGuard now depends on ConfigService for local auth bypass, so the test module must provide it.
Require DEPLOY_ENV and document CRA/sync vars in .env.example instead of
code defaults. Replace TST0016 with TESTUSERID1 for public local dev fixtures.
@mdiapenabc mdiapenabc changed the title chore: ocal dev auth bypass chore: local dev auth bypass Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants