Files
apf_portal/libs/shared/auth
Julien Gautier e055578142
CI / commits (pull_request) Successful in 2m44s
CI / check (pull_request) Successful in 3m15s
CI / scan (pull_request) Failing after 3m23s
CI / a11y (pull_request) Successful in 3m33s
CI / perf (pull_request) Successful in 7m44s
fix(ci): align shared-auth build outputPath with tsconfig.lib.json outDir
portal-bff/tsconfig.app.json declares a TypeScript project reference
to libs/shared/auth, so when webpack runs tsc against that tsconfig
it validates that the referenced project's declarations exist at the
location libs/shared/auth/tsconfig.lib.json declares as outDir
(dist/out-tsc/libs/shared/auth). But nx's @nx/js:tsc executor was
emitting them to dist/libs/shared/auth (the project.json outputPath),
so tsc fails with TS6305 "Output file ... has not been built".

The mismatch was harmless locally because a manual `tsc --build`
during development populated both directories. Fresh CI runners
only run nx's executor, so only one directory was populated.

Aligning outputPath to dist/out-tsc/libs/shared/auth makes both
agree. shared-auth is the first lib in the workspace that's
consumed by portal-bff in a way that triggers tsc project-reference
validation; the SPA-targeted libs (shared-util, shared-tokens)
ride the same mismatch but don't hit it because the Angular build
pipeline doesn't validate project references the same way.
2026-05-23 23:31:27 +02:00
..

shared-auth

Framework-agnostic authorization primitives shared across portal-bff and portal-shell per ADR-0025:

  • Catalogues (authorization.types.ts) — closed-set lists of the four privileges (Portal.* Entra app roles), the 24 functional roles (apf-role-* Entra security groups), and the six scope kinds. Adding an entry is an ADR amendment, not a code change in isolation.
  • Principal type — the session-resident shape consumed by route guards (@RequirePrivilege, @RequireRole, @RequireScope) and projected to the AI service's flat roles[] contract.
  • EntraGroupToRoleResolver — turns the tenant-specific Entra group GUIDs carried in the OIDC groups claim into the catalogue's role slugs. Configured at boot from infra/<env>-tenant.entra.json (gitignored — GUIDs are tenant-private).

Building

Run pnpm nx build shared-auth to build the library.

Running unit tests

Run pnpm nx test shared-auth to execute the unit tests via Vitest.