@juangcarmona/lighthouse 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/assets/profiles/catalog.json +1019 -17
  2. package/assets/profiles/mobile-expo/README.md +19 -0
  3. package/assets/profiles/mobile-expo/SKILL.md +14 -0
  4. package/assets/profiles/mobile-expo/adoption.md +11 -0
  5. package/assets/profiles/mobile-expo/guardrails.md +14 -0
  6. package/assets/profiles/mobile-expo/testing.md +13 -0
  7. package/assets/profiles/mobile-maui/README.md +19 -0
  8. package/assets/profiles/mobile-maui/SKILL.md +14 -0
  9. package/assets/profiles/mobile-maui/adoption.md +11 -0
  10. package/assets/profiles/mobile-maui/guardrails.md +13 -0
  11. package/assets/profiles/mobile-maui/testing.md +13 -0
  12. package/assets/profiles/pwa-capability/README.md +19 -0
  13. package/assets/profiles/pwa-capability/SKILL.md +14 -0
  14. package/assets/profiles/pwa-capability/adoption.md +9 -0
  15. package/assets/profiles/pwa-capability/guardrails.md +13 -0
  16. package/assets/profiles/pwa-capability/offline.md +11 -0
  17. package/assets/profiles/pwa-capability/testing.md +15 -0
  18. package/assets/profiles/react-web-platform/README.md +24 -0
  19. package/assets/profiles/react-web-platform/SKILL.md +18 -0
  20. package/assets/profiles/react-web-platform/adoption.md +17 -0
  21. package/assets/profiles/react-web-platform/guardrails.md +17 -0
  22. package/assets/profiles/react-web-platform/structure.md +36 -0
  23. package/assets/profiles/react-web-platform/testing.md +15 -0
  24. package/assets/profiles/web-bff/README.md +22 -0
  25. package/assets/profiles/web-bff/SKILL.md +16 -0
  26. package/assets/profiles/web-bff/adoption.md +9 -0
  27. package/assets/profiles/web-bff/security.md +16 -0
  28. package/assets/profiles/web-bff/testing.md +14 -0
  29. package/assets/schemas/profile-catalog.schema.json +286 -20
  30. package/package.json +1 -1
  31. package/src/lighthouse.mjs +46 -1
  32. package/src/profiles.mjs +78 -5
@@ -0,0 +1,19 @@
1
+ # Lighthouse Expo mobile profile
2
+
3
+ Use this profile when Android or iOS is a real product requirement and the application will run as an Expo and React Native app.
4
+
5
+ ## Start here
6
+
7
+ | Need | Read |
8
+ | --- | --- |
9
+ | New mobile application | [adoption](adoption.md) → [guardrails](guardrails.md) → [testing](testing.md) |
10
+ | Add a native capability | [guardrails](guardrails.md) → [testing](testing.md) |
11
+ | Export a web build | [adoption](adoption.md) → [testing](testing.md) |
12
+
13
+ ## Defaults
14
+
15
+ Use Expo, React Native, Expo Router, strict TypeScript, TanStack Query and secure storage.
16
+
17
+ Declare deep links, permissions, push notifications and native build targets before implementing a platform capability.
18
+
19
+ Treat web export as an explicit selection with separate evidence. Do not make Expo a hidden layer on top of a React web profile.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: lighthouse-mobile-expo
3
+ description: Apply the Lighthouse Expo mobile profile when a repository selects mobile-expo.
4
+ ---
5
+
6
+ # Lighthouse Expo mobile profile
7
+
8
+ Read the mobile profile guide before changing an Expo adopter.
9
+
10
+ Keep features aligned with product capabilities and use TanStack Query for server state. Keep credentials in secure storage and declare every permission and deep link.
11
+
12
+ Treat Android and iOS behavior as native evidence. Add web export only when the product selects it and keep that evidence separate.
13
+
14
+ Run Expo doctor, typecheck, tests and the selected emulator or device journey after a focused change.
@@ -0,0 +1,11 @@
1
+ # Adopt the Lighthouse Expo mobile profile
2
+
3
+ Select `mobile-expo` only when Android or iOS is a product requirement. Select `dotnet-backend` when the product also owns a Lighthouse backend.
4
+
5
+ Set `application.shape` to `mobile` for a mobile-only project or `full-stack` for a mobile application with its backend, and include `expo` in `application.stacks`.
6
+
7
+ Start with authentication, secure storage, one API call and one real interaction in an emulator or device.
8
+
9
+ Choose web export deliberately and keep its browser evidence separate from native evidence.
10
+
11
+ The mobile source, native configuration, permissions and signing policy become product-owned after adoption.
@@ -0,0 +1,14 @@
1
+ # Expo mobile guardrails
2
+
3
+ | Guardrail | Level | Evidence | Failure |
4
+ | --- | --- | --- | --- |
5
+ | TypeScript and lint | Required | Deterministic static checks | The mobile slice stops before integration. |
6
+ | Expo health | Required | Expo doctor and reproducible build | The selected native target is not ready. |
7
+ | Secure storage | Required | Storage and logout test | Credentials remain unverified. |
8
+ | Permissions and deep links | Required | Native configuration and lifecycle tests | The capability remains incomplete. |
9
+ | Authentication and API | Required | Native integration evidence | The first mobile slice is not proven. |
10
+ | Emulator or device journey | Required | Native test evidence | The selected platform remains unverified. |
11
+ | Push notifications | Optional | Product-selected native evidence | No push behavior is assumed. |
12
+ | Web export | Optional | Separate browser build and journey evidence | Native success does not imply web success. |
13
+
14
+ Do not treat a web export as evidence for Android or iOS behavior.
@@ -0,0 +1,13 @@
1
+ # Expo mobile testing
2
+
3
+ | Layer | Purpose | Evidence |
4
+ | --- | --- | --- |
5
+ | Static | TypeScript, lint and Expo configuration | CI output |
6
+ | Unit and component | Feature and interaction behavior | Jest or Vitest with Testing Library |
7
+ | Native integration | Secure storage, permissions, links and API boundary | Emulator or device evidence |
8
+ | Lifecycle | Background, resume, logout, expiry and user change | Native journey evidence |
9
+ | Web export | Selected web behavior | Separate browser evidence |
10
+
11
+ The first vertical slice covers authentication, secure storage, one API call and one real interaction on the selected platform.
12
+
13
+ Keep provider credentials out of fixtures and retain the device or emulator target with the evidence.
@@ -0,0 +1,19 @@
1
+ # Lighthouse .NET MAUI mobile profile
2
+
3
+ Use this profile when Android or iOS is a real product requirement and the application will run as a native .NET MAUI client.
4
+
5
+ ## Start here
6
+
7
+ | Need | Read |
8
+ | --- | --- |
9
+ | New native application | [adoption](adoption.md) → [guardrails](guardrails.md) → [testing](testing.md) |
10
+ | Add a device capability | [guardrails](guardrails.md) → [testing](testing.md) |
11
+ | Prepare a release build | [adoption](adoption.md) → [guardrails](guardrails.md) |
12
+
13
+ ## Defaults
14
+
15
+ Use C# and XAML with explicit lifecycle, secure storage, deep links, notifications, permissions and device capability boundaries.
16
+
17
+ Use OIDC Authorization Code with PKCE and keep API contracts, permissions, pure business rules, errors, telemetry and visual principles aligned with the product's other clients.
18
+
19
+ Do not reuse React components, browser cookies, web routing, persistence entities, DbContexts or internal handlers.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: lighthouse-mobile-maui
3
+ description: Apply the Lighthouse .NET MAUI mobile profile when a repository selects mobile-maui.
4
+ ---
5
+
6
+ # Lighthouse .NET MAUI mobile profile
7
+
8
+ Read the mobile profile guide before changing a .NET MAUI adopter.
9
+
10
+ Keep platform capabilities behind explicit adapters and preserve the boundary between native lifecycle code and pure business rules.
11
+
12
+ Use secure storage, OIDC Authorization Code with PKCE, declared permissions and tested deep links. Keep browser cookies and web routing outside the native client.
13
+
14
+ Run locked restore, analyzers, unit tests and the selected emulator or device journey after a focused change.
@@ -0,0 +1,11 @@
1
+ # Adopt the Lighthouse .NET MAUI mobile profile
2
+
3
+ Select `mobile-maui` only when Android or iOS is a product requirement. Select `dotnet-backend` when the product also owns a Lighthouse backend.
4
+
5
+ Set `application.shape` to `mobile` for a mobile-only project or `full-stack` for a mobile application with its backend, and include `maui` in `application.stacks`.
6
+
7
+ Start with authentication, secure storage, one API call and one real interaction in an emulator or device.
8
+
9
+ Select macOS or Windows targets only when the product requires them. Add packaging and signing only when they are in scope.
10
+
11
+ The mobile source, native configuration, permissions and signing policy become product-owned after adoption.
@@ -0,0 +1,13 @@
1
+ # .NET MAUI mobile guardrails
2
+
3
+ | Guardrail | Level | Evidence | Failure |
4
+ | --- | --- | --- | --- |
5
+ | Locked restore and build | Required | Deterministic restore and build per target | The selected native target is not reproducible. |
6
+ | Analyzers and format | Required | Static checks and format verification | The mobile slice stops before integration. |
7
+ | Secure storage and authentication | Required | OIDC, storage, logout and expiry tests | Credentials or session behavior remains unverified. |
8
+ | Permissions and deep links | Required | Native configuration and lifecycle tests | The capability remains incomplete. |
9
+ | Emulator or device journey | Required | Native functional evidence | The selected platform remains unverified. |
10
+ | Notifications, camera and files | Optional | Product-selected native evidence | No device capability is assumed. |
11
+ | Packaging and signing | Optional | Product-selected release evidence | No release signing is assumed. |
12
+
13
+ Share contracts, permissions, pure rules, errors, telemetry and visual principles deliberately. Keep web routing, cookies, React components, persistence entities and internal backend handlers outside the client.
@@ -0,0 +1,13 @@
1
+ # .NET MAUI mobile testing
2
+
3
+ | Layer | Purpose | Evidence |
4
+ | --- | --- | --- |
5
+ | Restore and build | Prove each selected target resolves and compiles | Locked CI output |
6
+ | Unit | Exercise pure rules and client behavior | .NET test output |
7
+ | Integration | Exercise API, authentication and secure storage boundaries | Approved test host or device evidence |
8
+ | Lifecycle | Prove background, resume, logout, expiry and user change | Emulator or device journey |
9
+ | Device capability | Prove selected permissions, links, notifications, camera or files | Target-specific evidence |
10
+
11
+ The first vertical slice covers authentication, secure storage, one API call and one real interaction on the selected platform.
12
+
13
+ Keep signing material and provider credentials outside fixtures. Retain the target platform and build configuration with the evidence.
@@ -0,0 +1,19 @@
1
+ # Lighthouse PWA capability
2
+
3
+ Use this capability when a React web application has a real installability or offline requirement.
4
+
5
+ ## Start here
6
+
7
+ | Need | Read |
8
+ | --- | --- |
9
+ | Public installable web app | [adoption](adoption.md) → [guardrails](guardrails.md) |
10
+ | Authenticated PWA | [adoption](adoption.md) → [offline policy](offline.md) |
11
+ | Diagnose an update problem | [guardrails](guardrails.md) → [testing](testing.md) |
12
+
13
+ ## Defaults
14
+
15
+ Declare the manifest, icons, service worker, asset cache, update strategy and offline behavior as part of the product surface.
16
+
17
+ Cache assets separately from navigation and private data. Do not cache private APIs automatically and do not store tokens in browser storage.
18
+
19
+ An authenticated PWA keeps the `web-bff` session boundary; installability does not change authentication ownership.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: lighthouse-pwa
3
+ description: Apply the Lighthouse PWA capability when a repository selects pwa-capability.
4
+ ---
5
+
6
+ # Lighthouse PWA capability
7
+
8
+ Read the PWA guide before changing an adopter's installability or offline behavior.
9
+
10
+ Separate asset, navigation and private-data caching. Declare the bounded contexts that work offline and the actions that need the network.
11
+
12
+ Keep authenticated sessions on the web BFF contract. Keep tokens out of browser storage and test logout, expiry and user changes.
13
+
14
+ Run install, update, cache and browser evidence after a focused change. Treat a missing update or recovery test as an incomplete capability.
@@ -0,0 +1,9 @@
1
+ # Adopt the Lighthouse PWA capability
2
+
3
+ Select `pwa-capability` with `react-web-platform` when installability, asset caching or a declared offline journey is a product requirement.
4
+
5
+ Choose the bounded contexts that work offline and record which actions remain online-only.
6
+
7
+ Define the update and recovery behavior before enabling a service worker in production. Test a fresh install, an update, logout, session expiry and a user change.
8
+
9
+ Keep the application source, manifest values, icons and service-worker implementation product-owned after adoption.
@@ -0,0 +1,13 @@
1
+ # PWA guardrails
2
+
3
+ | Guardrail | Level | Evidence | Failure |
4
+ | --- | --- | --- | --- |
5
+ | Manifest and icons | Required | Deterministic build and installability check | The capability is not installable. |
6
+ | Asset cache | Required | Service-worker inspection and browser test | The cache contract is incomplete. |
7
+ | Update strategy | Required | Fresh-install and update journey | A stale application can remain active without a recovery path. |
8
+ | Offline scope | Required | Declared bounded contexts and behavior review | Offline behavior remains ambiguous. |
9
+ | Private API cache | Required | Static or review check | The capability stops until private-data caching is explicitly designed. |
10
+ | Session lifecycle | Required for authenticated apps | Logout, expiry and user-change journeys | The session boundary remains unverified. |
11
+ | Push | Optional | Product-selected permission and delivery evidence | No push behavior is assumed. |
12
+
13
+ Do not enable offline-first behavior by convention. Make the offline boundary a product decision and keep it narrow.
@@ -0,0 +1,11 @@
1
+ # PWA offline policy
2
+
3
+ Classify each bounded context as online-only, read-only offline or read-write offline before adding data caching.
4
+
5
+ Keep assets, navigation and data caches separate so an update can invalidate one policy without changing the others.
6
+
7
+ Read-only offline journeys need an explicit freshness rule and a visible stale state.
8
+
9
+ Read-write offline journeys need conflict handling, replay rules, authentication recovery and evidence for a changed user.
10
+
11
+ Private API responses remain online-only until the product and architecture define encryption, retention, invalidation and conflict behavior.
@@ -0,0 +1,15 @@
1
+ # PWA testing
2
+
3
+ | Journey | Evidence |
4
+ | --- | --- |
5
+ | Fresh install | Manifest, icon and service-worker registration check |
6
+ | Asset update | New revision replaces the cached revision |
7
+ | Navigation offline | Declared navigation fallback behaves as designed |
8
+ | Private data | No undeclared API response enters a cache |
9
+ | Logout and expiry | Authenticated cache and session state are cleared or blocked |
10
+ | User change | The next user cannot observe the previous user's data |
11
+ | Push, when selected | Permission, delivery and revocation evidence |
12
+
13
+ Run the journeys in a real browser context with a clean profile and a second revision of the application.
14
+
15
+ A successful service-worker registration alone is not evidence that the update and data policies work.
@@ -0,0 +1,24 @@
1
+ # Lighthouse React web profile
2
+
3
+ Use this profile for React applications that need a predictable browser boundary, feature-oriented source and evidence for the journeys users rely on.
4
+
5
+ ## Start here
6
+
7
+ | Need | Read |
8
+ | --- | --- |
9
+ | New web application | [structure](structure.md) → [guardrails](guardrails.md) → [testing](testing.md) |
10
+ | Existing web application | [adoption](adoption.md) → [structure](structure.md) |
11
+ | Implement a feature | [structure](structure.md) → [testing](testing.md) |
12
+ | Diagnose a failed check | [guardrails](guardrails.md) |
13
+
14
+ ## Defaults
15
+
16
+ Use React and strict TypeScript with thin routes, an app shell and feature slices aligned with bounded contexts and backend use cases.
17
+
18
+ Use TanStack Query for server state and keep local state local; put filters, pagination and meaningful navigation state in the URL.
19
+
20
+ Use explicit API contracts, visual-theme tokens, Testing Library, Vitest, Playwright and axe for the applicable surfaces.
21
+
22
+ Add form, schema, mock or client-generation libraries only when a real feature requires them and the contract is stable.
23
+
24
+ The profile does not create a runtime component library or turn shared folders into a technical-layer architecture.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: lighthouse-react-web
3
+ description: Apply the Lighthouse React web profile when a repository selects react-web-platform.
4
+ ---
5
+
6
+ # Lighthouse React web profile
7
+
8
+ Read the profile guide before changing a React adopter.
9
+
10
+ Keep routes thin and organize behavior by feature and bounded context. Put screens, API calls, queries, mutations, components, types and tests beside the feature that owns them.
11
+
12
+ Use TanStack Query for server state. Keep local UI state local and put filters, pagination and meaningful navigation state in the URL.
13
+
14
+ Use explicit API contracts and render loading, empty, error, disabled and validation states for each interactive surface.
15
+
16
+ Run the project's typecheck, lint, format, build, unit and browser checks after a focused change. Use axe evidence for critical surfaces.
17
+
18
+ Application code, tests, dependencies and build policy become adopter-owned after creation. Do not overwrite them from the profile.
@@ -0,0 +1,17 @@
1
+ # Adopt the Lighthouse React web profile
2
+
3
+ ## New application
4
+
5
+ Select `react-web-platform` with `visual-theme`, set `application.shape` to `frontend` or `full-stack` and set `application.stacks` to include `react`.
6
+
7
+ Run `lighthouse profiles --format json` before writing application code and keep the reported commands in the repository's normal verification loop.
8
+
9
+ ## Existing application
10
+
11
+ Inventory routing, session, API contracts, server state, feature boundaries, interaction states, accessibility evidence, tests and build output before moving files.
12
+
13
+ Map the existing implementation to the profile and record project-owned exceptions where a move would change behavior or ownership.
14
+
15
+ Adopt one user journey first: session, authenticated screen, query, mutation, loading, empty, error and authentication failure.
16
+
17
+ The application owns its source, tests, dependencies and build configuration after adoption; Lighthouse owns only the generated profile guidance and declared projections.
@@ -0,0 +1,17 @@
1
+ # React web guardrails
2
+
3
+ | Guardrail | Level | Evidence | Failure |
4
+ | --- | --- | --- | --- |
5
+ | Strict TypeScript | Required | Deterministic typecheck | The profile is not ready for delivery. |
6
+ | Lint and format | Required | Deterministic lint and format checks | The change stops before integration. |
7
+ | Reproducible build | Required | Deterministic production build | The application cannot be released from this revision. |
8
+ | Unit and component tests | Required | Deterministic Vitest and Testing Library checks | The affected slice needs repair. |
9
+ | Critical browser journeys | Required | Playwright evidence | The journey remains unverified. |
10
+ | Accessibility on critical surfaces | Required | axe evidence and human review where needed | The surface remains pending review. |
11
+ | Import boundaries | Recommended | Static or architectural check | Record a project-owned exception with an owner and review date. |
12
+ | Visual drift | Recommended | Visual evidence against the selected theme | Review the changed surface before accepting it. |
13
+ | Performance budget | Optional | Project-selected budget check | Record why the budget is not applicable. |
14
+
15
+ A public web application may call a public API directly when that decision is recorded; an authenticated web application selects `web-bff` by default.
16
+
17
+ Do not store access or refresh tokens in localStorage, sessionStorage or IndexedDB. The BFF profile owns the authenticated browser session contract.
@@ -0,0 +1,36 @@
1
+ # React web structure
2
+
3
+ Keep the repository source under `src/` and keep the primary architecture feature-oriented.
4
+
5
+ ```text
6
+ src/
7
+ app/ routes and application shell
8
+ features/
9
+ <bounded-context>/
10
+ <feature>/
11
+ screen/
12
+ api/
13
+ queries/
14
+ mutations/
15
+ components/
16
+ types/
17
+ tests/
18
+ shared/
19
+ http/
20
+ auth/
21
+ query/
22
+ errors/
23
+ telemetry/
24
+ api/
25
+ i18n/
26
+ design-system/
27
+ tests/ browser and cross-feature evidence
28
+ ```
29
+
30
+ Routes compose screens and policy; they do not become a second application layer.
31
+
32
+ Features follow bounded contexts and use cases. Extract shared code only when more than one feature has a real common contract.
33
+
34
+ The API client exposes typed contracts and maps transport failures into application errors without leaking transport details into screens.
35
+
36
+ The profile can run as a Vite SPA or another approved React framework when its output and verification commands remain explicit.
@@ -0,0 +1,15 @@
1
+ # React web testing
2
+
3
+ Use a short feedback loop: typecheck and unit tests first, then integration and browser evidence for the behavior that crosses boundaries.
4
+
5
+ | Layer | Purpose | Evidence |
6
+ | --- | --- | --- |
7
+ | Typecheck and lint | Catch static contract and style errors | CI output |
8
+ | Unit and component | Exercise feature behavior and interaction states | Vitest and Testing Library |
9
+ | Integration | Exercise API and BFF contracts where a boundary matters | Project-selected test harness |
10
+ | Browser | Prove login, navigation, query, mutation and failure states | Playwright with catalogued evidence |
11
+ | Accessibility | Catch critical semantic and keyboard regressions | axe plus human review when required |
12
+
13
+ The first vertical slice covers session, an authenticated screen, a query, a mutation, loading, empty, error and authentication failure.
14
+
15
+ Keep browser journeys few and valuable. Do not replace application tests with end-to-end tests or mock away the boundary being verified.
@@ -0,0 +1,22 @@
1
+ # Lighthouse web BFF profile
2
+
3
+ Use this profile for authenticated web applications that need a same-origin browser session and a server-side boundary for tokens and API calls.
4
+
5
+ ## Start here
6
+
7
+ | Need | Read |
8
+ | --- | --- |
9
+ | New private web application | [adoption](adoption.md) → [security](security.md) → [testing](testing.md) |
10
+ | Existing web application | [adoption](adoption.md) → [security](security.md) |
11
+ | Implement a session change | [security](security.md) → [testing](testing.md) |
12
+ | Diagnose an authentication failure | [security](security.md) |
13
+
14
+ ## Defaults
15
+
16
+ Keep OAuth tokens outside browser JavaScript and use a Secure, HttpOnly session cookie with an explicit SameSite policy.
17
+
18
+ Use Authorization Code with PKCE, CSRF protection, logout and revocation, destination and route allowlists, correlation IDs, ProblemDetails and rate limiting.
19
+
20
+ Keep the BFF inside the ASP.NET Core host unless a product decision requires another deployment boundary.
21
+
22
+ Treat direct browser-to-API access as a recorded exception for public or otherwise suitable APIs.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: lighthouse-web-bff
3
+ description: Apply the Lighthouse web BFF profile when a repository selects web-bff for an authenticated web application.
4
+ ---
5
+
6
+ # Lighthouse web BFF profile
7
+
8
+ Read the profile guide before changing an authenticated web adopter.
9
+
10
+ Keep OAuth tokens on the server side. Use Authorization Code with PKCE and a Secure, HttpOnly session cookie with an explicit SameSite policy.
11
+
12
+ Validate origin and CSRF state, allow only declared destinations and routes, and expose stable ProblemDetails with correlation IDs.
13
+
14
+ Implement logout, revocation, expiry and user switching as tested behavior. Keep rate limiting and observability at the BFF boundary.
15
+
16
+ Run the session, API, browser and security checks after a focused change. Treat a missing security check as a repair action.
@@ -0,0 +1,9 @@
1
+ # Adopt the Lighthouse web BFF profile
2
+
3
+ Select `web-bff` with `react-web-platform` and `dotnet-backend` for an authenticated private web application.
4
+
5
+ Set the session, identity provider, callback routes, logout route, allowed destinations and CSRF policy before exposing an authenticated screen.
6
+
7
+ Start with one vertical slice: sign in, load the session, call one API query, submit one mutation, handle expiry and sign out.
8
+
9
+ Existing authentication code remains product-owned. Map its behavior to the profile and record a narrow exception when migration would change a security boundary.
@@ -0,0 +1,16 @@
1
+ # Web BFF security contract
2
+
3
+ | Boundary | Contract | Required evidence |
4
+ | --- | --- | --- |
5
+ | Browser session | Secure, HttpOnly cookie with explicit SameSite policy | Cookie inspection and browser session test |
6
+ | Authorization | Authorization Code with PKCE | Provider configuration and callback test |
7
+ | CSRF | Origin and request-token policy for state-changing requests | Negative and positive mutation tests |
8
+ | Destinations | Explicit allowlist for outbound targets and routes | Rejected destination test |
9
+ | Proxying | Fixed routes and typed upstream calls | No arbitrary proxy path |
10
+ | Logout | Session removal and provider revocation when supported | Logout and expired-session test |
11
+ | Failure | Stable ProblemDetails and correlation ID | Error response and trace evidence |
12
+ | Abuse | Rate limiting at the boundary | Configured limit and response test |
13
+
14
+ Do not place access or refresh tokens in localStorage, sessionStorage or IndexedDB.
15
+
16
+ The BFF may be hosted inside the ASP.NET Core application host. A separate service requires a product and architecture decision with its own deployment evidence.
@@ -0,0 +1,14 @@
1
+ # Web BFF testing
2
+
3
+ Test the session boundary before the browser journey: callback, cookie flags, CSRF, allowlists, logout, expiry and user switching.
4
+
5
+ | Layer | Purpose | Evidence |
6
+ | --- | --- | --- |
7
+ | Unit | Validate policy and mapping rules | Deterministic test output |
8
+ | Integration | Exercise the BFF and upstream contract | Real host or approved provider fixture |
9
+ | Browser | Prove sign in, authenticated query, mutation and sign out | Playwright evidence |
10
+ | Security review | Confirm storage, routes and failure handling | axe is complementary; security review remains explicit |
11
+
12
+ The first vertical slice must fail closed when the session is absent, expired or assigned to another user.
13
+
14
+ Keep provider credentials out of fixtures. Use a deterministic identity or approved test provider that exercises the same cookie and callback boundaries.