Files
task-stream/.env.example
Josep Piguillem cbaad17fc7 fix(auth): separate Pireon clients for authorization code and password
Pireon OAuth clients allow a single grant type. With one PIREON_CLIENT_ID of
type password, email + password worked but "Sign in with Pireon" failed with
`unauthorized_client`.

- PIREON_CLIENT_ID/SECRET: authorization_code client (Sign in with Pireon,
  Swagger UI). New PIREON_PASSWORD_CLIENT_ID/SECRET: password client, falling
  back to the former so existing setups keep working.
- Refresh tries both clients: a refresh token only works with its issuer.
- PIREON_PASSWORD_GRANT=false now also rejects password grants in the API
  (before it only hid the form).
- /api/auth/config returns clientId: null when there is no authorization_code
  client, and the web hides "Sign in with Pireon".
- docker-compose passes the new variables; docs 05/07, .env.example,
  openapi.json; unit tests for the client selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 15:41:50 +02:00

42 lines
1.7 KiB
Plaintext

PORT=3000
# Write model (commands)
POSTGRES_URL=postgres://taskstream:taskstream@localhost:5432/taskstream
# Creates/updates tables from the entities. Use migrations in production.
POSTGRES_SYNCHRONIZE=true
# Read model (queries)
MONGO_URL=mongodb://localhost:27017/taskstream_read
# Event stream (write → read), GraphQL pub/sub and session cache
REDIS_URL=redis://localhost:6379
EVENT_STREAM_KEY=task-stream:events
# Set to false on API-only instances when the events bridge (projections) runs elsewhere
EVENTS_BRIDGE_ENABLED=true
# Pireon identity server (https://oauth.pireon.dev/api/documentation)
PIREON_BASE_URL=https://oauth.pireon.dev
# Secret returned when registering the webhook (POST /api/clients/{client}/webhooks)
PIREON_WEBHOOK_SECRET=
# OAuth clients of task-stream in Pireon (POST /api/clients). Each Pireon client allows ONE grant type:
# authorization_code → "Sign in with Pireon" and Swagger UI. Redirect URIs to register:
# http://localhost:4200/auth/callback, http://localhost:3000/api/docs/oauth2-redirect.html
PIREON_CLIENT_ID=
PIREON_CLIENT_SECRET=
# password → email + password sign-in (defaults to the client above when empty)
PIREON_PASSWORD_CLIENT_ID=
PIREON_PASSWORD_CLIENT_SECRET=
PIREON_SCOPES=users:read
PIREON_PASSWORD_GRANT=true
AUTH_SESSION_TTL_SECONDS=60
GRAPHQL_PLAYGROUND=true
# REST + OpenAPI for other apps (Swagger UI at /api/docs). The document is also written to OPENAPI_FILE.
SWAGGER_ENABLED=true
OPENAPI_FILE=apps/api/openapi.json
# Docker builds only: token of Pireon's Nexus for @pi/ui (build secret, never stored in an image).
# Locally: export NEXUS_TOKEN=$(grep '^//nexus.pireon.dev/repository/npm-releases/:_authToken=' ~/.npmrc | cut -d= -f2-)
NEXUS_TOKEN=