- Updated all package.json name fields and dependency references - Updated all TypeScript/JavaScript imports - Updated .woodpecker/publish.yml filters and registry paths - Updated tools/install.sh scope default - Updated .npmrc registry paths (worktree + host) - Enhanced update-checker.ts with checkForAllUpdates() multi-package support - Updated CLI update command to show table of all packages - Added KNOWN_PACKAGES, formatAllPackagesTable, getInstallAllCommand - Marked checkForUpdate() with @deprecated JSDoc Closes #391
2.4 KiB
2.4 KiB
P5-004 Scratchpad
-
Objective: Add optional Authentik OIDC SSO adapter via Better Auth genericOAuth.
-
Task ref: P5-004
-
Issue ref: #96
-
Plan:
- Inspect auth/gateway surfaces and Better Auth plugin shape.
- Add failing coverage for auth config/startup validation where feasible.
- Implement adapter, docs, and warnings.
- Run targeted typechecks, lint, and review.
-
TDD note: no low-friction auth plugin or bootstrap-env test seam exists for
packages/auth/src/auth.tsorapps/gateway/src/main.ts. This change is configuration-oriented and does not alter an existing behavioral contract with a current test harness. I skipped new tests for this pass and relied on exact typecheck/lint/test commands plus manual review. -
Changes:
- Added conditional Better Auth
genericOAuthplugin registration for theauthentikprovider inpackages/auth/src/auth.ts. - Added a soft startup warning in
apps/gateway/src/main.tsfor incomplete Authentik env configuration. - Added
docs/plans/authentik-sso-setup.mdwith env, redirect URI, and test-flow guidance. - Confirmed
packages/auth/src/index.tsalready exportsAuthConfig; no change required there.
- Added conditional Better Auth
-
Verification:
pnpm --filter @mosaicstack/db buildpnpm --filter @mosaicstack/auth typecheckpnpm --filter @mosaicstack/gateway typecheckpnpm lintpnpm format:checkpnpm --filter @mosaicstack/auth testpnpm --filter @mosaicstack/gateway test
-
Results:
@mosaicstack/authtypecheck passed after replacing the non-existentenabledfield with conditional plugin registration.@mosaicstack/gatewaytypecheck passed.- Repo lint passed.
- Prettier check passed after formatting
apps/gateway/src/main.ts. @mosaicstack/authtests reportedNo test files found, exiting with code 0.@mosaicstack/gatewaytests passed:3files,20tests.
-
Review:
- Manual review of the diff found no blocker issues.
- External
codex-code-review.sh --uncommittedwas attempted but did not return a usable verdict in-session; no automated review findings were available from that run.
-
Situational evidence:
- Provider activation is env-gated by
AUTHENTIK_CLIENT_ID. - Misconfigured optional SSO surfaces a warning instead of crashing gateway startup.
- Setup doc records the expected redirect path:
{BETTER_AUTH_URL}/api/auth/callback/authentik.
- Provider activation is env-gated by