@nestjs-kit/better-auth 2.0.0 → 2.1.2

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 (133) hide show
  1. package/README.md +7 -7
  2. package/dist/admin.cjs +3 -4
  3. package/dist/admin.d.cts +1 -3
  4. package/dist/admin.d.cts.map +1 -1
  5. package/dist/admin.d.mts +1 -3
  6. package/dist/admin.d.mts.map +1 -1
  7. package/dist/admin.mjs +3 -4
  8. package/dist/api-key.cjs +4 -5
  9. package/dist/api-key.d.cts +1 -3
  10. package/dist/api-key.d.cts.map +1 -1
  11. package/dist/api-key.d.mts +1 -3
  12. package/dist/api-key.d.mts.map +1 -1
  13. package/dist/api-key.mjs +4 -5
  14. package/dist/{auth-contracts-Brh_Qko9.d.cts → auth-contracts-CADGyI0O.d.mts} +3 -53
  15. package/dist/auth-contracts-CADGyI0O.d.mts.map +1 -0
  16. package/dist/{auth-contracts-Cz7C4_Ch.d.mts → auth-contracts-zvt8ysoZ.d.cts} +3 -53
  17. package/dist/auth-contracts-zvt8ysoZ.d.cts.map +1 -0
  18. package/dist/{auth-decorators-Cu_nxWnF.cjs → auth-decorators-CJKE9wlT.cjs} +8 -10
  19. package/dist/{auth-decorators-Cu_nxWnF.cjs.map → auth-decorators-CJKE9wlT.cjs.map} +1 -1
  20. package/dist/{auth-decorators-B1mFnGJ6.mjs → auth-decorators-CkNkLNpU.mjs} +8 -10
  21. package/dist/{auth-decorators-B1mFnGJ6.mjs.map → auth-decorators-CkNkLNpU.mjs.map} +1 -1
  22. package/dist/{auth-errors-C3rbTV9p.mjs → auth-errors-JjxGDVSt.mjs} +3 -5
  23. package/dist/{auth-errors-C3rbTV9p.mjs.map → auth-errors-JjxGDVSt.mjs.map} +1 -1
  24. package/dist/{auth-errors-DmiKl0L_.cjs → auth-errors-RW7hOVI-.cjs} +3 -5
  25. package/dist/{auth-errors-DmiKl0L_.cjs.map → auth-errors-RW7hOVI-.cjs.map} +1 -1
  26. package/dist/{auth-guard-h9QB_l11.mjs → auth-guard-Da92QEK5.mjs} +4 -5
  27. package/dist/{auth-guard-h9QB_l11.mjs.map → auth-guard-Da92QEK5.mjs.map} +1 -1
  28. package/dist/{auth-guard-CLyhAEEj.cjs → auth-guard-wapEh_M_.cjs} +4 -5
  29. package/dist/{auth-guard-CLyhAEEj.cjs.map → auth-guard-wapEh_M_.cjs.map} +1 -1
  30. package/dist/{auth-module-BgcY2HpA.cjs → auth-module-ab60-WJZ.cjs} +28 -47
  31. package/dist/auth-module-ab60-WJZ.cjs.map +1 -0
  32. package/dist/{auth-module-CtHx3gRU.mjs → auth-module-uy3BBWwR.mjs} +28 -47
  33. package/dist/auth-module-uy3BBWwR.mjs.map +1 -0
  34. package/dist/{auth-scope-interceptor-BjxAL1-S.cjs → auth-scope-interceptor-Bui20-Ps.cjs} +5 -7
  35. package/dist/{auth-scope-interceptor-BjxAL1-S.cjs.map → auth-scope-interceptor-Bui20-Ps.cjs.map} +1 -1
  36. package/dist/{auth-scope-interceptor-DYPn3b8M.mjs → auth-scope-interceptor-CvCQ52dV.mjs} +5 -7
  37. package/dist/{auth-scope-interceptor-DYPn3b8M.mjs.map → auth-scope-interceptor-CvCQ52dV.mjs.map} +1 -1
  38. package/dist/{bridge-protocol-c66aEkr5.mjs → bridge-protocol-CmRsff2P.mjs} +2 -3
  39. package/dist/{bridge-protocol-BDw8opAG.cjs.map → bridge-protocol-CmRsff2P.mjs.map} +1 -1
  40. package/dist/{bridge-protocol-BDw8opAG.cjs → bridge-protocol-DNFhIKdo.cjs} +2 -3
  41. package/dist/{bridge-protocol-c66aEkr5.mjs.map → bridge-protocol-DNFhIKdo.cjs.map} +1 -1
  42. package/dist/{decorate-Dt0e9K6R.mjs → decorate-bO-rBn-G.mjs} +5 -9
  43. package/dist/{decorate-Dt0e9K6R.mjs.map → decorate-bO-rBn-G.mjs.map} +1 -1
  44. package/dist/{decorate-Cr4Q7bNE.cjs → decorate-fMNf0caZ.cjs} +5 -9
  45. package/dist/{decorate-Cr4Q7bNE.cjs.map → decorate-fMNf0caZ.cjs.map} +1 -1
  46. package/dist/express.cjs +3 -4
  47. package/dist/express.d.cts +1 -3
  48. package/dist/express.d.cts.map +1 -1
  49. package/dist/express.d.mts +1 -3
  50. package/dist/express.d.mts.map +1 -1
  51. package/dist/express.mjs +3 -4
  52. package/dist/fastify.cjs +2 -3
  53. package/dist/fastify.d.cts +1 -3
  54. package/dist/fastify.d.cts.map +1 -1
  55. package/dist/fastify.d.mts +1 -3
  56. package/dist/fastify.d.mts.map +1 -1
  57. package/dist/fastify.mjs +2 -3
  58. package/dist/graphql.cjs +7 -9
  59. package/dist/graphql.cjs.map +1 -1
  60. package/dist/graphql.d.cts +1 -3
  61. package/dist/graphql.d.cts.map +1 -1
  62. package/dist/graphql.d.mts +1 -3
  63. package/dist/graphql.d.mts.map +1 -1
  64. package/dist/graphql.mjs +7 -9
  65. package/dist/graphql.mjs.map +1 -1
  66. package/dist/index.cjs +7 -7
  67. package/dist/index.d.cts +1 -1
  68. package/dist/index.d.mts +1 -1
  69. package/dist/index.mjs +7 -7
  70. package/dist/microservices.cjs +4 -6
  71. package/dist/microservices.cjs.map +1 -1
  72. package/dist/microservices.d.cts +1 -5
  73. package/dist/microservices.d.cts.map +1 -1
  74. package/dist/microservices.d.mts +1 -5
  75. package/dist/microservices.d.mts.map +1 -1
  76. package/dist/microservices.mjs +3 -5
  77. package/dist/microservices.mjs.map +1 -1
  78. package/dist/organization.cjs +3 -4
  79. package/dist/organization.d.cts +1 -3
  80. package/dist/organization.d.cts.map +1 -1
  81. package/dist/organization.d.mts +1 -3
  82. package/dist/organization.d.mts.map +1 -1
  83. package/dist/organization.mjs +3 -4
  84. package/dist/{platform-CZl7TY8j.mjs → platform-BKYVzAv1.mjs} +3 -5
  85. package/dist/{platform-CZl7TY8j.mjs.map → platform-BKYVzAv1.mjs.map} +1 -1
  86. package/dist/{platform-YICqqYv6.cjs → platform-C67dxSls.cjs} +3 -5
  87. package/dist/{platform-YICqqYv6.cjs.map → platform-C67dxSls.cjs.map} +1 -1
  88. package/dist/platform.cjs +1 -1
  89. package/dist/platform.d.cts +0 -2
  90. package/dist/platform.d.cts.map +1 -1
  91. package/dist/platform.d.mts +0 -2
  92. package/dist/platform.d.mts.map +1 -1
  93. package/dist/platform.mjs +1 -1
  94. package/dist/plugin.cjs +4 -8
  95. package/dist/plugin.cjs.map +1 -1
  96. package/dist/plugin.d.cts +0 -4
  97. package/dist/plugin.d.cts.map +1 -1
  98. package/dist/plugin.d.mts +0 -4
  99. package/dist/plugin.d.mts.map +1 -1
  100. package/dist/plugin.mjs +4 -8
  101. package/dist/plugin.mjs.map +1 -1
  102. package/dist/{principal-readings-Ied2staw.mjs → principal-readings-BuXTU0-2.mjs} +3 -4
  103. package/dist/{principal-readings-Ied2staw.mjs.map → principal-readings-BuXTU0-2.mjs.map} +1 -1
  104. package/dist/{principal-readings-Chmt6rQV.cjs → principal-readings-JLNT58k0.cjs} +3 -4
  105. package/dist/{principal-readings-Chmt6rQV.cjs.map → principal-readings-JLNT58k0.cjs.map} +1 -1
  106. package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
  107. package/dist/testing/conformance.cjs +24 -31
  108. package/dist/testing/conformance.cjs.map +1 -1
  109. package/dist/testing/conformance.d.cts +4 -14
  110. package/dist/testing/conformance.d.cts.map +1 -1
  111. package/dist/testing/conformance.d.mts +4 -14
  112. package/dist/testing/conformance.d.mts.map +1 -1
  113. package/dist/testing/conformance.mjs +23 -30
  114. package/dist/testing/conformance.mjs.map +1 -1
  115. package/dist/testing.cjs +6 -7
  116. package/dist/testing.d.cts +1 -3
  117. package/dist/testing.d.cts.map +1 -1
  118. package/dist/testing.d.mts +1 -3
  119. package/dist/testing.d.mts.map +1 -1
  120. package/dist/testing.mjs +6 -7
  121. package/dist/websockets.cjs +7 -10
  122. package/dist/websockets.cjs.map +1 -1
  123. package/dist/websockets.d.cts +1 -7
  124. package/dist/websockets.d.cts.map +1 -1
  125. package/dist/websockets.d.mts +1 -7
  126. package/dist/websockets.d.mts.map +1 -1
  127. package/dist/websockets.mjs +7 -10
  128. package/dist/websockets.mjs.map +1 -1
  129. package/package.json +25 -25
  130. package/dist/auth-contracts-Brh_Qko9.d.cts.map +0 -1
  131. package/dist/auth-contracts-Cz7C4_Ch.d.mts.map +0 -1
  132. package/dist/auth-module-BgcY2HpA.cjs.map +0 -1
  133. package/dist/auth-module-CtHx3gRU.mjs.map +0 -1
package/README.md CHANGED
@@ -29,7 +29,7 @@ It supersedes the deprecated `nestjs-slightly-better-auth`; [Migrate from `nestj
29
29
  pnpm add @nestjs-kit/better-auth better-auth
30
30
  ```
31
31
 
32
- Peer dependencies: `@nestjs/common` and `@nestjs/core` 12, `better-auth` 1.7.5 or newer (below 2), `reflect-metadata` and `rxjs`. The package requires Node.js 24.11 or newer (`engines.node` is `>=24.11.0`). Install the Nest platform adapter your application uses, `@nestjs/platform-express` or `@nestjs/platform-fastify`; the `./express` and `./fastify` entries import neither at runtime.
32
+ Peer dependencies: `@nestjs/common` and `@nestjs/core` 12, `better-auth` 1.7.7 or newer (below 2), `reflect-metadata` and `rxjs`. The package requires Node.js 24.11 or newer (`engines.node` is `>=24.11.0`). Install the Nest platform adapter your application uses, `@nestjs/platform-express` or `@nestjs/platform-fastify`; the `./express` and `./fastify` entries import neither at runtime.
33
33
 
34
34
  The `./testing` and `./testing/conformance` entries also need the optional peer `@nestjs/testing` 12; the root entry never loads it or a test runner. API keys use Better Auth's `@better-auth/api-key` plugin, which the application installs and registers itself (`pnpm add @better-auth/api-key`); the `./api-key` entry never imports it. [Compatibility](#compatibility) lists the tested versions and module systems.
35
35
 
@@ -77,13 +77,13 @@ Nest's gRPC transport uses `@grpc/grpc-js` and `@grpc/proto-loader`, Kafka uses
77
77
  | -------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------- |
78
78
  | Node.js | 24.11.0 or newer | 24.11.0 and the current LTS |
79
79
  | `@nestjs/common`, `@nestjs/core` | `^12.0.3` | 12.0.3 and the newest 12.x release, with the matching `@nestjs/platform-express` |
80
- | `better-auth` | `>=1.7.5 <2` | 1.7.5 and the newest 1.x release |
80
+ | `better-auth` | `>=1.7.7 <2` | 1.7.7 and the newest 1.x release |
81
81
  | TypeScript declarations | `nodenext`, `node16` ESM and `bundler` resolution | TypeScript 5.9, the newest 6.x and 7 in each resolution mode |
82
82
  | Bundlers | esbuild, `nest build --webpack` | esbuild 0.28 and Nest CLI 12 with webpack 5 |
83
83
 
84
84
  The packaging tests pack this package, install the tarball with pnpm into temporary applications outside the workspace and run them with the peers installed at their declared floors and at the newest versions inside the peer ranges. The newest versions are those that pnpm's default minimum release age admits, so a new release enters the matrix after that delay. Each application compiles one Nest source as ESM and as CommonJS, signs up users of a default and a named Better Auth instance, calls a guarded route of each with its session cookie, checks that neither instance accepts the other's cookie, and closes. CI runs these tests on the current Node.js LTS and on Node.js 24.11.0.
85
85
 
86
- The declared floors are the supported floors. NestJS 11 and Better Auth releases before 1.7.5 are outside the peer ranges and are not tested.
86
+ The declared floors are the supported floors. NestJS 11 and Better Auth releases before 1.7.7 are outside the peer ranges and are not tested.
87
87
 
88
88
  Module systems:
89
89
 
@@ -105,7 +105,7 @@ Toolchains:
105
105
  | esbuild ESM bundles with `--splitting`, esbuild CommonJS bundles, `nest build --webpack` | Supported and tested |
106
106
  | TypeScript `node16` CommonJS files that import NestJS 12 or Better Auth | Unsupported: their declarations are ESM only |
107
107
  | CommonJS with `--no-experimental-require-module` | Unsupported: only `./platform` and `./fastify` load |
108
- | NestJS 11, Better Auth before 1.7.5 | Unsupported: outside the peer ranges |
108
+ | NestJS 11, Better Auth before 1.7.7 | Unsupported: outside the peer ranges |
109
109
  | TypeScript before 5.9, the Nest CLI's rspack builder, webpack bundles of `node_modules`, other bundlers | Untested |
110
110
 
111
111
  The packaging tests also inspect the packed archive. It contains only `package.json`, this README, the license and the `dist` files that the export map reaches; source maps name only this package's sources, and runtime maps embed them. Each entry exports exactly the names listed in [`fixtures/public-api.json`](fixtures/public-api.json), and no emitted file has a default export or top-level `await`.
@@ -695,7 +695,7 @@ Better Auth skips its own origin checks under `NODE_ENV=test` or a truthy `TEST`
695
695
 
696
696
  **Storage outages.** An outage never turns into a 401 or 403 where the library can tell it apart: resolution and policy failures surface as 5xx. Better Auth hides some outages itself:
697
697
 
698
- - With the `customSession` plugin, Better Auth catches storage errors inside `getSession`, so an outage during the guard's session read or a policy's re-read answers 401 instead of a 5xx.
698
+ - Before Better Auth 1.7.8, the `customSession` plugin catches storage errors inside `getSession`, so an outage during the guard's session read or a policy's re-read answers 401 instead of a 5xx. Better Auth 1.7.8 and later propagate the error, and the request answers 5xx.
699
699
  - `verifyApiKey` reports storage failures as `INVALID_API_KEY`. `apiKeyPrincipal()` treats an `INVALID_API_KEY` that took longer than `outageProbe.slowMs` (default 500 ms) as an outage, and otherwise runs a probe (a read and a zero-row write on the key table, at most once per second per instance) before answering 401. Failures confined to the key's own row that return faster than `slowMs`, and keys stored only in secondary storage, still answer 401; set `slowMs` below your pool's lock and statement timeouts and above the cost of a custom key hasher. Better Auth logs `Failed to validate API key` at ERROR for every rejected key.
700
700
  - Public routes perform no principal I/O and keep working during an outage.
701
701
 
@@ -757,7 +757,7 @@ export class ViewerResolver {
757
757
  export class AppModule {}
758
758
  ```
759
759
 
760
- For Mercurius, use `MercuriusDriver`, `fastifyPlatform()` from `@nestjs-kit/better-auth/fastify` and `mercuriusTransport()`. `mercuriusSubscriptionContext()` returns a Mercurius `subscription.context` function that keeps the upgrade request and its original browser headers with every socket operation; the socket tests cover Mercurius with and without it. A custom GraphQL `context` must be a function that returns a fresh object for every operation and every graphql-ws connection; a function that returns a cached object is a configuration error that the transports cannot always detect. An HTTP operation whose context carries an answered request fails closed with `AUTH_MISCONFIGURED` (`GRAPHQL_CONTEXT_STALE_REQUEST`). The Apollo transport classifies an operation's graphql-ws socket once, when the operation starts. When that socket is not open, the operation reads no credential of its connection (connection parameters, cookies, `subscriptionCredentials`, upgrade-request headers or the upgrade-request query string) and runs anonymously: required operations answer the unauthenticated denial, and optional and public operations run without a principal. Its request URL, which principal sources receive as `PrincipalRequest.request` and policies as the context's `request`, is the upgrade URL without its query string or fragment, so a source that authenticates a URL query token finds none; the origin check still reads the connection's handshake, which grants no credential. The transport logs nothing at ERROR for it, because a client that closes its connection while graphql-ws prepares an operation leaves the same socket state. An operation whose socket closes after the operation started keeps its connection's credentials. A cached context of a closed connection therefore authenticates nothing. While the earlier request or connection is still open, its context is indistinguishable from the current operation's own, and the operation authenticates with the earlier caller's credentials, so the fresh-object rule is mandatory. Mercurius socket operations take their context from `subscription.context`, which Mercurius builds for every connection, so the GraphQL `context` option does not carry one connection's socket into another. For Apollo HTTP operations, it keeps the platform request at `context.req`: the Express request, or the Fastify request that the context function receives as its first argument, not that request's `raw` `IncomingMessage`. For Apollo socket operations, it either leaves `context.req` unset, so Nest assigns the graphql-ws context, or keeps graphql-ws's `extra` at `context.extra` and the connection parameters at `context.connectionParams`; the upgrade request alone is not recognized. An operation whose context carries neither fails closed with `AUTH_MISCONFIGURED` (`GRAPHQL_CONTEXT_UNRECOGNIZED`). Startup fails with `GRAPHQL_STATIC_CONTEXT` for a static context object and with `GRAPHQL_DRIVER_MISMATCH` when the transport does not match the configured driver.
760
+ For Mercurius, use `MercuriusDriver`, `fastifyPlatform()` from `@nestjs-kit/better-auth/fastify` and `mercuriusTransport()`. `mercuriusSubscriptionContext()` returns a Mercurius `subscription.context` function that keeps the upgrade request and its original browser headers with every socket operation; the socket tests cover Mercurius with and without it. A custom GraphQL `context` must be a function that returns a fresh object for every operation and every graphql-ws connection; a function that returns a cached object is a configuration error that the transports cannot always detect. `@nestjs/apollo` 14.0.3 and later copy a returned object that leaves `context.req` unset and assign the operation's request to the copy, but share a cached object that sets `context.req`; 14.0.2 assigns the first operation's request to the returned object and shares it. An HTTP operation whose context carries an answered request fails closed with `AUTH_MISCONFIGURED` (`GRAPHQL_CONTEXT_STALE_REQUEST`). The Apollo transport classifies an operation's graphql-ws socket once, when the operation starts. When that socket is not open, the operation reads no credential of its connection (connection parameters, cookies, `subscriptionCredentials`, upgrade-request headers or the upgrade-request query string) and runs anonymously: required operations answer the unauthenticated denial, and optional and public operations run without a principal. Its request URL, which principal sources receive as `PrincipalRequest.request` and policies as the context's `request`, is the upgrade URL without its query string or fragment, so a source that authenticates a URL query token finds none; the origin check still reads the connection's handshake, which grants no credential. The transport logs nothing at ERROR for it, because a client that closes its connection while graphql-ws prepares an operation leaves the same socket state. An operation whose socket closes after the operation started keeps its connection's credentials. A cached context of a closed connection therefore authenticates nothing. While the earlier request or connection is still open, its context is indistinguishable from the current operation's own, and the operation authenticates with the earlier caller's credentials, so the fresh-object rule is mandatory. Mercurius socket operations take their context from `subscription.context`, which Mercurius builds for every connection, so the GraphQL `context` option does not carry one connection's socket into another. For Apollo HTTP operations, it keeps the platform request at `context.req`: the Express request, or the Fastify request that the context function receives as its first argument, not that request's `raw` `IncomingMessage`. For Apollo socket operations, it either leaves `context.req` unset, so Nest assigns the graphql-ws context, or keeps graphql-ws's `extra` at `context.extra` and the connection parameters at `context.connectionParams`; the upgrade request alone is not recognized. An operation whose context carries neither fails closed with `AUTH_MISCONFIGURED` (`GRAPHQL_CONTEXT_UNRECOGNIZED`). Startup fails with `GRAPHQL_STATIC_CONTEXT` for a static context object and with `GRAPHQL_DRIVER_MISMATCH` when the transport does not match the configured driver.
761
761
 
762
762
  ### Operations and fields
763
763
 
@@ -973,7 +973,7 @@ Better Auth treats a process with `NODE_ENV=test` or a truthy `TEST` variable (V
973
973
 
974
974
  The kits verify extension units against the invariants of the [reviewed specification](docs/design/design-v7.md) (§4 and §14.1). Each kit returns `ConformanceCase[]` (`{ id, title, skip?, run() }`) that `runConformance(cases, { describe, it })` registers with Vitest, Jest or `node:test`. Assertions use `node:assert/strict`; the kits import no test runner.
975
975
 
976
- Applicability comes from the unit, not from the options a harness passes. A platform that declares `capabilities.http2` needs the `http2` option. The platform kit's trusted-hop rows need `trustOneProxy`, which trusts one forwarding hop on a created application (Express `app.set("trust proxy", 1)`), or `createTrustingHttpAdapter` (and `http2.createTrustingHttpAdapter` for their HTTP/2 rows), which returns a fresh adapter that already trusts it, for platforms that fix proxy trust at construction (Fastify `new FastifyAdapter({ trustProxy: "loopback" })`; the kit's requests come from loopback). Its microservice rows of `H-no-adapter` need `microservice`, which returns the transport options to boot with (for example `{ transport: Transport.TCP, options: { host: "127.0.0.1", port: 0 } }`); the kit does not load the optional `@nestjs/microservices` peer itself. The production-mode rows set `process.env.NODE_ENV` to `production` while they run and restore it afterwards, so run the kit's cases sequentially. A transport with a lineage needs `invokeTwice`, one that nests handlers (`defaultAccessFor`) needs `invokeGraph`, and one that claims the kit's federation reference resolver needs `invokeEntities`. A transport whose browser leg is a connection's handshake, shared by the connection's messages (the WebSocket transports), runs the `T-ws-origin-*` cases instead of the `T-csrf-*` cases and needs `invokeConnection`, plus `authenticateConnection` when the app provides `WS_CONNECTION_AUTH`. Such a case fails when the helper is missing, and `T-selection` fails `expectBrowserLeg: false` for a transport that describes a browser leg. A transport that nests handlers needs `graphqlContexts` to list `'static'` and `'cached'` for `T-stale-context`. Its cached-context row closes the first caller's request or connection before a later caller runs. After a completed request, it expects the later caller's own principal or `GRAPHQL_CONTEXT_STALE_REQUEST`. Where the browser leg is a connection's handshake, it runs through `invokeConnection`, which resolves only after the server has observed the connection's close, and expects the later caller's own principal, an anonymous answer or the unauthenticated denial, never the first caller's principal, with nothing logged at ERROR; the custom-context rows of `T-subscription-origin` run for the listed `'fresh'` and `'plain-request'` contexts. The `T-subscription-*` cases run when `invocationShapes` includes `'subscriptions'` and need `invokeConnection` with its `connectionParams` option. `T-inherited-handler` runs with `invokeInherited`; harnesses of transports that address a handler by a name one inherited method shares across subclasses (an RPC pattern, a GraphQL root field) omit it, and the case is skipped with the reason. A case whose optional capability is absent is skipped with the reason. The kits read these members from unit objects before running; for classes and `defineExtension()` definitions they boot once and read the resolved unit. A case known to be inapplicable registers with its reason in the test name. A case that finds out at run time resolves with `{ skipped: reason }`, which `runConformance` reports through the runner's `context.skip(reason)` (Vitest, `node:test`; Jest has no runtime skip, so the test passes).
976
+ Applicability comes from the unit, not from the options a harness passes. A platform that declares `capabilities.http2` needs the `http2` option. The platform kit's trusted-hop rows need `trustOneProxy`, which trusts one forwarding hop on a created application (Express `app.set("trust proxy", 1)`), or `createTrustingHttpAdapter` (and `http2.createTrustingHttpAdapter` for their HTTP/2 rows), which returns a fresh adapter that already trusts it, for platforms that fix proxy trust at construction (Fastify `new FastifyAdapter({ trustProxy: "loopback" })`; the kit's requests come from loopback). Its microservice rows of `H-no-adapter` need `microservice`, which returns the transport options to boot with (for example `{ transport: Transport.TCP, options: { host: "127.0.0.1", port: 0 } }`); the kit does not load the optional `@nestjs/microservices` peer itself. The production-mode rows set `process.env.NODE_ENV` to `production` while they run and restore it afterwards, so run the kit's cases sequentially. A transport with a lineage needs `invokeTwice`, one that nests handlers (`defaultAccessFor`) needs `invokeGraph`, and one that claims the kit's federation reference resolver needs `invokeEntities`. A transport whose browser leg is a connection's handshake, shared by the connection's messages (the WebSocket transports), runs the `T-ws-origin-*` cases instead of the `T-csrf-*` cases and needs `invokeConnection`, plus `authenticateConnection` when the app provides `WS_CONNECTION_AUTH`. Such a case fails when the helper is missing, and `T-selection` fails `expectBrowserLeg: false` for a transport that describes a browser leg. A transport that nests handlers needs `graphqlContexts` to list `'static'` and `'cached'` for `T-stale-context`. Its cached-context row closes the first caller's request or connection before a later caller runs. The harness's `'cached'` context keeps the first call's request at `context.req` (for Apollo socket operations, the graphql-ws context that Nest would assign), because `@nestjs/apollo` 14.0.3 and later copy a returned object without `req` for every operation, so a cached object without it carries no closed connection. After a completed request, it expects the later caller's own principal or `GRAPHQL_CONTEXT_STALE_REQUEST`. Where the browser leg is a connection's handshake, it runs through `invokeConnection`, which resolves only after the server has observed the connection's close, and expects an anonymous answer or the unauthenticated denial, never the first caller's principal, with nothing logged at ERROR. A later caller there that reads its own principal shows that the driver built a new context for its connection instead of serving the cached one (Mercurius socket operations, or an Apollo `'cached'` context without `req` under `@nestjs/apollo` 14.0.3 and later), so no closed connection's context reached the transport and the case resolves skipped with that reason; the custom-context rows of `T-subscription-origin` run for the listed `'fresh'` and `'plain-request'` contexts. The `T-subscription-*` cases run when `invocationShapes` includes `'subscriptions'` and need `invokeConnection` with its `connectionParams` option. `T-inherited-handler` runs with `invokeInherited`; harnesses of transports that address a handler by a name one inherited method shares across subclasses (an RPC pattern, a GraphQL root field) omit it, and the case is skipped with the reason. A case whose optional capability is absent is skipped with the reason. The kits read these members from unit objects before running; for classes and `defineExtension()` definitions they boot once and read the resolved unit. A case known to be inapplicable registers with its reason in the test name. A case that finds out at run time resolves with `{ skipped: reason }`, which `runConformance` reports through the runner's `context.skip(reason)` (Vitest, `node:test`; Jest has no runtime skip, so the test passes).
977
977
 
978
978
  ```ts
979
979
  import { ExpressAdapter } from "@nestjs/platform-express";
package/dist/admin.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_auth_errors = require("./auth-errors-DmiKl0L_.cjs");
3
- const require_auth_decorators = require("./auth-decorators-Cu_nxWnF.cjs");
2
+ const require_auth_decorators = require("./auth-decorators-CJKE9wlT.cjs");
3
+ const require_auth_errors = require("./auth-errors-RW7hOVI-.cjs");
4
4
  let better_auth_api = require("better-auth/api");
5
- //#region src/admin.ts
5
+ // src/admin.ts
6
6
  const adminPermissionPolicy = {
7
7
  id: "better-auth:admin/permission",
8
8
  requires: {
@@ -80,7 +80,6 @@ function permission(permissions, options = {}) {
80
80
  function RequirePermission(permissions, options) {
81
81
  return require_auth_decorators.Require(permission(permissions, options));
82
82
  }
83
- //#endregion
84
83
  exports.RequirePermission = RequirePermission;
85
84
  exports.adminPermissionPolicy = adminPermissionPolicy;
86
85
  exports.permission = permission;
package/dist/admin.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { Ct as AuthPrincipal, Nt as PrincipalKind, f as AuthorizationPolicy, ot as Requirement, vt as AdminPermissions } from "./auth-contracts-Brh_Qko9.cjs";
2
- //#region src/admin.d.ts
1
+ import { Ct as AuthPrincipal, Nt as PrincipalKind, f as AuthorizationPolicy, ot as Requirement, vt as AdminPermissions } from "./auth-contracts-zvt8ysoZ.cjs";
3
2
  export interface PermissionOptions {
4
3
  principals?: readonly PrincipalKind[];
5
4
  }
@@ -9,6 +8,5 @@ export interface AdminPermissionParams {
9
8
  export declare const adminPermissionPolicy: AuthorizationPolicy<AdminPermissionParams, AuthPrincipal>;
10
9
  export declare function permission<N extends string = "default">(permissions: AdminPermissions<N>, options?: PermissionOptions): Requirement<AdminPermissionParams>;
11
10
  export declare function RequirePermission<N extends string = "default">(permissions: AdminPermissions<N>, options?: PermissionOptions): ClassDecorator & MethodDecorator;
12
- //#endregion
13
11
  export type { AdminPermissions };
14
12
  //# sourceMappingURL=admin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.cts","names":[],"sources":["../src/admin.ts"],"mappings":";;iBAUiB;EACf,sBAAsB;;iBAEP;WACN,aAAa;;qBAWX,uBAAuB,oBAClC,uBACA;wBA+Fc,WAAW,8BACzB,aAAa,iBAAiB,IAC9B,UAAS,oBACR,YAAY;wBAOC,kBAAkB,8BAChC,aAAa,iBAAiB,IAC9B,UAAU,oBACT,iBAAiB"}
1
+ {"version":3,"file":"admin.d.cts","names":[],"sources":["../src/admin.ts"],"mappings":";iBAUiB;EACf,sBAAsB;;iBAEP;WACN,aAAa;;qBAWX,uBAAuB,oBAClC,uBACA;wBA+Fc,WAAW,8BACzB,aAAa,iBAAiB,IAC9B,UAAS,oBACR,YAAY;wBAOC,kBAAkB,8BAChC,aAAa,iBAAiB,IAC9B,UAAU,oBACT,iBAAiB"}
package/dist/admin.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import { Ct as AuthPrincipal, Nt as PrincipalKind, f as AuthorizationPolicy, ot as Requirement, vt as AdminPermissions } from "./auth-contracts-Cz7C4_Ch.mjs";
2
- //#region src/admin.d.ts
1
+ import { Ct as AuthPrincipal, Nt as PrincipalKind, f as AuthorizationPolicy, ot as Requirement, vt as AdminPermissions } from "./auth-contracts-CADGyI0O.mjs";
3
2
  export interface PermissionOptions {
4
3
  principals?: readonly PrincipalKind[];
5
4
  }
@@ -9,6 +8,5 @@ export interface AdminPermissionParams {
9
8
  export declare const adminPermissionPolicy: AuthorizationPolicy<AdminPermissionParams, AuthPrincipal>;
10
9
  export declare function permission<N extends string = "default">(permissions: AdminPermissions<N>, options?: PermissionOptions): Requirement<AdminPermissionParams>;
11
10
  export declare function RequirePermission<N extends string = "default">(permissions: AdminPermissions<N>, options?: PermissionOptions): ClassDecorator & MethodDecorator;
12
- //#endregion
13
11
  export type { AdminPermissions };
14
12
  //# sourceMappingURL=admin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin.ts"],"mappings":";;iBAUiB;EACf,sBAAsB;;iBAEP;WACN,aAAa;;qBAWX,uBAAuB,oBAClC,uBACA;wBA+Fc,WAAW,8BACzB,aAAa,iBAAiB,IAC9B,UAAS,oBACR,YAAY;wBAOC,kBAAkB,8BAChC,aAAa,iBAAiB,IAC9B,UAAU,oBACT,iBAAiB"}
1
+ {"version":3,"file":"admin.d.mts","names":[],"sources":["../src/admin.ts"],"mappings":";iBAUiB;EACf,sBAAsB;;iBAEP;WACN,aAAa;;qBAWX,uBAAuB,oBAClC,uBACA;wBA+Fc,WAAW,8BACzB,aAAa,iBAAiB,IAC9B,UAAS,oBACR,YAAY;wBAOC,kBAAkB,8BAChC,aAAa,iBAAiB,IAC9B,UAAU,oBACT,iBAAiB"}
package/dist/admin.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { n as BetterAuthConfigurationError } from "./auth-errors-C3rbTV9p.mjs";
2
- import { u as Require } from "./auth-decorators-B1mFnGJ6.mjs";
1
+ import { u as Require } from "./auth-decorators-CkNkLNpU.mjs";
2
+ import { n as BetterAuthConfigurationError } from "./auth-errors-JjxGDVSt.mjs";
3
3
  import { isAPIError } from "better-auth/api";
4
- //#region src/admin.ts
4
+ // src/admin.ts
5
5
  const adminPermissionPolicy = {
6
6
  id: "better-auth:admin/permission",
7
7
  requires: {
@@ -79,7 +79,6 @@ function permission(permissions, options = {}) {
79
79
  function RequirePermission(permissions, options) {
80
80
  return Require(permission(permissions, options));
81
81
  }
82
- //#endregion
83
82
  export { RequirePermission, adminPermissionPolicy, permission };
84
83
 
85
84
  //# sourceMappingURL=admin.mjs.map
package/dist/api-key.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_auth_errors = require("./auth-errors-DmiKl0L_.cjs");
3
- const require_auth_scope_interceptor = require("./auth-scope-interceptor-BjxAL1-S.cjs");
4
- const require_auth_decorators = require("./auth-decorators-Cu_nxWnF.cjs");
2
+ const require_auth_decorators = require("./auth-decorators-CJKE9wlT.cjs");
3
+ const require_auth_errors = require("./auth-errors-RW7hOVI-.cjs");
4
+ const require_auth_scope_interceptor = require("./auth-scope-interceptor-Bui20-Ps.cjs");
5
5
  let better_auth_plugins_access = require("better-auth/plugins/access");
6
- //#region src/api-key.ts
6
+ // src/api-key.ts
7
7
  const API_KEY_PRINCIPAL_KIND = "api-key";
8
8
  function apiKeyPrincipal(options = {}) {
9
9
  const header = options.header ?? "x-api-key";
@@ -155,7 +155,6 @@ function apiKeyPermission(permissions) {
155
155
  function RequireApiKeyPermission(permissions) {
156
156
  return require_auth_decorators.Require(apiKeyPermission(permissions));
157
157
  }
158
- //#endregion
159
158
  exports.API_KEY_PRINCIPAL_KIND = API_KEY_PRINCIPAL_KIND;
160
159
  exports.RequireApiKeyPermission = RequireApiKeyPermission;
161
160
  exports.apiKeyPermission = apiKeyPermission;
@@ -1,5 +1,4 @@
1
- import { $ as PrincipalDelegation, it as PrincipalSource, o as AuthPrincipalBase, ot as Requirement } from "./auth-contracts-Brh_Qko9.cjs";
2
- //#region src/api-key.d.ts
1
+ import { $ as PrincipalDelegation, it as PrincipalSource, o as AuthPrincipalBase, ot as Requirement } from "./auth-contracts-zvt8ysoZ.cjs";
3
2
  export declare const API_KEY_PRINCIPAL_KIND: "api-key";
4
3
  export interface ApiKeyPrincipal extends AuthPrincipalBase {
5
4
  readonly kind: "api-key";
@@ -38,5 +37,4 @@ export interface ApiKeyPrincipalOptions {
38
37
  export declare function apiKeyPrincipal(options?: ApiKeyPrincipalOptions): PrincipalSource<ApiKeyPrincipal>;
39
38
  export declare function apiKeyPermission(permissions: Record<string, string[]>): Requirement<Record<string, string[]>>;
40
39
  export declare function RequireApiKeyPermission(permissions: Record<string, string[]>): ClassDecorator & MethodDecorator;
41
- //#endregion
42
40
  //# sourceMappingURL=api-key.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key.d.cts","names":[],"sources":["../src/api-key.ts"],"mappings":";;qBAkBa;iBACI,wBAAwB;WAC9B;WACA;WACA;WACA;WACA;WACA;WACA,aAAa,SAAS;WACtB,YAAY;;;YAIX;IACR,WAAW;;;iBAGE;EACf;EACA;EACA,yCAGM;aAAgB;;;;;;;;;;EAStB;aAAmC;;EACnC;;wBAmBc,gBACd,UAAS,yBACR,gBAAgB;wBAwMH,iBACd,aAAa,2BACZ,YAAY;wBAGC,wBACd,aAAa,2BACZ,iBAAiB"}
1
+ {"version":3,"file":"api-key.d.cts","names":[],"sources":["../src/api-key.ts"],"mappings":";qBAkBa;iBACI,wBAAwB;WAC9B;WACA;WACA;WACA;WACA;WACA;WACA,aAAa,SAAS;WACtB,YAAY;;;YAIX;IACR,WAAW;;;iBAGE;EACf;EACA;EACA,yCAGM;aAAgB;;;;;;;;;;EAStB;aAAmC;;EACnC;;wBAmBc,gBACd,UAAS,yBACR,gBAAgB;wBAwMH,iBACd,aAAa,2BACZ,YAAY;wBAGC,wBACd,aAAa,2BACZ,iBAAiB"}
@@ -1,5 +1,4 @@
1
- import { $ as PrincipalDelegation, it as PrincipalSource, o as AuthPrincipalBase, ot as Requirement } from "./auth-contracts-Cz7C4_Ch.mjs";
2
- //#region src/api-key.d.ts
1
+ import { $ as PrincipalDelegation, it as PrincipalSource, o as AuthPrincipalBase, ot as Requirement } from "./auth-contracts-CADGyI0O.mjs";
3
2
  export declare const API_KEY_PRINCIPAL_KIND: "api-key";
4
3
  export interface ApiKeyPrincipal extends AuthPrincipalBase {
5
4
  readonly kind: "api-key";
@@ -38,5 +37,4 @@ export interface ApiKeyPrincipalOptions {
38
37
  export declare function apiKeyPrincipal(options?: ApiKeyPrincipalOptions): PrincipalSource<ApiKeyPrincipal>;
39
38
  export declare function apiKeyPermission(permissions: Record<string, string[]>): Requirement<Record<string, string[]>>;
40
39
  export declare function RequireApiKeyPermission(permissions: Record<string, string[]>): ClassDecorator & MethodDecorator;
41
- //#endregion
42
40
  //# sourceMappingURL=api-key.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-key.d.mts","names":[],"sources":["../src/api-key.ts"],"mappings":";;qBAkBa;iBACI,wBAAwB;WAC9B;WACA;WACA;WACA;WACA;WACA;WACA,aAAa,SAAS;WACtB,YAAY;;;YAIX;IACR,WAAW;;;iBAGE;EACf;EACA;EACA,yCAGM;aAAgB;;;;;;;;;;EAStB;aAAmC;;EACnC;;wBAmBc,gBACd,UAAS,yBACR,gBAAgB;wBAwMH,iBACd,aAAa,2BACZ,YAAY;wBAGC,wBACd,aAAa,2BACZ,iBAAiB"}
1
+ {"version":3,"file":"api-key.d.mts","names":[],"sources":["../src/api-key.ts"],"mappings":";qBAkBa;iBACI,wBAAwB;WAC9B;WACA;WACA;WACA;WACA;WACA;WACA,aAAa,SAAS;WACtB,YAAY;;;YAIX;IACR,WAAW;;;iBAGE;EACf;EACA;EACA,yCAGM;aAAgB;;;;;;;;;;EAStB;aAAmC;;EACnC;;wBAmBc,gBACd,UAAS,yBACR,gBAAgB;wBAwMH,iBACd,aAAa,2BACZ,YAAY;wBAGC,wBACd,aAAa,2BACZ,iBAAiB"}
package/dist/api-key.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { n as BetterAuthConfigurationError, r as BetterAuthInfrastructureError, t as AuthFailures, u as normalizeThrown } from "./auth-errors-C3rbTV9p.mjs";
2
- import { a as absent, l as rejected, o as authenticated } from "./auth-scope-interceptor-DYPn3b8M.mjs";
3
- import { u as Require } from "./auth-decorators-B1mFnGJ6.mjs";
1
+ import { u as Require } from "./auth-decorators-CkNkLNpU.mjs";
2
+ import { n as BetterAuthConfigurationError, r as BetterAuthInfrastructureError, t as AuthFailures, u as normalizeThrown } from "./auth-errors-JjxGDVSt.mjs";
3
+ import { a as absent, l as rejected, o as authenticated } from "./auth-scope-interceptor-CvCQ52dV.mjs";
4
4
  import { role } from "better-auth/plugins/access";
5
- //#region src/api-key.ts
5
+ // src/api-key.ts
6
6
  const API_KEY_PRINCIPAL_KIND = "api-key";
7
7
  function apiKeyPrincipal(options = {}) {
8
8
  const header = options.header ?? "x-api-key";
@@ -154,7 +154,6 @@ function apiKeyPermission(permissions) {
154
154
  function RequireApiKeyPermission(permissions) {
155
155
  return Require(apiKeyPermission(permissions));
156
156
  }
157
- //#endregion
158
157
  export { API_KEY_PRINCIPAL_KIND, RequireApiKeyPermission, apiKeyPermission, apiKeyPrincipal };
159
158
 
160
159
  //# sourceMappingURL=api-key.mjs.map
@@ -1,9 +1,8 @@
1
- import { IncomingHttpHeaders, IncomingMessage } from "node:http";
2
1
  import { CallHandler, CanActivate, DynamicModule, ExecutionContext, InjectionToken, IntrinsicException, Logger, LoggerService, ModuleMetadata, NestInterceptor, OptionalFactoryDependency, Provider, Type } from "@nestjs/common";
3
2
  import { AbstractHttpAdapter, DiscoveryService, HttpAdapterHost, ModuleRef, Reflector } from "@nestjs/core";
4
- import { HookEndpointContext } from "better-auth";
5
3
  import { Observable } from "rxjs";
6
- //#region src/auth-errors.d.ts
4
+ import { IncomingHttpHeaders, IncomingMessage } from "node:http";
5
+ import { HookEndpointContext } from "better-auth";
7
6
  type AuthErrorCode = "UNAUTHENTICATED" | "FORBIDDEN" | "RATE_LIMITED";
8
7
  /** A transport-neutral denial. Only transports make it throwable. */
9
8
  interface AuthFailure {
@@ -83,8 +82,6 @@ declare class BetterAuthInfrastructureError extends Error {
83
82
  });
84
83
  }
85
84
  declare function getRawCause(error: BetterAuthInfrastructureError): unknown;
86
- //#endregion
87
- //#region src/auth-tokens.d.ts
88
85
  declare function getBetterAuthInstanceToken(alias?: string): string;
89
86
  declare function getBetterAuthOptionsToken(alias?: string): string;
90
87
  declare function getBetterAuthServiceToken(alias?: string): string;
@@ -102,8 +99,6 @@ declare const SKIP_ORIGIN_CHECK_METADATA: unique symbol;
102
99
  declare const AUTH_ENHANCER: unique symbol;
103
100
  /** Connection-time WebSocket authentication, provided by the socket.io and ws transport definitions. */
104
101
  declare const WS_CONNECTION_AUTH: unique symbol;
105
- //#endregion
106
- //#region src/auth-module.d.ts
107
102
  declare class BetterAuthModule {
108
103
  static forRoot<A extends AuthLike = RegisteredAuth>(options: BetterAuthModuleOptions<A> & BetterAuthAppOptions & {
109
104
  name?: "default";
@@ -118,8 +113,6 @@ declare class BetterAuthModule {
118
113
  name: string;
119
114
  } & NoAppOptions): DynamicModule;
120
115
  }
121
- //#endregion
122
- //#region src/bridge-protocol.d.ts
123
116
  declare const EXTENSION_DEFINITION: unique symbol;
124
117
  declare const UPGRADE_REQUEST: unique symbol;
125
118
  interface BridgeHandle {
@@ -197,8 +190,6 @@ interface CompiledHook {
197
190
  matches(ctx: HookEndpointContext, scope: ScopeView | undefined): boolean;
198
191
  run(ctx: HookEndpointContext): Promise<unknown>;
199
192
  }
200
- //#endregion
201
- //#region src/request-scope.d.ts
202
193
  interface ScopeState {
203
194
  readonly view: ScopeView;
204
195
  readonly call?: TransportCall;
@@ -245,8 +236,6 @@ declare class RequestScope {
245
236
  lineage?: InvocationLineage;
246
237
  }): boolean;
247
238
  }
248
- //#endregion
249
- //#region src/origin-check.d.ts
250
239
  /** Bounded, per-application diagnostics; the next denial rolls the window without timers. */
251
240
  declare class OriginDiagnostics {
252
241
  #private;
@@ -277,8 +266,6 @@ declare class OriginCheck {
277
266
  private calculationFailures;
278
267
  private verdict;
279
268
  }
280
- //#endregion
281
- //#region src/instance-registry.d.ts
282
269
  interface InstanceEntry {
283
270
  readonly name: string;
284
271
  readonly instance: AuthLike;
@@ -323,8 +310,6 @@ declare class InstanceRegistry implements InstanceLookup {
323
310
  initialize(issues: BetterAuthConfigurationError[]): Promise<void>;
324
311
  reset(): void;
325
312
  }
326
- //#endregion
327
- //#region src/mount-coordinator.d.ts
328
313
  declare class MountCoordinator {
329
314
  #private;
330
315
  readonly host: HttpAdapterHost;
@@ -345,8 +330,6 @@ declare class MountCoordinator {
345
330
  mount(): Promise<void>;
346
331
  reset(): void;
347
332
  }
348
- //#endregion
349
- //#region src/principal-readings.d.ts
350
333
  interface ReadingInput {
351
334
  readonly args: readonly unknown[];
352
335
  readonly call?: TransportCall;
@@ -376,16 +359,12 @@ declare class PrincipalReadings {
376
359
  deliver(error: BetterAuthConfigurationError, input?: ReadingInput, instance?: string): BetterAuthConfigurationError | RepeatedReaderError;
377
360
  stamp(args: readonly unknown[], instance: string, result: PrincipalResult): void;
378
361
  }
379
- //#endregion
380
- //#region src/policy-resolver.d.ts
381
362
  declare class PolicyResolver {
382
363
  private readonly moduleRef;
383
364
  private readonly cache;
384
365
  constructor(moduleRef: ModuleRef);
385
366
  resolve<P>(reference: PolicyRef<P>): AuthorizationPolicy<P, any>;
386
367
  }
387
- //#endregion
388
- //#region src/transport-registry.d.ts
389
368
  declare class TransportRegistry {
390
369
  private transports;
391
370
  private readonly owners;
@@ -399,8 +378,6 @@ declare class TransportRegistry {
399
378
  idOf(call: TransportCall): string;
400
379
  describe(context: ExecutionContext, transport?: AuthTransport): TransportCall;
401
380
  }
402
- //#endregion
403
- //#region src/route-planner.d.ts
404
381
  declare class RoutePlanner {
405
382
  private readonly instances;
406
383
  private readonly policies;
@@ -412,8 +389,6 @@ declare class RoutePlanner {
412
389
  forContext(context: ExecutionContext): RoutePlan;
413
390
  plan(target: Type, method: string): RoutePlan;
414
391
  }
415
- //#endregion
416
- //#region src/auth-service.d.ts
417
392
  declare class BetterAuthService<A extends AuthLike = RegisteredAuth> {
418
393
  #private;
419
394
  private readonly registry;
@@ -440,8 +415,6 @@ declare class BetterAuthService<A extends AuthLike = RegisteredAuth> {
440
415
  withoutCookies<T>(fn: () => Promise<T>): Promise<T>;
441
416
  runOutsideScope<T>(fn: () => Promise<T>): Promise<T>;
442
417
  }
443
- //#endregion
444
- //#region src/authorization-evaluator.d.ts
445
418
  declare const allow: () => AuthorizationDecision;
446
419
  declare const deny: (input: {
447
420
  reason: string;
@@ -459,8 +432,6 @@ declare class AuthorizationEvaluator {
459
432
  constructor(policies: PolicyResolver, invoker: PolicyInvoker, resolver: PrincipalResolver, scope: RequestScope);
460
433
  evaluate(plan: RoutePlan, principal: AuthPrincipal, call: TransportCall, entry: InstanceEntry, execution: ExecutionContext, transport: string): Promise<AuthorizationDecision>;
461
434
  }
462
- //#endregion
463
- //#region src/auth-guard.d.ts
464
435
  declare class BetterAuthGuard implements CanActivate {
465
436
  private readonly core;
466
437
  static readonly [AUTH_ENHANCER] = "guard";
@@ -479,8 +450,6 @@ declare class GuardCore implements CanActivate {
479
450
  constructor(instances: InstanceLookup, planner: RoutePlanner, transports: TransportRegistry, resolver: PrincipalResolver, evaluator: AuthorizationEvaluator, scope: RequestScope, readings: PrincipalReadings);
480
451
  canActivate(context: ExecutionContext): Promise<boolean>;
481
452
  }
482
- //#endregion
483
- //#region src/auth-scope-interceptor.d.ts
484
453
  declare class BetterAuthScopeInterceptor implements NestInterceptor {
485
454
  private readonly core;
486
455
  static readonly [AUTH_ENHANCER] = "scope";
@@ -497,13 +466,9 @@ declare class ScopeCore implements NestInterceptor {
497
466
  constructor(instances: InstanceLookup, planner: RoutePlanner, transports: TransportRegistry, scope: RequestScope, readings: PrincipalReadings);
498
467
  intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
499
468
  }
500
- //#endregion
501
- //#region src/auth-module-definition.d.ts
502
469
  declare function defineExtension<T>(definition: Omit<ExtensionDefinition<T>, typeof EXTENSION_DEFINITION>): ExtensionDefinition<T>;
503
470
  declare function defineHttpPlatform<P extends HttpPlatform>(platform: P): P;
504
471
  declare function defineTransport<T extends AuthTransport>(transport: T): T;
505
- //#endregion
506
- //#region src/auth-decorators.d.ts
507
472
  declare const Public: () => import("@nestjs/common").CustomDecorator<typeof ACCESS_METADATA>;
508
473
  declare const OptionalAuth: () => import("@nestjs/common").CustomDecorator<typeof ACCESS_METADATA>;
509
474
  declare const RequireAuth: (options?: {
@@ -532,8 +497,6 @@ declare const BeforeAuth: <const P extends EndpointPath | (string & {})>(match?:
532
497
  declare const AfterAuth: <const P extends EndpointPath | (string & {})>(match?: P | readonly P[] | HookPredicate, options?: HookOptions) => HookMethodDecorator<P>;
533
498
  declare const BeforeDatabase: <E extends DatabaseHookTarget>(target: E, options?: DbHookOptions) => DbHookMethodDecorator<E, "before">;
534
499
  declare const AfterDatabase: <E extends DatabaseHookTarget>(target: E, options?: DbHookOptions) => DbHookMethodDecorator<E, "after">;
535
- //#endregion
536
- //#region src/session-principal.d.ts
537
500
  declare const SESSION_PRINCIPAL_KIND: "session";
538
501
  declare const CurrentSession: () => ParameterDecorator;
539
502
  declare const CurrentUser: () => ParameterDecorator;
@@ -546,27 +509,17 @@ declare const freshSession: (options?: {
546
509
  declare const RequireFreshSession: (options?: {
547
510
  maxAgeSeconds?: number;
548
511
  }) => ClassDecorator & MethodDecorator;
549
- //#endregion
550
- //#region src/principal-resolver.d.ts
551
512
  declare const definePrincipalSource: <P extends AuthPrincipalBase>(source: PrincipalSource<P>) => PrincipalSource<P>;
552
513
  declare const authenticated: <P extends AuthPrincipalBase>(principal: P) => PrincipalResult<P>;
553
514
  declare const absent: () => PrincipalResult<never>;
554
515
  declare const rejected: (failure: AuthFailure) => PrincipalResult<never>;
555
- //#endregion
556
- //#region src/auth-exchange.d.ts
557
516
  /** Credentialed CORS for the auth mount, using the initialized SDK trusted origins. */
558
517
  declare function betterAuthCorsOrigin(auth: AuthLike, options?: CorsOriginOptions): (origin: string | undefined, cb: (err: Error | null, allow?: boolean) => void) => void;
559
- //#endregion
560
- //#region src/http-transport.d.ts
561
518
  declare function httpTransport(): ExtensionRef<AuthTransport>;
562
- //#endregion
563
- //#region src/index.d.ts
564
519
  /** Augment this public interface to register an optional principal kind. */
565
520
  interface PrincipalKinds {
566
521
  session: SessionPrincipal;
567
522
  }
568
- //#endregion
569
- //#region src/auth-types.d.ts
570
523
  /** Structural minimum; accepts any betterAuth() result incl. plugins and customSession (EXP-C2, EXP-A:types/). */
571
524
  interface AuthLike {
572
525
  handler(request: Request): Promise<Response>;
@@ -675,8 +628,6 @@ interface SessionPrincipal<S = AuthSession> extends AuthPrincipalBase {
675
628
  readonly kind: "session";
676
629
  readonly session: S;
677
630
  }
678
- //#endregion
679
- //#region src/auth-contracts.d.ts
680
631
  interface BetterAuthAppOptions {
681
632
  /** HTTP platforms. Exactly one must support the running HTTP adapter when the app has one. Default []. */
682
633
  platforms?: readonly ExtensionRef<HttpPlatform>[];
@@ -1649,6 +1600,5 @@ interface PolicyBootContext {
1649
1600
  readonly context: AuthContextView;
1650
1601
  readonly site: string;
1651
1602
  }
1652
- //#endregion
1653
1603
  export { PrincipalDelegation as $, ErrorMappingOptions as $n, SESSION_PRINCIPAL_KIND as $t, DatabaseHookTarget as A, BetterAuthService as An, GetSessionWithHeaders as At, HookOptions as B, WS_CONNECTION_AUTH as Bn, UnvalidatedBody as Bt, ConformanceCase as C, defineHttpPlatform as Cn, AuthPrincipal as Ct, CookieForwardingOptions as D, allow as Dn, DatabaseHookMethod as Dt, ConformanceSkip as E, BetterAuthGuard as En, DatabaseHookData as Et, ExtensionDefinition as F, BetterAuthModule as Fn, Register as Ft, InboundAuthRequest as G, AuthErrorBody as Gn, betterAuthCorsOrigin as Gt, HttpMountOptions as H, getBetterAuthInstanceToken as Hn, WithActiveOrganization as Ht, ExtensionRef as I, GUARD_CORE as In, RegisteredAuth as It, PlatformMountContext as J, AuthFailures as Jn, definePrincipalSource as Jt, InvocationLineage as K, AuthErrorCode as Kn, absent as Kt, FastifyPlatformOptions as L, POLICY_INVOKER as Ln, RegisteredInstances as Lt, DbHookOptions as M, InstanceLookup as Mn, OrgPermissions as Mt, DefaultInstanceCheck as N, EXTENSION_DEFINITION as Nn, PrincipalKind as Nt, CookieSink as O, definePolicy as On, DatabaseHookResult as Ot, ExpressPlatformOptions as P, UPGRADE_REQUEST as Pn, PrincipalOfKind as Pt, PolicyRef as Q, BetterAuthInfrastructureError as Qn, RequireFreshSession as Qt, GuardReach as R, PRINCIPAL_RESOLVER as Rn, SessionOf as Rt, ClaimOptions as S, defineExtension as Sn, AuthOf as St, ConformanceRunner as T, BetterAuthScopeInterceptor as Tn, AuthUser as Tt, HttpPlatform as U, getBetterAuthOptionsToken as Un, PrincipalKinds as Ut, HookPredicate as V, getBetterAuthHandleToken as Vn, UserOf as Vt, HttpRequestAccessor as W, getBetterAuthServiceToken as Wn, httpTransport as Wt, PolicyBootContext as X, AuthTransportErrorPayload as Xn, CurrentSession as Xt, PlatformPrepareContext as Y, AuthGraphqlExtensions as Yn, rejected as Yt, PolicyInvoker as Z, BetterAuthConfigurationError as Zn, CurrentUser as Zt, BetterAuthRuntimeOptions as _, allOf as _n, TransportValidationContext as _t, AuthHandlerInterceptor as a, BeforeAuth as an, ProxyTrust as at, BootAdviceContext as b, definePrincipalParam as bn, AuthHookContext as bt, AuthTransport as c, ForwardAuthCookies as cn, RequirementOptions as ct, AuthorizationLimits as d, Require as dn, ScopeInit as dt, freshSession as en, getRawCause as er, PrincipalReading as et, AuthorizationPolicy as f, RequireAuth as fn, SessionOption as ft, BetterAuthModuleOptions as g, UseBetterAuth as gn, TransportKit as gt, BetterAuthModuleAsyncOptions as h, UseAuthInstance as hn, TransportCall as ht, AuthHandle as i, AfterDatabase as in, PrincipalSource as it, DbHookMethodDecorator as j, TransportRegistry as jn, IsRegistered as jt, CorsOriginOptions as k, deny as kn, EndpointPath as kt, AuthorizationContext as l, OptionalAuth as ln, ResolutionRequest as lt, BetterAuthFactoryResult as m, SkipOriginCheck as mn, StaticOptionMustBePassedToForRootAsync as mt, ApplicationRouteDescriptor as n, AcceptPrincipals as nn, isConfigurationError as nr, PrincipalResolver as nt, AuthPrincipalBase as o, BeforeDatabase as on, Requirement as ot, BetterAuthAppOptions as p, SkipDefaultRequirements as pn, SessionPrincipalOptions as pt, OriginCheckOptions as q, AuthFailure as qn, authenticated as qt, AuthContextView as r, AfterAuth as rn, isInfrastructureError as rr, PrincipalResult as rt, AuthRouteBinding as s, CurrentPrincipal as sn, RequirementExpr as st, AdvisedHandler as t, sessionPrincipal as tn, isAuthFailure as tr, PrincipalRequest as tt, AuthorizationDecision as u, Public as un, RoutePlan as ut, BetterAuthStaticOptions as v, anyOf as vn, AdminPermissions as vt, ConformanceOutcome as w, defineTransport as wn, AuthSession as wt, BrowserExposure as x, requirement as xn, AuthLike as xt, BootAdvice as y, defineInvocationParam as yn, AuthAfterHookContext as yt, HookMethodDecorator as z, SCOPE_CORE as zn, SessionPrincipal as zt };
1654
- //# sourceMappingURL=auth-contracts-Brh_Qko9.d.cts.map
1604
+ //# sourceMappingURL=auth-contracts-CADGyI0O.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-contracts-CADGyI0O.d.mts","names":["tokens.ACCESS_METADATA","tokens.AUTH_INSTANCE_METADATA","tokens.ACCEPT_PRINCIPALS_METADATA","tokens.SKIP_DEFAULT_REQUIREMENTS_METADATA","tokens.FORWARD_COOKIES_METADATA","tokens.SKIP_ORIGIN_CHECK_METADATA"],"sources":["../src/auth-errors.ts","../src/auth-tokens.ts","../src/auth-module.ts","../src/bridge-protocol.ts","../src/request-scope.ts","../src/origin-check.ts","../src/instance-registry.ts","../src/mount-coordinator.ts","../src/principal-readings.ts","../src/policy-resolver.ts","../src/transport-registry.ts","../src/route-planner.ts","../src/auth-service.ts","../src/authorization-evaluator.ts","../src/auth-guard.ts","../src/auth-scope-interceptor.ts","../src/auth-module-definition.ts","../src/auth-decorators.ts","../src/session-principal.ts","../src/principal-resolver.ts","../src/auth-exchange.ts","../src/http-transport.ts","../src/index.ts","../src/auth-types.ts","../src/auth-contracts.ts"],"mappings":";;;;;KAoBY;;UAGK;WACN;WACA,MAAM;WACN;WACA;WACA;WACA,UAAU;;UAGJ;EACf;EACA;EACA,MAAM;EACN;EACA;;UAGe;EACf,MAAM;EACN;EACA;;UAGe;EACf;EACA;EACA,MAAM;EACN;EACA;;UAGe;EACf,OACE,SAAS,aACT,SAAS,kBACT;EAEF;;iBAQc,cAAc,iBAAiB,SAAS;iBAIxC,sBACd,iBACC,SAAS;iBAII,qBACd,iBACC,SAAS;iBAqDH,UAAU;EACjB;EACA;EACA;EACA;EACA;IACE;cA6BS;EACe,gBAAA,mBAAS;;EAIjB,UAAA,gBAAM,mBAAqB;EAGzB,aAAA,iBAAU;;cA4BnB,qCAAqC;WACvC;WACA;WACA;WACA;WACA;WACA;;;;;WAKA,kBAAkB;EAEf,YAAA,cAAc,gBAAgB;SAUnC,UACL,cACA,gBACA;IAAY;IAAe;MAC1B;;cAeQ,sCAAsC;WACxC,OAAO;WACP;;;;;EAMG,YAAA,gBAAgB;IAAY;;;iBAmD1B,YAAY,OAAO;iBC1SnB,2BAA2B;iBAI3B,0BAA0B;iBAI1B,0BAA0B;iBAI1B,yBAAyB;cA0B5B;cACA;cACA;cAGA;cAKA;cACA;cAMA;cAMA;cASA;cAGA;cAQA;;cAEA;cC9EA;SACJ,QAAQ,UAAU,WAAW,gBAClC,SAAS,wBAAwB,KAC/B;IAAyB;MAAqB,qBAAqB,KACpE;SACI,QAAQ,UAAU,UACvB,SAAS,wBAAwB;IAAO;MAAiB,eACxD;SAWI,aAAa,UAAU,WAAW,gBACvC,SAAS,6BAA6B,KACpC;IAAyB;MAC1B;SACI,aAAa,UA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