@pattern-stack/codegen 0.8.0 → 0.8.1
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.
- package/CHANGELOG.md +41 -0
- package/dist/runtime/subsystems/auth/controllers/auth.controller.d.ts +1 -0
- package/dist/runtime/subsystems/auth/index.d.ts +2 -0
- package/dist/runtime/subsystems/auth/index.js +55 -0
- package/dist/runtime/subsystems/auth/index.js.map +1 -1
- package/dist/runtime/subsystems/auth/middleware/requester-context.d.ts +81 -0
- package/dist/runtime/subsystems/auth/middleware/requester-context.js +60 -0
- package/dist/runtime/subsystems/auth/middleware/requester-context.js.map +1 -0
- package/dist/runtime/subsystems/auth/protocols/user-context.d.ts +18 -0
- package/dist/runtime/subsystems/index.d.ts +1 -0
- package/dist/runtime/subsystems/index.js +4 -0
- package/dist/runtime/subsystems/index.js.map +1 -1
- package/dist/src/cli/index.js +13 -1
- package/dist/src/cli/index.js.map +1 -1
- package/package.json +1 -1
- package/runtime/subsystems/auth/index.ts +8 -0
- package/runtime/subsystems/auth/middleware/requester-context.ts +141 -0
- package/runtime/subsystems/auth/protocols/user-context.ts +17 -0
package/dist/src/cli/index.js
CHANGED
|
@@ -10315,9 +10315,21 @@ async function bootstrap(): Promise<void> {
|
|
|
10315
10315
|
} as NonNullable<typeof nestDocument.components>['schemas'],
|
|
10316
10316
|
};
|
|
10317
10317
|
|
|
10318
|
-
|
|
10318
|
+
// \`persistAuthorization\` keeps the "Authorize" bearer token across page
|
|
10319
|
+
// reloads, so the token pasted in Swagger UI keeps flowing as the
|
|
10320
|
+
// \`Authorization\` header \u2014 which the RequesterContext boundary (below)
|
|
10321
|
+
// turns into ambient tenant scope on every request.
|
|
10322
|
+
SwaggerModule.setup(config.openapi.path ?? '/docs', app, nestDocument, {
|
|
10323
|
+
swaggerOptions: { persistAuthorization: true },
|
|
10324
|
+
});
|
|
10319
10325
|
}
|
|
10320
10326
|
|
|
10327
|
+
// Ambient tenant scoping (auth subsystem). Uncomment once the auth subsystem
|
|
10328
|
+
// is installed and an IUserContext is bound under AUTH_USER_CONTEXT \u2014 then
|
|
10329
|
+
// every request is scoped to its requester with no threaded userId:
|
|
10330
|
+
// import { installRequesterContext } from './shared/subsystems/auth/middleware/requester-context';
|
|
10331
|
+
// installRequesterContext(app); // no-op + warn if AUTH_USER_CONTEXT is unbound
|
|
10332
|
+
|
|
10321
10333
|
const port = Number(process.env.PORT ?? 3000);
|
|
10322
10334
|
await app.listen(port);
|
|
10323
10335
|
// eslint-disable-next-line no-console
|