@cosmicdrift/kumiko-server-runtime 0.424.0 → 0.424.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.
|
@@ -37,8 +37,8 @@ export declare function applyStandardBootSeeds(deps: {
|
|
|
37
37
|
}>;
|
|
38
38
|
type SharedAuthFlowFields = Pick<RunProdAppAuthOptions, "passwordReset" | "emailVerification" | "accountUnlock" | "signup" | "invite">;
|
|
39
39
|
type AuthFlowRoutes = Pick<AuthRoutesConfig, "passwordReset" | "emailVerification" | "accountUnlock" | "signup" | "invite">;
|
|
40
|
-
export type SharedAuthRouteSource = SharedAuthFlowFields & Pick<RunProdAppAuthOptions, "loginErrorStatusMap" | "cookieDomain" | "retiredCookieDomains" | "allowedOrigins" | "unsafeSkipOriginCheck" | "postAuthLanding">;
|
|
41
|
-
export type SharedAuthRoutes = AuthFlowRoutes & Pick<AuthRoutesConfig, "membershipQuery" | "loginHandler" | "loginErrorStatusMap" | "cookieDomain" | "retiredCookieDomains" | "allowedOrigins" | "unsafeSkipOriginCheck" | "postAuthLanding" | "mfaVerifyHandler" | "switchTenantMfaGateHandler" | "mfaPreauthEnableStartHandler" | "mfaPreauthConfirmHandler">;
|
|
40
|
+
export type SharedAuthRouteSource = SharedAuthFlowFields & Pick<RunProdAppAuthOptions, "loginErrorStatusMap" | "sessionExchangeHandlers" | "sessionExchangeRateLimit" | "cookieDomain" | "retiredCookieDomains" | "allowedOrigins" | "unsafeSkipOriginCheck" | "postAuthLanding">;
|
|
41
|
+
export type SharedAuthRoutes = AuthFlowRoutes & Pick<AuthRoutesConfig, "membershipQuery" | "loginHandler" | "loginErrorStatusMap" | "sessionExchangeHandlers" | "sessionExchangeRateLimit" | "cookieDomain" | "retiredCookieDomains" | "allowedOrigins" | "unsafeSkipOriginCheck" | "postAuthLanding" | "mfaVerifyHandler" | "switchTenantMfaGateHandler" | "mfaPreauthEnableStartHandler" | "mfaPreauthConfirmHandler">;
|
|
42
42
|
export declare function buildSharedAuthRoutes(effectiveAuth: SharedAuthRouteSource, hasMfa: boolean): SharedAuthRoutes;
|
|
43
43
|
export declare function waitForKmsHealthy(kms: KmsAdapter, processName: string, deadline: number, clock?: DatabaseWaitClock): Promise<void>;
|
|
44
44
|
export declare function openDatabasePools(databaseUrl: string, envSource: Record<string, string | undefined>, rowLevelSecurity: RowLevelSecurityMode): {
|
|
@@ -119,6 +119,12 @@ function buildAuthFlowRoutes(effectiveAuth) {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
export function buildSharedAuthRoutes(effectiveAuth, hasMfa) {
|
|
122
|
+
// The exchange route mints sessions without a second factor, so with auth-mfa
|
|
123
|
+
// mounted it would be a way around MFA.
|
|
124
|
+
if (hasMfa && Object.keys(effectiveAuth.sessionExchangeHandlers ?? {}).length > 0) {
|
|
125
|
+
throw new Error("[kumiko:boot] session-exchange handlers cannot enforce MFA yet; " +
|
|
126
|
+
"unmount auth-mfa or remove sessionExchangeHandlers.");
|
|
127
|
+
}
|
|
122
128
|
return {
|
|
123
129
|
membershipQuery: TenantQueries.memberships,
|
|
124
130
|
loginHandler: AuthHandlers.login,
|
|
@@ -126,6 +132,12 @@ export function buildSharedAuthRoutes(effectiveAuth, hasMfa) {
|
|
|
126
132
|
[AuthErrors.invalidCredentials]: 401,
|
|
127
133
|
[AuthErrors.noMembership]: 403,
|
|
128
134
|
},
|
|
135
|
+
...(effectiveAuth.sessionExchangeRateLimit !== undefined && {
|
|
136
|
+
sessionExchangeRateLimit: effectiveAuth.sessionExchangeRateLimit,
|
|
137
|
+
}),
|
|
138
|
+
...(effectiveAuth.sessionExchangeHandlers !== undefined && {
|
|
139
|
+
sessionExchangeHandlers: effectiveAuth.sessionExchangeHandlers,
|
|
140
|
+
}),
|
|
129
141
|
...(effectiveAuth.cookieDomain !== undefined && {
|
|
130
142
|
cookieDomain: effectiveAuth.cookieDomain,
|
|
131
143
|
}),
|
package/dist/run-prod-app.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="bun-types" preserve="true" />
|
|
2
2
|
import type { AccountLockoutOptions, AccountUnlockOptions, AuthMailLocale, AuthPaths, EmailVerificationOptions, InviteOptions, PasswordResetOptions, SignupOptions } from "@cosmicdrift/kumiko-bundled-features/auth-email-password";
|
|
3
3
|
import type { SeedAdminOptions } from "@cosmicdrift/kumiko-bundled-features/auth-email-password/seeding";
|
|
4
|
-
import type { ExtraRouteDefinition, KumikoServeEnv, PostAuthLandingResolver, SseBroker } from "@cosmicdrift/kumiko-framework/api";
|
|
4
|
+
import type { ExtraRouteDefinition, KumikoServeEnv, LoginRateLimiter, PostAuthLandingResolver, SseBroker } from "@cosmicdrift/kumiko-framework/api";
|
|
5
5
|
import type { KmsAdapter } from "@cosmicdrift/kumiko-framework/crypto";
|
|
6
6
|
import { type RowLevelSecurityMode } from "@cosmicdrift/kumiko-framework/db";
|
|
7
7
|
import type { BundledListsOptions, FeatureDefinition, ValidateBootOptions } from "@cosmicdrift/kumiko-framework/engine";
|
|
@@ -107,6 +107,12 @@ export type RunProdAppAuthOptions = {
|
|
|
107
107
|
readonly admin?: SeedAdminOptions;
|
|
108
108
|
/** Optional override of the login error → HTTP status map. */
|
|
109
109
|
readonly loginErrorStatusMap?: Readonly<Record<string, number>>;
|
|
110
|
+
/** Method → QN of an anonymous write handler that verifies the identity itself
|
|
111
|
+
* and returns `{ kind: "auth-session", session }`; served by POST /auth/session-exchange. */
|
|
112
|
+
readonly sessionExchangeHandlers?: Readonly<Record<string, string>>;
|
|
113
|
+
/** Rate limit for POST /auth/session-exchange (IP + method, no reset). Unset reuses the login
|
|
114
|
+
* limiter; `null` disables. */
|
|
115
|
+
readonly sessionExchangeRateLimit?: LoginRateLimiter | null;
|
|
110
116
|
/** Wires all five mail flows (passwordReset, emailVerification, signup,
|
|
111
117
|
* invite, accountUnlock) from `auth.mail.baseUrl` plus the default paths,
|
|
112
118
|
* mailing via delivery (ctx.notify).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-server-runtime",
|
|
3
|
-
"version": "0.424.
|
|
3
|
+
"version": "0.424.1",
|
|
4
4
|
"description": "Production server-boot runtime for Kumiko apps: connections, schema-drift-gate, seeds, lifecycle, graceful shutdown. Symmetric to kumiko-dev-server's runDevApp, without dev/scaffold tooling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -100,11 +100,11 @@
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
"dependencies": {
|
|
103
|
-
"@cosmicdrift/kumiko-bundled-features": "0.424.
|
|
104
|
-
"@cosmicdrift/kumiko-framework": "0.424.
|
|
105
|
-
"@cosmicdrift/kumiko-renderer": "0.424.
|
|
106
|
-
"@cosmicdrift/kumiko-renderer-mail-html": "0.424.
|
|
107
|
-
"@cosmicdrift/kumiko-types": "0.424.
|
|
103
|
+
"@cosmicdrift/kumiko-bundled-features": "0.424.1",
|
|
104
|
+
"@cosmicdrift/kumiko-framework": "0.424.1",
|
|
105
|
+
"@cosmicdrift/kumiko-renderer": "0.424.1",
|
|
106
|
+
"@cosmicdrift/kumiko-renderer-mail-html": "0.424.1",
|
|
107
|
+
"@cosmicdrift/kumiko-types": "0.424.1",
|
|
108
108
|
"ioredis": "^5.11.1",
|
|
109
109
|
"temporal-polyfill": "^0.3.2",
|
|
110
110
|
"zod": "^4.6.7"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"bun-types": "^1.4.4"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@cosmicdrift/kumiko-testing": "0.424.
|
|
116
|
+
"@cosmicdrift/kumiko-testing": "0.424.1",
|
|
117
117
|
"bun-types": "^1.4.4"
|
|
118
118
|
},
|
|
119
119
|
"publishConfig": {
|