@getstrata/bootstrap 3.0.5 → 3.0.8
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 +19 -0
- package/README.md +11 -8
- package/dist/bootstrap/application/config.d.ts +7 -0
- package/dist/bootstrap/application/services.d.ts +28 -0
- package/dist/bootstrap/application.d.ts +115 -0
- package/dist/bootstrap/auth/accountWorkflows.d.ts +68 -0
- package/dist/bootstrap/auth/runtimeConfig.d.ts +66 -0
- package/dist/bootstrap/config.d.ts +1 -1
- package/dist/bootstrap/contracts.d.ts +1 -0
- package/dist/bootstrap/createSpaRoutes.d.ts +2 -0
- package/dist/bootstrap/databaseCommands.d.ts +26 -0
- package/dist/bootstrap/discoverJobs.d.ts +1 -2
- package/dist/bootstrap/discoverListeners.d.ts +4 -0
- package/dist/bootstrap/httpKernel.d.ts +0 -1
- package/dist/bootstrap/httpResponseComposition.d.ts +32 -0
- package/dist/bootstrap/jobDiscoveryState.d.ts +12 -0
- package/dist/bootstrap/providers/events.d.ts +2 -2
- package/dist/bootstrap/public-api.d.ts +3 -2
- package/dist/bootstrap/testing.d.ts +4 -0
- package/dist/entries/application.js +1 -0
- package/dist/entries/auth/accountWorkflows.js +98 -0
- package/dist/entries/auth/runtimeConfig.js +79 -0
- package/dist/entries/buildModuleRoutes.js +114 -94
- package/dist/entries/buildWebModuleRoutes.js +114 -94
- package/dist/entries/config.js +2 -0
- package/dist/entries/context.js +12 -18
- package/dist/entries/createSpaRoutes.js +2 -2
- package/dist/entries/createWebRoutes.js +114 -94
- package/dist/entries/databaseCommands.js +103 -0
- package/dist/entries/dependencies.js +12 -18
- package/dist/entries/discoverJobs.js +2 -15
- package/dist/entries/discoverListeners.js +34 -0
- package/dist/entries/health.js +1 -0
- package/dist/entries/httpKernel.js +114 -94
- package/dist/entries/providers/auth.js +1 -0
- package/dist/entries/providers/events.js +1 -0
- package/dist/entries/providers.js +6 -15
- package/dist/entries/testing.js +10 -0
- package/dist/entries/web/routing.js +114 -94
- package/dist/entries/web/server.js +2 -1
- package/dist/index.js +3222 -2272
- package/dist/internal/jobDiscoveryState.js +14 -0
- package/package.json +35 -6
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// ../../src/bootstrap/auth/runtimeConfig.ts
|
|
3
|
+
import {
|
|
4
|
+
passwordConfirmCookieName,
|
|
5
|
+
passwordConfirmTtlSeconds
|
|
6
|
+
} from "@getstrata/core/auth/passwordConfirmCookie";
|
|
7
|
+
import { readSamlEnvOptions } from "@getstrata/core/auth/saml/samlServiceProvider";
|
|
8
|
+
import { resolveEnv } from "@getstrata/core/config/envSchema";
|
|
9
|
+
import { requireConfiguredSecret } from "@getstrata/core/runtime/appKeyPrefix";
|
|
10
|
+
import { resolveScimTenantFromToken } from "@getstrata/core/security/scimTenantTokens";
|
|
11
|
+
function createAuthRuntimeConfig(options, features) {
|
|
12
|
+
const env = Object.freeze({ ...options.environment });
|
|
13
|
+
const numeric = resolveEnv({
|
|
14
|
+
API_TOKEN_DEFAULT_EXPIRY_DAYS: { integer: true, minimum: 1 },
|
|
15
|
+
JWT_TTL_SECONDS: { integer: true, minimum: 1, default: "3600" }
|
|
16
|
+
}, {
|
|
17
|
+
API_TOKEN_DEFAULT_EXPIRY_DAYS: features.token ? env.API_TOKEN_DEFAULT_EXPIRY_DAYS : undefined,
|
|
18
|
+
JWT_TTL_SECONDS: features.jwt ? env.JWT_TTL_SECONDS : undefined
|
|
19
|
+
});
|
|
20
|
+
if (features.jwt && !options.jwtSecret.trim())
|
|
21
|
+
throw new TypeError("An explicit JWT secret is required.");
|
|
22
|
+
if (features.cookie && !options.sessionSecret?.trim())
|
|
23
|
+
throw new TypeError("SESSION_SECRET is required for cookie authentication.");
|
|
24
|
+
const secretsEnv = Object.freeze({
|
|
25
|
+
...env,
|
|
26
|
+
...options.sessionSecret ? { SESSION_SECRET: options.sessionSecret } : {}
|
|
27
|
+
});
|
|
28
|
+
const configuredAppUrl = env.APP_URL ?? "http://localhost:3000";
|
|
29
|
+
const appUrl = configuredAppUrl.endsWith("/") ? configuredAppUrl.slice(0, -1) : configuredAppUrl;
|
|
30
|
+
const production = options.production;
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
sessionCookie: Object.freeze({
|
|
33
|
+
cookieName: env.SESSION_COOKIE_NAME?.trim() || (env.APP_KEY_PREFIX?.trim() || "strata") + "_session",
|
|
34
|
+
production
|
|
35
|
+
}),
|
|
36
|
+
registrationEnabled: (env.FEATURE_REGISTRATION ?? "true") !== "false",
|
|
37
|
+
scimEnabled: (env.FEATURE_SCIM ?? "false") === "true",
|
|
38
|
+
redisUrl: env.REDIS_URL,
|
|
39
|
+
samlEnabled: env.FEATURE_SAML === "true",
|
|
40
|
+
oauthEnabled: env.FEATURE_OAUTH === "true",
|
|
41
|
+
appName: env.APP_NAME ?? "Strata",
|
|
42
|
+
appUrl,
|
|
43
|
+
saml: features.cookie && env.FEATURE_SAML === "true" ? Object.freeze(readSamlEnvOptions(env)) : undefined,
|
|
44
|
+
github: Object.freeze({
|
|
45
|
+
clientId: env.GITHUB_CLIENT_ID?.trim() ?? "",
|
|
46
|
+
clientSecret: env.GITHUB_CLIENT_SECRET?.trim() ?? "",
|
|
47
|
+
redirectUri: env.GITHUB_REDIRECT_URI?.trim() || appUrl + "/auth/github/callback",
|
|
48
|
+
production,
|
|
49
|
+
userAgent: env.APP_USER_AGENT?.trim() || env.APP_KEY_PREFIX?.trim() || "strata"
|
|
50
|
+
}),
|
|
51
|
+
oidc: Object.freeze({
|
|
52
|
+
issuer: env.OIDC_ISSUER?.trim() ?? "",
|
|
53
|
+
clientId: env.OIDC_CLIENT_ID?.trim() ?? "",
|
|
54
|
+
clientSecret: env.OIDC_CLIENT_SECRET?.trim() ?? "",
|
|
55
|
+
redirectUri: env.OIDC_REDIRECT_URI?.trim() || appUrl + "/auth/oidc/callback",
|
|
56
|
+
networkPolicy: Object.freeze({ production, allowPrivate: env.OIDC_ALLOW_PRIVATE === "true" })
|
|
57
|
+
}),
|
|
58
|
+
throttleNamespace: env.APP_KEY_PREFIX?.trim() || "strata",
|
|
59
|
+
trustForwardedFor: env.TRUST_FORWARDED_FOR === "true",
|
|
60
|
+
scimTenantForToken: (token) => resolveScimTenantFromToken(token, env),
|
|
61
|
+
tokenExpiryDays: features.token ? numeric.API_TOKEN_DEFAULT_EXPIRY_DAYS ?? null : null,
|
|
62
|
+
jwtTtlSeconds: numeric.JWT_TTL_SECONDS ?? 3600,
|
|
63
|
+
jwtSecret: options.jwtSecret,
|
|
64
|
+
signatureSecret: options.signatureSecret ?? (features.signedUrls ? requireConfiguredSecret(["SIGNED_URL_SECRET", "SESSION_SECRET", "OAUTH_STATE_SECRET"], "signed-url-secret", secretsEnv) : options.jwtSecret),
|
|
65
|
+
oauth: Object.freeze({
|
|
66
|
+
secret: options.oauthStateSecret ?? (features.cookie ? requireConfiguredSecret(["OAUTH_STATE_SECRET", "SESSION_SECRET"], "oauth-state-secret", secretsEnv) : options.jwtSecret),
|
|
67
|
+
production
|
|
68
|
+
}),
|
|
69
|
+
passwordConfirmation: Object.freeze(options.passwordConfirmation ? { ...options.passwordConfirmation } : {
|
|
70
|
+
secret: features.cookie ? requireConfiguredSecret(["SESSION_SECRET", "OAUTH_STATE_SECRET"], "session-secret", secretsEnv) : options.jwtSecret,
|
|
71
|
+
cookieName: features.cookie ? passwordConfirmCookieName(env) : "strata_password_confirmed",
|
|
72
|
+
ttlSeconds: features.cookie ? passwordConfirmTtlSeconds(env) : 10800,
|
|
73
|
+
production
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
createAuthRuntimeConfig
|
|
79
|
+
};
|
|
@@ -24,33 +24,20 @@ function createApplicationCachedJson(dependencies) {
|
|
|
24
24
|
// ../../src/bootstrap/httpKernel.ts
|
|
25
25
|
import { establishedAuthReader as establishedAuthReader2 } from "@getstrata/core/auth/authReader";
|
|
26
26
|
import { hasVerifiedEmail } from "@getstrata/core/auth/emailVerification";
|
|
27
|
-
import {
|
|
28
|
-
CORE_TRACING_RUNTIME_TOKEN,
|
|
29
|
-
resolveAbilityChecker
|
|
30
|
-
} from "@getstrata/core/contracts/serviceTokens";
|
|
27
|
+
import { resolveAbilityChecker } from "@getstrata/core/contracts/serviceTokens";
|
|
31
28
|
import { createAuthorizeMiddleware } from "@getstrata/core/http/authorizeMiddleware";
|
|
32
|
-
import { createBodySizeLimitMiddleware } from "@getstrata/core/http/bodySizeLimitMiddleware";
|
|
33
|
-
import { createCorsMiddleware, resolveCorsConfig } from "@getstrata/core/http/corsMiddleware";
|
|
34
|
-
import { createCsrfMiddleware } from "@getstrata/core/http/csrfMiddleware";
|
|
35
29
|
import { createFlashMiddleware } from "@getstrata/core/http/flashMiddleware";
|
|
36
30
|
import { createLoginThrottleMiddleware } from "@getstrata/core/http/loginThrottleMiddleware";
|
|
37
31
|
import { createMemoryThrottleMiddleware } from "@getstrata/core/http/memoryThrottleMiddleware";
|
|
38
|
-
import { createMetricsMiddleware } from "@getstrata/core/http/metricsMiddleware";
|
|
39
|
-
import { requestIdMiddleware } from "@getstrata/core/http/middleware";
|
|
40
32
|
import { createRequireAbilityMiddleware } from "@getstrata/core/http/requireAbilityMiddleware";
|
|
41
33
|
import { createRequireAuthMiddleware } from "@getstrata/core/http/requireAuthMiddleware";
|
|
42
34
|
import { createRequireGlobalAdminMiddleware } from "@getstrata/core/http/requireGlobalAdminMiddleware";
|
|
43
35
|
import { createRequirePasswordConfirmMiddleware } from "@getstrata/core/http/requirePasswordConfirmMiddleware";
|
|
44
36
|
import { createRequireVerifiedMiddleware } from "@getstrata/core/http/requireVerifiedMiddleware";
|
|
45
37
|
import { createRequireWebAuthMiddleware } from "@getstrata/core/http/requireWebAuthMiddleware";
|
|
46
|
-
import { createJsonErrorMiddleware, createWebErrorMiddleware } from "@getstrata/core/http/response";
|
|
47
38
|
import { withMiddleware } from "@getstrata/core/http/routeMiddleware";
|
|
48
|
-
import { createSecurityHeadersMiddleware } from "@getstrata/core/http/securityHeadersMiddleware";
|
|
49
39
|
import { createValidateSignatureMiddleware } from "@getstrata/core/http/signedUrl";
|
|
50
40
|
import { createThrottleMiddleware } from "@getstrata/core/http/throttleMiddleware";
|
|
51
|
-
import { createRequestLoggingMiddleware } from "@getstrata/core/logging/requestLoggingMiddleware";
|
|
52
|
-
import { createTracingMiddleware } from "@getstrata/core/tracing/tracingMiddleware";
|
|
53
|
-
import { CORE_WEB_ERROR_VIEW_TOKEN } from "@getstrata/core/view/tokens";
|
|
54
41
|
import {
|
|
55
42
|
assertHttpHandler,
|
|
56
43
|
identityModes,
|
|
@@ -69,6 +56,7 @@ import {
|
|
|
69
56
|
CORE_EVENT_BUS_TOKEN,
|
|
70
57
|
CORE_HTTP_CLEANUP_TOKEN,
|
|
71
58
|
CORE_POLICY_GATE_TOKEN,
|
|
59
|
+
CORE_POLICY_REGISTRY_TOKEN,
|
|
72
60
|
CORE_PUBLIC_TENANCY_TOKEN,
|
|
73
61
|
CORE_QUEUE_TOKEN,
|
|
74
62
|
CORE_TENANT_RESOLVER_TOKEN,
|
|
@@ -238,39 +226,18 @@ function createHttpPersistence(invoke, options) {
|
|
|
238
226
|
};
|
|
239
227
|
}
|
|
240
228
|
|
|
241
|
-
// ../../src/bootstrap/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (typeof value === "function") {
|
|
254
|
-
wrapped[path] = enter(value);
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
258
|
-
const entries = Object.entries(value);
|
|
259
|
-
if (entries.some(([, handler]) => typeof handler === "function" || handler instanceof Response)) {
|
|
260
|
-
wrapped[path] = Object.fromEntries(entries.map(([method, handler]) => {
|
|
261
|
-
const callback = handler instanceof Response ? () => handler.clone() : handler;
|
|
262
|
-
return [
|
|
263
|
-
method,
|
|
264
|
-
typeof callback === "function" ? enter(callback) : callback
|
|
265
|
-
];
|
|
266
|
-
}));
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
wrapped[path] = value;
|
|
271
|
-
}
|
|
272
|
-
return wrapped;
|
|
273
|
-
}
|
|
229
|
+
// ../../src/bootstrap/httpResponseComposition.ts
|
|
230
|
+
import { CORE_TRACING_RUNTIME_TOKEN } from "@getstrata/core/contracts/serviceTokens";
|
|
231
|
+
import { createBodySizeLimitMiddleware } from "@getstrata/core/http/bodySizeLimitMiddleware";
|
|
232
|
+
import { createCorsMiddleware, resolveCorsConfig } from "@getstrata/core/http/corsMiddleware";
|
|
233
|
+
import { createCsrfMiddleware } from "@getstrata/core/http/csrfMiddleware";
|
|
234
|
+
import { createMetricsMiddleware } from "@getstrata/core/http/metricsMiddleware";
|
|
235
|
+
import { requestIdMiddleware } from "@getstrata/core/http/middleware";
|
|
236
|
+
import { createJsonErrorMiddleware, createWebErrorMiddleware } from "@getstrata/core/http/response";
|
|
237
|
+
import { createSecurityHeadersMiddleware } from "@getstrata/core/http/securityHeadersMiddleware";
|
|
238
|
+
import { createRequestLoggingMiddleware } from "@getstrata/core/logging/requestLoggingMiddleware";
|
|
239
|
+
import { createTracingMiddleware } from "@getstrata/core/tracing/tracingMiddleware";
|
|
240
|
+
import { CORE_WEB_ERROR_VIEW_TOKEN } from "@getstrata/core/view/tokens";
|
|
274
241
|
|
|
275
242
|
// ../../src/bootstrap/rateLimit.ts
|
|
276
243
|
var LOCAL_LOGIN_RATE_LIMIT = {
|
|
@@ -315,6 +282,97 @@ function resolveRegisterRateLimit(env = {}) {
|
|
|
315
282
|
};
|
|
316
283
|
}
|
|
317
284
|
|
|
285
|
+
// ../../src/bootstrap/httpResponseComposition.ts
|
|
286
|
+
function resolveHttpResponseSettings(dependencies, http) {
|
|
287
|
+
const config = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN) : undefined;
|
|
288
|
+
const features = http?.features ?? config?.get("http.features");
|
|
289
|
+
const emailVerificationRequired = features?.emailVerificationRequired ?? false;
|
|
290
|
+
const viewsEnabled = features?.viewsEnabled ?? false;
|
|
291
|
+
const publicReadsEnabled = features?.publicReadsEnabled ?? false;
|
|
292
|
+
const etagEnabled = features?.etagEnabled ?? true;
|
|
293
|
+
const policy = http?.responsePolicy ?? config?.get("http.responsePolicy");
|
|
294
|
+
if (policy?.cors)
|
|
295
|
+
resolveCorsConfig(policy.cors);
|
|
296
|
+
const responsePolicy = Object.freeze({
|
|
297
|
+
cors: policy?.cors ? {
|
|
298
|
+
allowedOrigins: [...policy.cors.allowedOrigins ?? []],
|
|
299
|
+
additionalAllowedHeaders: [...policy.cors.additionalAllowedHeaders ?? []]
|
|
300
|
+
} : undefined,
|
|
301
|
+
securityHeaders: policy?.securityHeaders ?? {
|
|
302
|
+
production: http?.production ?? true,
|
|
303
|
+
frontendMode: viewsEnabled ? "server-htmx" : "api"
|
|
304
|
+
},
|
|
305
|
+
maxBodyBytes: policy?.maxBodyBytes ?? 1048576,
|
|
306
|
+
rateLimitPerMinute: policy?.rateLimitPerMinute ?? 120,
|
|
307
|
+
namespace: policy?.namespace ?? "strata",
|
|
308
|
+
trustForwardedFor: policy?.trustForwardedFor ?? false,
|
|
309
|
+
loginRateLimit: Object.freeze({ ...policy?.loginRateLimit ?? resolveLoginRateLimit() }),
|
|
310
|
+
registerRateLimit: Object.freeze({
|
|
311
|
+
...policy?.registerRateLimit ?? resolveRegisterRateLimit()
|
|
312
|
+
})
|
|
313
|
+
});
|
|
314
|
+
const targetOrigin = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN).get(CSRF_TARGET_ORIGIN_CONFIG_KEY) : undefined;
|
|
315
|
+
const configuredCsrfMiddleware = createCsrfMiddleware({ targetOrigin, ...http?.csrf });
|
|
316
|
+
return {
|
|
317
|
+
emailVerificationRequired,
|
|
318
|
+
viewsEnabled,
|
|
319
|
+
publicReadsEnabled,
|
|
320
|
+
etagEnabled,
|
|
321
|
+
responsePolicy,
|
|
322
|
+
configuredCsrfMiddleware
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function createHttpResponseMiddleware(dependencies, settings, errorFormat) {
|
|
326
|
+
return [
|
|
327
|
+
createCorsMiddleware(settings.responsePolicy.cors),
|
|
328
|
+
createSecurityHeadersMiddleware(settings.responsePolicy.securityHeaders),
|
|
329
|
+
createBodySizeLimitMiddleware(settings.responsePolicy.maxBodyBytes),
|
|
330
|
+
...dependencies.container.has(CORE_TRACING_RUNTIME_TOKEN) ? [createTracingMiddleware(dependencies.container.resolve(CORE_TRACING_RUNTIME_TOKEN))] : [],
|
|
331
|
+
createMetricsMiddleware(),
|
|
332
|
+
createRequestLoggingMiddleware(settings.responsePolicy.trustForwardedFor),
|
|
333
|
+
requestIdMiddleware,
|
|
334
|
+
errorFormat === "json" ? createJsonErrorMiddleware() : createWebErrorMiddleware({
|
|
335
|
+
enabled: settings.viewsEnabled,
|
|
336
|
+
production: dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS).production ?? true : true,
|
|
337
|
+
render: dependencies.container.has(CORE_WEB_ERROR_VIEW_TOKEN) ? dependencies.container.resolve(CORE_WEB_ERROR_VIEW_TOKEN) : undefined
|
|
338
|
+
})
|
|
339
|
+
];
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ../../src/bootstrap/moduleRouteMiddleware.ts
|
|
343
|
+
function enterModuleRoutes(routes, enter) {
|
|
344
|
+
const wrapped = {};
|
|
345
|
+
for (const [path, value] of Object.entries(routes)) {
|
|
346
|
+
if (value instanceof Response) {
|
|
347
|
+
const methods = {};
|
|
348
|
+
for (const method of ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]) {
|
|
349
|
+
methods[method] = enter(() => value.clone());
|
|
350
|
+
}
|
|
351
|
+
wrapped[path] = methods;
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if (typeof value === "function") {
|
|
355
|
+
wrapped[path] = enter(value);
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
359
|
+
const entries = Object.entries(value);
|
|
360
|
+
if (entries.some(([, handler]) => typeof handler === "function" || handler instanceof Response)) {
|
|
361
|
+
wrapped[path] = Object.fromEntries(entries.map(([method, handler]) => {
|
|
362
|
+
const callback = handler instanceof Response ? () => handler.clone() : handler;
|
|
363
|
+
return [
|
|
364
|
+
method,
|
|
365
|
+
typeof callback === "function" ? enter(callback) : callback
|
|
366
|
+
];
|
|
367
|
+
}));
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
wrapped[path] = value;
|
|
372
|
+
}
|
|
373
|
+
return wrapped;
|
|
374
|
+
}
|
|
375
|
+
|
|
318
376
|
// ../../src/bootstrap/httpKernel.ts
|
|
319
377
|
class HttpKernel {
|
|
320
378
|
dependencies;
|
|
@@ -333,38 +391,16 @@ class HttpKernel {
|
|
|
333
391
|
this.dependencies = dependencies;
|
|
334
392
|
const http = dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS) : undefined;
|
|
335
393
|
this.httpOptions = http;
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
if (policy?.cors)
|
|
344
|
-
resolveCorsConfig(policy.cors);
|
|
345
|
-
this.responsePolicy = Object.freeze({
|
|
346
|
-
cors: policy?.cors ? {
|
|
347
|
-
allowedOrigins: [...policy.cors.allowedOrigins ?? []],
|
|
348
|
-
additionalAllowedHeaders: [...policy.cors.additionalAllowedHeaders ?? []]
|
|
349
|
-
} : undefined,
|
|
350
|
-
securityHeaders: policy?.securityHeaders ?? {
|
|
351
|
-
production: http?.production ?? true,
|
|
352
|
-
frontendMode: this.viewsEnabled ? "server-htmx" : "api"
|
|
353
|
-
},
|
|
354
|
-
maxBodyBytes: policy?.maxBodyBytes ?? 1048576,
|
|
355
|
-
rateLimitPerMinute: policy?.rateLimitPerMinute ?? 120,
|
|
356
|
-
namespace: policy?.namespace ?? "strata",
|
|
357
|
-
trustForwardedFor: policy?.trustForwardedFor ?? false,
|
|
358
|
-
loginRateLimit: Object.freeze({ ...policy?.loginRateLimit ?? resolveLoginRateLimit() }),
|
|
359
|
-
registerRateLimit: Object.freeze({
|
|
360
|
-
...policy?.registerRateLimit ?? resolveRegisterRateLimit()
|
|
361
|
-
})
|
|
362
|
-
});
|
|
363
|
-
const targetOrigin = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN).get(CSRF_TARGET_ORIGIN_CONFIG_KEY) : undefined;
|
|
364
|
-
this.configuredCsrfMiddleware = createCsrfMiddleware({ targetOrigin, ...http?.csrf });
|
|
394
|
+
const settings = resolveHttpResponseSettings(dependencies, http);
|
|
395
|
+
this.emailVerificationRequired = settings.emailVerificationRequired;
|
|
396
|
+
this.viewsEnabled = settings.viewsEnabled;
|
|
397
|
+
this.publicReadsEnabled = settings.publicReadsEnabled;
|
|
398
|
+
this.etagEnabled = settings.etagEnabled;
|
|
399
|
+
this.responsePolicy = settings.responsePolicy;
|
|
400
|
+
this.configuredCsrfMiddleware = settings.configuredCsrfMiddleware;
|
|
365
401
|
this.responses = Object.freeze({
|
|
366
|
-
json: Object.freeze(
|
|
367
|
-
web: Object.freeze(
|
|
402
|
+
json: Object.freeze(createHttpResponseMiddleware(dependencies, settings, "json")),
|
|
403
|
+
web: Object.freeze(createHttpResponseMiddleware(dependencies, settings, "web"))
|
|
368
404
|
});
|
|
369
405
|
this.persistence = dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? createHttpPersistence(dependencies.invoke, dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS)) : undefined;
|
|
370
406
|
if (dependencies.container.has(CORE_HTTP_CLEANUP_TOKEN)) {
|
|
@@ -459,22 +495,6 @@ class HttpKernel {
|
|
|
459
495
|
throw new TypeError("SCIM and identity operation declarations cannot be combined.");
|
|
460
496
|
return this.composed(handler, "json", undefined, Object.freeze([...before]));
|
|
461
497
|
}
|
|
462
|
-
responseMiddleware(errorFormat) {
|
|
463
|
-
return [
|
|
464
|
-
createCorsMiddleware(this.responsePolicy.cors),
|
|
465
|
-
createSecurityHeadersMiddleware(this.responsePolicy.securityHeaders),
|
|
466
|
-
createBodySizeLimitMiddleware(this.responsePolicy.maxBodyBytes),
|
|
467
|
-
...this.dependencies.container.has(CORE_TRACING_RUNTIME_TOKEN) ? [createTracingMiddleware(this.dependencies.container.resolve(CORE_TRACING_RUNTIME_TOKEN))] : [],
|
|
468
|
-
createMetricsMiddleware(),
|
|
469
|
-
createRequestLoggingMiddleware(this.responsePolicy.trustForwardedFor),
|
|
470
|
-
requestIdMiddleware,
|
|
471
|
-
errorFormat === "json" ? createJsonErrorMiddleware() : createWebErrorMiddleware({
|
|
472
|
-
enabled: this.viewsEnabled,
|
|
473
|
-
production: this.dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? this.dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS).production ?? true : true,
|
|
474
|
-
render: this.dependencies.container.has(CORE_WEB_ERROR_VIEW_TOKEN) ? this.dependencies.container.resolve(CORE_WEB_ERROR_VIEW_TOKEN) : undefined
|
|
475
|
-
})
|
|
476
|
-
];
|
|
477
|
-
}
|
|
478
498
|
wrapPublicDocument(handler) {
|
|
479
499
|
assertHttpHandler(handler);
|
|
480
500
|
return ownedPublicHttpRoute(handler, (request, work) => Promise.resolve(withMiddleware(...this.responses.web)(work)(request)));
|
|
@@ -20,33 +20,20 @@ function createApplicationCachedJson(dependencies) {
|
|
|
20
20
|
// ../../src/bootstrap/httpKernel.ts
|
|
21
21
|
import { establishedAuthReader as establishedAuthReader2 } from "@getstrata/core/auth/authReader";
|
|
22
22
|
import { hasVerifiedEmail } from "@getstrata/core/auth/emailVerification";
|
|
23
|
-
import {
|
|
24
|
-
CORE_TRACING_RUNTIME_TOKEN,
|
|
25
|
-
resolveAbilityChecker
|
|
26
|
-
} from "@getstrata/core/contracts/serviceTokens";
|
|
23
|
+
import { resolveAbilityChecker } from "@getstrata/core/contracts/serviceTokens";
|
|
27
24
|
import { createAuthorizeMiddleware } from "@getstrata/core/http/authorizeMiddleware";
|
|
28
|
-
import { createBodySizeLimitMiddleware } from "@getstrata/core/http/bodySizeLimitMiddleware";
|
|
29
|
-
import { createCorsMiddleware, resolveCorsConfig } from "@getstrata/core/http/corsMiddleware";
|
|
30
|
-
import { createCsrfMiddleware } from "@getstrata/core/http/csrfMiddleware";
|
|
31
25
|
import { createFlashMiddleware } from "@getstrata/core/http/flashMiddleware";
|
|
32
26
|
import { createLoginThrottleMiddleware } from "@getstrata/core/http/loginThrottleMiddleware";
|
|
33
27
|
import { createMemoryThrottleMiddleware } from "@getstrata/core/http/memoryThrottleMiddleware";
|
|
34
|
-
import { createMetricsMiddleware } from "@getstrata/core/http/metricsMiddleware";
|
|
35
|
-
import { requestIdMiddleware } from "@getstrata/core/http/middleware";
|
|
36
28
|
import { createRequireAbilityMiddleware } from "@getstrata/core/http/requireAbilityMiddleware";
|
|
37
29
|
import { createRequireAuthMiddleware } from "@getstrata/core/http/requireAuthMiddleware";
|
|
38
30
|
import { createRequireGlobalAdminMiddleware } from "@getstrata/core/http/requireGlobalAdminMiddleware";
|
|
39
31
|
import { createRequirePasswordConfirmMiddleware } from "@getstrata/core/http/requirePasswordConfirmMiddleware";
|
|
40
32
|
import { createRequireVerifiedMiddleware } from "@getstrata/core/http/requireVerifiedMiddleware";
|
|
41
33
|
import { createRequireWebAuthMiddleware } from "@getstrata/core/http/requireWebAuthMiddleware";
|
|
42
|
-
import { createJsonErrorMiddleware, createWebErrorMiddleware } from "@getstrata/core/http/response";
|
|
43
34
|
import { withMiddleware } from "@getstrata/core/http/routeMiddleware";
|
|
44
|
-
import { createSecurityHeadersMiddleware } from "@getstrata/core/http/securityHeadersMiddleware";
|
|
45
35
|
import { createValidateSignatureMiddleware } from "@getstrata/core/http/signedUrl";
|
|
46
36
|
import { createThrottleMiddleware } from "@getstrata/core/http/throttleMiddleware";
|
|
47
|
-
import { createRequestLoggingMiddleware } from "@getstrata/core/logging/requestLoggingMiddleware";
|
|
48
|
-
import { createTracingMiddleware } from "@getstrata/core/tracing/tracingMiddleware";
|
|
49
|
-
import { CORE_WEB_ERROR_VIEW_TOKEN } from "@getstrata/core/view/tokens";
|
|
50
37
|
import {
|
|
51
38
|
assertHttpHandler,
|
|
52
39
|
identityModes,
|
|
@@ -65,6 +52,7 @@ import {
|
|
|
65
52
|
CORE_EVENT_BUS_TOKEN,
|
|
66
53
|
CORE_HTTP_CLEANUP_TOKEN,
|
|
67
54
|
CORE_POLICY_GATE_TOKEN,
|
|
55
|
+
CORE_POLICY_REGISTRY_TOKEN,
|
|
68
56
|
CORE_PUBLIC_TENANCY_TOKEN,
|
|
69
57
|
CORE_QUEUE_TOKEN,
|
|
70
58
|
CORE_TENANT_RESOLVER_TOKEN,
|
|
@@ -234,39 +222,18 @@ function createHttpPersistence(invoke, options) {
|
|
|
234
222
|
};
|
|
235
223
|
}
|
|
236
224
|
|
|
237
|
-
// ../../src/bootstrap/
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (typeof value === "function") {
|
|
250
|
-
wrapped[path] = enter(value);
|
|
251
|
-
continue;
|
|
252
|
-
}
|
|
253
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
254
|
-
const entries = Object.entries(value);
|
|
255
|
-
if (entries.some(([, handler]) => typeof handler === "function" || handler instanceof Response)) {
|
|
256
|
-
wrapped[path] = Object.fromEntries(entries.map(([method, handler]) => {
|
|
257
|
-
const callback = handler instanceof Response ? () => handler.clone() : handler;
|
|
258
|
-
return [
|
|
259
|
-
method,
|
|
260
|
-
typeof callback === "function" ? enter(callback) : callback
|
|
261
|
-
];
|
|
262
|
-
}));
|
|
263
|
-
continue;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
wrapped[path] = value;
|
|
267
|
-
}
|
|
268
|
-
return wrapped;
|
|
269
|
-
}
|
|
225
|
+
// ../../src/bootstrap/httpResponseComposition.ts
|
|
226
|
+
import { CORE_TRACING_RUNTIME_TOKEN } from "@getstrata/core/contracts/serviceTokens";
|
|
227
|
+
import { createBodySizeLimitMiddleware } from "@getstrata/core/http/bodySizeLimitMiddleware";
|
|
228
|
+
import { createCorsMiddleware, resolveCorsConfig } from "@getstrata/core/http/corsMiddleware";
|
|
229
|
+
import { createCsrfMiddleware } from "@getstrata/core/http/csrfMiddleware";
|
|
230
|
+
import { createMetricsMiddleware } from "@getstrata/core/http/metricsMiddleware";
|
|
231
|
+
import { requestIdMiddleware } from "@getstrata/core/http/middleware";
|
|
232
|
+
import { createJsonErrorMiddleware, createWebErrorMiddleware } from "@getstrata/core/http/response";
|
|
233
|
+
import { createSecurityHeadersMiddleware } from "@getstrata/core/http/securityHeadersMiddleware";
|
|
234
|
+
import { createRequestLoggingMiddleware } from "@getstrata/core/logging/requestLoggingMiddleware";
|
|
235
|
+
import { createTracingMiddleware } from "@getstrata/core/tracing/tracingMiddleware";
|
|
236
|
+
import { CORE_WEB_ERROR_VIEW_TOKEN } from "@getstrata/core/view/tokens";
|
|
270
237
|
|
|
271
238
|
// ../../src/bootstrap/rateLimit.ts
|
|
272
239
|
var LOCAL_LOGIN_RATE_LIMIT = {
|
|
@@ -311,6 +278,97 @@ function resolveRegisterRateLimit(env = {}) {
|
|
|
311
278
|
};
|
|
312
279
|
}
|
|
313
280
|
|
|
281
|
+
// ../../src/bootstrap/httpResponseComposition.ts
|
|
282
|
+
function resolveHttpResponseSettings(dependencies, http) {
|
|
283
|
+
const config = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN) : undefined;
|
|
284
|
+
const features = http?.features ?? config?.get("http.features");
|
|
285
|
+
const emailVerificationRequired = features?.emailVerificationRequired ?? false;
|
|
286
|
+
const viewsEnabled = features?.viewsEnabled ?? false;
|
|
287
|
+
const publicReadsEnabled = features?.publicReadsEnabled ?? false;
|
|
288
|
+
const etagEnabled = features?.etagEnabled ?? true;
|
|
289
|
+
const policy = http?.responsePolicy ?? config?.get("http.responsePolicy");
|
|
290
|
+
if (policy?.cors)
|
|
291
|
+
resolveCorsConfig(policy.cors);
|
|
292
|
+
const responsePolicy = Object.freeze({
|
|
293
|
+
cors: policy?.cors ? {
|
|
294
|
+
allowedOrigins: [...policy.cors.allowedOrigins ?? []],
|
|
295
|
+
additionalAllowedHeaders: [...policy.cors.additionalAllowedHeaders ?? []]
|
|
296
|
+
} : undefined,
|
|
297
|
+
securityHeaders: policy?.securityHeaders ?? {
|
|
298
|
+
production: http?.production ?? true,
|
|
299
|
+
frontendMode: viewsEnabled ? "server-htmx" : "api"
|
|
300
|
+
},
|
|
301
|
+
maxBodyBytes: policy?.maxBodyBytes ?? 1048576,
|
|
302
|
+
rateLimitPerMinute: policy?.rateLimitPerMinute ?? 120,
|
|
303
|
+
namespace: policy?.namespace ?? "strata",
|
|
304
|
+
trustForwardedFor: policy?.trustForwardedFor ?? false,
|
|
305
|
+
loginRateLimit: Object.freeze({ ...policy?.loginRateLimit ?? resolveLoginRateLimit() }),
|
|
306
|
+
registerRateLimit: Object.freeze({
|
|
307
|
+
...policy?.registerRateLimit ?? resolveRegisterRateLimit()
|
|
308
|
+
})
|
|
309
|
+
});
|
|
310
|
+
const targetOrigin = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN).get(CSRF_TARGET_ORIGIN_CONFIG_KEY) : undefined;
|
|
311
|
+
const configuredCsrfMiddleware = createCsrfMiddleware({ targetOrigin, ...http?.csrf });
|
|
312
|
+
return {
|
|
313
|
+
emailVerificationRequired,
|
|
314
|
+
viewsEnabled,
|
|
315
|
+
publicReadsEnabled,
|
|
316
|
+
etagEnabled,
|
|
317
|
+
responsePolicy,
|
|
318
|
+
configuredCsrfMiddleware
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
function createHttpResponseMiddleware(dependencies, settings, errorFormat) {
|
|
322
|
+
return [
|
|
323
|
+
createCorsMiddleware(settings.responsePolicy.cors),
|
|
324
|
+
createSecurityHeadersMiddleware(settings.responsePolicy.securityHeaders),
|
|
325
|
+
createBodySizeLimitMiddleware(settings.responsePolicy.maxBodyBytes),
|
|
326
|
+
...dependencies.container.has(CORE_TRACING_RUNTIME_TOKEN) ? [createTracingMiddleware(dependencies.container.resolve(CORE_TRACING_RUNTIME_TOKEN))] : [],
|
|
327
|
+
createMetricsMiddleware(),
|
|
328
|
+
createRequestLoggingMiddleware(settings.responsePolicy.trustForwardedFor),
|
|
329
|
+
requestIdMiddleware,
|
|
330
|
+
errorFormat === "json" ? createJsonErrorMiddleware() : createWebErrorMiddleware({
|
|
331
|
+
enabled: settings.viewsEnabled,
|
|
332
|
+
production: dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS).production ?? true : true,
|
|
333
|
+
render: dependencies.container.has(CORE_WEB_ERROR_VIEW_TOKEN) ? dependencies.container.resolve(CORE_WEB_ERROR_VIEW_TOKEN) : undefined
|
|
334
|
+
})
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// ../../src/bootstrap/moduleRouteMiddleware.ts
|
|
339
|
+
function enterModuleRoutes(routes, enter) {
|
|
340
|
+
const wrapped = {};
|
|
341
|
+
for (const [path, value] of Object.entries(routes)) {
|
|
342
|
+
if (value instanceof Response) {
|
|
343
|
+
const methods = {};
|
|
344
|
+
for (const method of ["GET", "HEAD", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]) {
|
|
345
|
+
methods[method] = enter(() => value.clone());
|
|
346
|
+
}
|
|
347
|
+
wrapped[path] = methods;
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
if (typeof value === "function") {
|
|
351
|
+
wrapped[path] = enter(value);
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
355
|
+
const entries = Object.entries(value);
|
|
356
|
+
if (entries.some(([, handler]) => typeof handler === "function" || handler instanceof Response)) {
|
|
357
|
+
wrapped[path] = Object.fromEntries(entries.map(([method, handler]) => {
|
|
358
|
+
const callback = handler instanceof Response ? () => handler.clone() : handler;
|
|
359
|
+
return [
|
|
360
|
+
method,
|
|
361
|
+
typeof callback === "function" ? enter(callback) : callback
|
|
362
|
+
];
|
|
363
|
+
}));
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
wrapped[path] = value;
|
|
368
|
+
}
|
|
369
|
+
return wrapped;
|
|
370
|
+
}
|
|
371
|
+
|
|
314
372
|
// ../../src/bootstrap/httpKernel.ts
|
|
315
373
|
class HttpKernel {
|
|
316
374
|
dependencies;
|
|
@@ -329,38 +387,16 @@ class HttpKernel {
|
|
|
329
387
|
this.dependencies = dependencies;
|
|
330
388
|
const http = dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS) : undefined;
|
|
331
389
|
this.httpOptions = http;
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
this.
|
|
335
|
-
this.
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
|
|
339
|
-
if (policy?.cors)
|
|
340
|
-
resolveCorsConfig(policy.cors);
|
|
341
|
-
this.responsePolicy = Object.freeze({
|
|
342
|
-
cors: policy?.cors ? {
|
|
343
|
-
allowedOrigins: [...policy.cors.allowedOrigins ?? []],
|
|
344
|
-
additionalAllowedHeaders: [...policy.cors.additionalAllowedHeaders ?? []]
|
|
345
|
-
} : undefined,
|
|
346
|
-
securityHeaders: policy?.securityHeaders ?? {
|
|
347
|
-
production: http?.production ?? true,
|
|
348
|
-
frontendMode: this.viewsEnabled ? "server-htmx" : "api"
|
|
349
|
-
},
|
|
350
|
-
maxBodyBytes: policy?.maxBodyBytes ?? 1048576,
|
|
351
|
-
rateLimitPerMinute: policy?.rateLimitPerMinute ?? 120,
|
|
352
|
-
namespace: policy?.namespace ?? "strata",
|
|
353
|
-
trustForwardedFor: policy?.trustForwardedFor ?? false,
|
|
354
|
-
loginRateLimit: Object.freeze({ ...policy?.loginRateLimit ?? resolveLoginRateLimit() }),
|
|
355
|
-
registerRateLimit: Object.freeze({
|
|
356
|
-
...policy?.registerRateLimit ?? resolveRegisterRateLimit()
|
|
357
|
-
})
|
|
358
|
-
});
|
|
359
|
-
const targetOrigin = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN).get(CSRF_TARGET_ORIGIN_CONFIG_KEY) : undefined;
|
|
360
|
-
this.configuredCsrfMiddleware = createCsrfMiddleware({ targetOrigin, ...http?.csrf });
|
|
390
|
+
const settings = resolveHttpResponseSettings(dependencies, http);
|
|
391
|
+
this.emailVerificationRequired = settings.emailVerificationRequired;
|
|
392
|
+
this.viewsEnabled = settings.viewsEnabled;
|
|
393
|
+
this.publicReadsEnabled = settings.publicReadsEnabled;
|
|
394
|
+
this.etagEnabled = settings.etagEnabled;
|
|
395
|
+
this.responsePolicy = settings.responsePolicy;
|
|
396
|
+
this.configuredCsrfMiddleware = settings.configuredCsrfMiddleware;
|
|
361
397
|
this.responses = Object.freeze({
|
|
362
|
-
json: Object.freeze(
|
|
363
|
-
web: Object.freeze(
|
|
398
|
+
json: Object.freeze(createHttpResponseMiddleware(dependencies, settings, "json")),
|
|
399
|
+
web: Object.freeze(createHttpResponseMiddleware(dependencies, settings, "web"))
|
|
364
400
|
});
|
|
365
401
|
this.persistence = dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? createHttpPersistence(dependencies.invoke, dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS)) : undefined;
|
|
366
402
|
if (dependencies.container.has(CORE_HTTP_CLEANUP_TOKEN)) {
|
|
@@ -455,22 +491,6 @@ class HttpKernel {
|
|
|
455
491
|
throw new TypeError("SCIM and identity operation declarations cannot be combined.");
|
|
456
492
|
return this.composed(handler, "json", undefined, Object.freeze([...before]));
|
|
457
493
|
}
|
|
458
|
-
responseMiddleware(errorFormat) {
|
|
459
|
-
return [
|
|
460
|
-
createCorsMiddleware(this.responsePolicy.cors),
|
|
461
|
-
createSecurityHeadersMiddleware(this.responsePolicy.securityHeaders),
|
|
462
|
-
createBodySizeLimitMiddleware(this.responsePolicy.maxBodyBytes),
|
|
463
|
-
...this.dependencies.container.has(CORE_TRACING_RUNTIME_TOKEN) ? [createTracingMiddleware(this.dependencies.container.resolve(CORE_TRACING_RUNTIME_TOKEN))] : [],
|
|
464
|
-
createMetricsMiddleware(),
|
|
465
|
-
createRequestLoggingMiddleware(this.responsePolicy.trustForwardedFor),
|
|
466
|
-
requestIdMiddleware,
|
|
467
|
-
errorFormat === "json" ? createJsonErrorMiddleware() : createWebErrorMiddleware({
|
|
468
|
-
enabled: this.viewsEnabled,
|
|
469
|
-
production: this.dependencies.container.has(HTTP_PERSISTENCE_OPTIONS) ? this.dependencies.container.resolve(HTTP_PERSISTENCE_OPTIONS).production ?? true : true,
|
|
470
|
-
render: this.dependencies.container.has(CORE_WEB_ERROR_VIEW_TOKEN) ? this.dependencies.container.resolve(CORE_WEB_ERROR_VIEW_TOKEN) : undefined
|
|
471
|
-
})
|
|
472
|
-
];
|
|
473
|
-
}
|
|
474
494
|
wrapPublicDocument(handler) {
|
|
475
495
|
assertHttpHandler(handler);
|
|
476
496
|
return ownedPublicHttpRoute(handler, (request, work) => Promise.resolve(withMiddleware(...this.responses.web)(work)(request)));
|
package/dist/entries/config.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
CORE_EVENT_BUS_TOKEN,
|
|
10
10
|
CORE_HTTP_CLEANUP_TOKEN,
|
|
11
11
|
CORE_POLICY_GATE_TOKEN,
|
|
12
|
+
CORE_POLICY_REGISTRY_TOKEN,
|
|
12
13
|
CORE_PUBLIC_TENANCY_TOKEN,
|
|
13
14
|
CORE_QUEUE_TOKEN,
|
|
14
15
|
CORE_TENANT_RESOLVER_TOKEN,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
CORE_EVENT_BUS_TOKEN,
|
|
43
44
|
CORE_HTTP_CLEANUP_TOKEN,
|
|
44
45
|
CORE_POLICY_GATE_TOKEN,
|
|
46
|
+
CORE_POLICY_REGISTRY_TOKEN,
|
|
45
47
|
CORE_PUBLIC_TENANCY_TOKEN,
|
|
46
48
|
CORE_QUEUE_TOKEN,
|
|
47
49
|
CORE_TENANT_RESOLVER_TOKEN,
|