@aotter/mantle-cloudflare 0.1.2 → 0.1.3-alpha.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/README.md +6 -0
- package/dist/auth/conventionalAuth.d.ts +1 -1
- package/dist/auth/conventionalAuth.d.ts.map +1 -1
- package/dist/auth/conventionalAuth.js +2 -1
- package/dist/auth/conventionalAuth.js.map +1 -1
- package/dist/auth/createAuth.d.ts +15 -426
- package/dist/auth/createAuth.d.ts.map +1 -1
- package/dist/auth/createAuth.js +24 -1260
- package/dist/auth/createAuth.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/mount/bootRuntimeOnce.d.ts +1 -1
- package/dist/mount/bootRuntimeOnce.d.ts.map +1 -1
- package/dist/mount/cmsConfig.d.ts +1 -1
- package/dist/mount/cmsConfig.d.ts.map +1 -1
- package/dist/mount/index.d.ts +1 -1
- package/dist/mount/index.d.ts.map +1 -1
- package/dist/mount/index.js +1 -1
- package/dist/mount/index.js.map +1 -1
- package/dist/mount/mountMcp.d.ts.map +1 -1
- package/dist/mount/mountMcp.js +62 -32
- package/dist/mount/mountMcp.js.map +1 -1
- package/dist/mount/mountPublicRoutes.js +1 -1
- package/dist/mount/mountPublicRoutes.js.map +1 -1
- package/dist/mount/mountRuntimeEndpoints.d.ts.map +1 -1
- package/dist/mount/mountRuntimeEndpoints.js +5 -11
- package/dist/mount/mountRuntimeEndpoints.js.map +1 -1
- package/dist/mount/resolveCaller.d.ts +32 -2
- package/dist/mount/resolveCaller.d.ts.map +1 -1
- package/dist/mount/resolveCaller.js +71 -13
- package/dist/mount/resolveCaller.js.map +1 -1
- package/dist/worker/createMantleWorker.d.ts +1 -1
- package/dist/worker/createMantleWorker.d.ts.map +1 -1
- package/package.json +6 -8
- package/dist/auth/ConsoleEmailSender.d.ts +0 -15
- package/dist/auth/ConsoleEmailSender.d.ts.map +0 -1
- package/dist/auth/ConsoleEmailSender.js +0 -19
- package/dist/auth/ConsoleEmailSender.js.map +0 -1
- package/dist/auth/appleClientSecret.d.ts +0 -72
- package/dist/auth/appleClientSecret.d.ts.map +0 -1
- package/dist/auth/appleClientSecret.js +0 -113
- package/dist/auth/appleClientSecret.js.map +0 -1
- package/dist/auth/emailTemplates.d.ts +0 -7
- package/dist/auth/emailTemplates.d.ts.map +0 -1
- package/dist/auth/emailTemplates.js +0 -27
- package/dist/auth/emailTemplates.js.map +0 -1
package/README.md
CHANGED
|
@@ -91,6 +91,12 @@ with Mantle's `EmailSender`; raw `plugins` are available when the application
|
|
|
91
91
|
must own the callback and UI. The hosted-auth and self-hosted-auth boundary is documented in
|
|
92
92
|
`node_modules/@aotter/mantle/docs/auth-hosting-model.md`.
|
|
93
93
|
|
|
94
|
+
Rate-limit identity uses `CF-Connecting-IP` only. `createAuth` always passes
|
|
95
|
+
`ipAddressHeaders: ["cf-connecting-ip"]` into `@aotter/mantle-auth`. The
|
|
96
|
+
portable package has no Cloudflare default and will not boot without a
|
|
97
|
+
host-trusted header list; do not fall back to client-controlled
|
|
98
|
+
`X-Forwarded-For`.
|
|
99
|
+
|
|
94
100
|
For trusted first-party apps that share one parent domain, configure
|
|
95
101
|
same-parent-domain cookies explicitly:
|
|
96
102
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventionalAuth.d.ts","sourceRoot":"","sources":["../../src/auth/conventionalAuth.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"conventionalAuth.d.ts","sourceRoot":"","sources":["../../src/auth/conventionalAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,IAAI,IAAI,EACxB,MAAM,qBAAqB,CAAC;AAI7B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI,CA+FrE;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAExE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,mBAAmB,GAAG,MAAM,CAExE;AAED,sEAAsE;AACtE,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAG1B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createSetupIncompleteAuth, isSetupIncompleteAuth, } from "@aotter/mantle-auth";
|
|
2
|
+
import { createAuth } from "./createAuth.js";
|
|
2
3
|
import { applyCachePolicy } from "../oauth/cachePolicy.js";
|
|
3
4
|
/** Choose hosted or self-managed GitHub Auth, otherwise fail closed. */
|
|
4
5
|
export function createConventionalAuth(env) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conventionalAuth.js","sourceRoot":"","sources":["../../src/auth/conventionalAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"conventionalAuth.js","sourceRoot":"","sources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CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAQ;IAChC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,CACrE,GAAG,CAAC,QAAQ,KAAK,OAAO;QACxB,CAAC,GAAG,CAAC,QAAQ,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,CAAC,CAC3F,CAAC,CAAC;AACL,CAAC;AAED,SAAS,WAAW,CAAC,GAAY;IAC/B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,kDAAkD,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACnG,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE;QACZ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,KAAK,CAAC,GAA8B;IAC3C,OAAO,GAAG,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;AAC7B,CAAC"}
|
|
@@ -1,433 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
* Set lookup for "is this role string a staff role?" — handlers/MCP
|
|
13
|
-
* gating reach for this every request, so the Set form is worth the
|
|
14
|
-
* one-time allocation over `STAFF_ROLES.includes(x)`.
|
|
15
|
-
*/
|
|
16
|
-
export declare const STAFF_ROLE_SET: ReadonlySet<string>;
|
|
17
|
-
/**
|
|
18
|
-
* Provider id for the `kind: "social"` method — Better Auth's own
|
|
19
|
-
* `socialProviders` block keys. The config flows through to Better
|
|
20
|
-
* Auth as-is; no per-provider wiring in this adapter (beyond the
|
|
21
|
-
* github `mapProfileToUser` shim).
|
|
22
|
-
*/
|
|
23
|
-
export type SocialProviderId = keyof SocialProviders;
|
|
24
|
-
type SocialAuthMethodConfig = {
|
|
25
|
-
[Provider in SocialProviderId]: {
|
|
26
|
-
readonly kind: "social";
|
|
27
|
-
readonly provider: Provider;
|
|
28
|
-
/** Native Better Auth options for this provider, including async factories. */
|
|
29
|
-
readonly options: NonNullable<SocialProviders[Provider]>;
|
|
30
|
-
};
|
|
31
|
-
}[SocialProviderId];
|
|
32
|
-
/**
|
|
33
|
-
* Auth method config (discriminated union). Each `kind` is one auth
|
|
34
|
-
* surface adopters can opt into; adding a new method = adding a new
|
|
35
|
-
* union case here, not a new top-level key on `CreateAuthConfig` —
|
|
36
|
-
* per ADR-0014.
|
|
37
|
-
*
|
|
38
|
-
* `kind: "social"` is the OAuth-based bucket — `provider` discriminates
|
|
39
|
-
* the upstream IDP. We use one case rather than one-per-provider so
|
|
40
|
-
* adding (e.g.) Apple doesn't churn Mantle-owned fields; Better Auth's
|
|
41
|
-
* provider-specific options remain natively typed under `options`.
|
|
42
|
-
*/
|
|
43
|
-
export type AuthMethodConfig = SocialAuthMethodConfig | {
|
|
44
|
-
readonly kind: "oauth";
|
|
45
|
-
/** Human label surfaced by `/api/auth/methods` so the admin SPA
|
|
46
|
-
* can render "Continue with Mantle Platform" without knowing
|
|
47
|
-
* product-specific provider ids. */
|
|
48
|
-
readonly displayName?: string;
|
|
49
|
-
/** Native Better Auth generic OAuth configuration. */
|
|
50
|
-
readonly options: GenericOAuthConfig;
|
|
51
|
-
} | {
|
|
52
|
-
readonly kind: "email-otp";
|
|
53
|
-
/** Transactional-email sender. SDK never owns body templates;
|
|
54
|
-
* the locale is passed through so the sender can branch. */
|
|
55
|
-
readonly sender: EmailSender;
|
|
56
|
-
/** Native Better Auth options. Mantle owns the sender callback and defaults storage to hashed. */
|
|
57
|
-
readonly options?: Omit<EmailOTPOptions, "sendVerificationOTP">;
|
|
58
|
-
/** Fallback locale when the request carries no Accept-Language —
|
|
59
|
-
* typically the site's canonical locale. BCP 47. Defaults to "en". */
|
|
60
|
-
readonly fallbackLocale?: string;
|
|
61
|
-
} | {
|
|
62
|
-
readonly kind: "magic-link";
|
|
63
|
-
/** Transactional-email sender. The email body carries a single
|
|
64
|
-
* clickable URL; Better Auth verifies the token when the user
|
|
65
|
-
* lands on it. */
|
|
66
|
-
readonly sender: EmailSender;
|
|
67
|
-
/** Native Better Auth options. Mantle owns the sender callback and defaults storage to hashed. */
|
|
68
|
-
readonly options?: Omit<MagicLinkOptions, "sendMagicLink">;
|
|
69
|
-
/** Fallback locale when the request carries no Accept-Language. */
|
|
70
|
-
readonly fallbackLocale?: string;
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* First-staff promotion rule. Decoupled from `methods[]` so switching
|
|
74
|
-
* the bootstrap signal (e.g. `github-login` → `email`) doesn't touch
|
|
75
|
-
* any method's options.
|
|
76
|
-
*
|
|
77
|
-
* Promotion fires on `user.create.after`, which Better Auth dispatches
|
|
78
|
-
* **only on first user creation**. If the operator signs in via one
|
|
79
|
-
* method (say GitHub) before the rule can match (say `match: "email"`
|
|
80
|
-
* with a non-GitHub email), the user row is created and a later
|
|
81
|
-
* sign-in via a different method on the SAME email reuses that row —
|
|
82
|
-
* `create.after` does not re-fire and the owner role is never
|
|
83
|
-
* assigned. Match key first; the linked second method inherits the
|
|
84
|
-
* role via the shared `user.id`.
|
|
85
|
-
*
|
|
86
|
-
* `match: "github-login"` is also brittle when multiple social
|
|
87
|
-
* methods are registered. Only the `github` provider's
|
|
88
|
-
* `mapProfileToUser` shim populates `user.githubLogin`; if the
|
|
89
|
-
* operator's first sign-in is via Google or another non-GitHub
|
|
90
|
-
* social, `githubLogin` is null and the rule silently no-ops. For
|
|
91
|
-
* mixed-social setups prefer `match: "email"`.
|
|
92
|
-
*/
|
|
93
|
-
export type BootstrapOwnerRule = {
|
|
94
|
-
readonly match: "github-login";
|
|
95
|
-
readonly value: string;
|
|
96
|
-
} | {
|
|
97
|
-
readonly match: "email";
|
|
98
|
-
readonly value: string;
|
|
99
|
-
};
|
|
100
|
-
export interface CrossSubDomainCookiesConfig {
|
|
101
|
-
readonly enabled: boolean;
|
|
102
|
-
readonly domain?: string;
|
|
103
|
-
}
|
|
104
|
-
export interface OAuthProviderConfig {
|
|
105
|
-
/** Provider scopes. Include `openid` to expose a real OIDC server. */
|
|
106
|
-
readonly scopes?: ReadonlyArray<Scope>;
|
|
107
|
-
/** Better Auth OAuth provider login page. Usually `/admin/sign-in`
|
|
108
|
-
* or a platform owner sign-in route. */
|
|
109
|
-
readonly loginPage: string;
|
|
110
|
-
/** Page that calls `/oauth2/consent` after owner approval. */
|
|
111
|
-
readonly consentPage: string;
|
|
112
|
-
readonly allowDynamicClientRegistration?: boolean;
|
|
113
|
-
readonly allowUnauthenticatedClientRegistration?: boolean;
|
|
114
|
-
readonly clientRegistrationDefaultScopes?: ReadonlyArray<Scope>;
|
|
115
|
-
readonly clientRegistrationAllowedScopes?: ReadonlyArray<Scope>;
|
|
116
|
-
/** MCP resources still require a persisted user consent; do not bypass it. */
|
|
117
|
-
readonly cachedTrustedClients?: ReadonlySet<string>;
|
|
118
|
-
/** Protected resources this authorization server may issue tokens for. */
|
|
119
|
-
readonly resources?: ReadonlyArray<string>;
|
|
120
|
-
/** Resources linked to newly registered public clients. Does not bypass consent. */
|
|
121
|
-
readonly clientRegistrationDefaultResources?: ReadonlyArray<string>;
|
|
122
|
-
/** Turn this provider into the MCP authorization server for one canonical
|
|
123
|
-
* resource. Cloudflare deployments must enable
|
|
124
|
-
* `global_fetch_strictly_public` for CIMD fetches. */
|
|
125
|
-
readonly mcpResource?: string;
|
|
126
|
-
readonly clientPrivileges?: (context: {
|
|
127
|
-
readonly headers: Headers;
|
|
128
|
-
readonly action: "create" | "read" | "update" | "delete" | "list" | "rotate" | "configure-client-credentials-scopes";
|
|
129
|
-
readonly user?: {
|
|
130
|
-
readonly id: string;
|
|
131
|
-
readonly email: string;
|
|
132
|
-
} & Record<string, unknown>;
|
|
133
|
-
readonly session?: {
|
|
134
|
-
readonly id: string;
|
|
135
|
-
readonly userId: string;
|
|
136
|
-
} & Record<string, unknown>;
|
|
137
|
-
}) => boolean | undefined | Promise<boolean | undefined>;
|
|
138
|
-
}
|
|
139
|
-
export interface RegisterOAuthClientInput {
|
|
140
|
-
/** Current owner/admin request headers. Better Auth enforces its
|
|
141
|
-
* clientPrivileges hook against this session before persistence. */
|
|
142
|
-
readonly requestHeaders: HeadersInit;
|
|
143
|
-
readonly redirectUris: ReadonlyArray<string>;
|
|
144
|
-
readonly scope?: ReadonlyArray<string>;
|
|
145
|
-
readonly clientName?: string;
|
|
146
|
-
readonly clientUri?: string;
|
|
147
|
-
readonly logoUri?: string;
|
|
148
|
-
readonly contacts?: ReadonlyArray<string>;
|
|
149
|
-
readonly tosUri?: string;
|
|
150
|
-
readonly policyUri?: string;
|
|
151
|
-
readonly postLogoutRedirectUris?: ReadonlyArray<string>;
|
|
152
|
-
readonly tokenEndpointAuthMethod?: "none" | "client_secret_basic" | "client_secret_post";
|
|
153
|
-
readonly grantTypes?: ReadonlyArray<"authorization_code" | "client_credentials" | "refresh_token">;
|
|
154
|
-
readonly responseTypes?: ReadonlyArray<"code">;
|
|
155
|
-
readonly applicationType?: "web" | "native";
|
|
156
|
-
/** Not suitable for MCP clients: MCP access requires a persisted user consent. */
|
|
157
|
-
readonly skipConsent?: boolean;
|
|
158
|
-
readonly enableEndSession?: boolean;
|
|
159
|
-
readonly requirePKCE?: boolean;
|
|
160
|
-
readonly subjectType?: "public" | "pairwise";
|
|
161
|
-
readonly metadata?: Record<string, unknown>;
|
|
162
|
-
}
|
|
163
|
-
export interface RegisteredOAuthClient {
|
|
164
|
-
readonly clientId: string;
|
|
165
|
-
readonly clientSecret?: string;
|
|
166
|
-
readonly redirectUris: readonly string[];
|
|
167
|
-
readonly scope?: readonly string[];
|
|
168
|
-
readonly clientName?: string;
|
|
169
|
-
readonly clientUri?: string;
|
|
170
|
-
readonly tokenEndpointAuthMethod?: string;
|
|
171
|
-
readonly applicationType?: "web" | "native";
|
|
172
|
-
}
|
|
173
|
-
export interface CreateAuthConfig {
|
|
1
|
+
import type { AuthSessionCache, CreateMantleAuthOptions, MantleAuth } from "@aotter/mantle-auth";
|
|
2
|
+
/** Ingress header Cloudflare overwrites. `createAuth` always passes this
|
|
3
|
+
* to the portable package; callers do not configure it. */
|
|
4
|
+
export declare const CLOUDFLARE_CLIENT_IP_HEADERS: readonly ["cf-connecting-ip"];
|
|
5
|
+
export { STAFF_ROLE_SET, STAFF_ROLES, buildGenericOAuthProviders, buildOAuthProviderOptions, buildSocialProviders, buildTrustedOriginsFor, createSetupIncompleteAuth, decodeMemberCursor, encodeMemberCursor, getProviderAccessTokenForRequest, guardGithubLoginProfile, hasEmailAuthSurface, hashEmailOtp, isSetupIncompleteAuth, mapRegisteredOAuthClient, normalizeAuthBasePath, normalizeAuthResponseCookies, pickLocale, shouldPromoteToOwner, validateBootstrap, verifyOAuthJwt, verifyOAuthJwtWithLocalJwks, } from "@aotter/mantle-auth";
|
|
6
|
+
export type { AuthMethodConfig, AuthMethodInfo, AuthSessionCache, AuthUserInfo, BootstrapOwnerRule, CrossSubDomainCookiesConfig, InviteUserResult, LinkedAccountInfo, ListMembersArgs, MantleAuth, MantleAuthRequestContext, MemberListResult, MemberUserInfo, OAuthAccessTokenVerification, OAuthConsentInfo, OAuthConsentRequest, OAuthProviderConfig, ProviderAccessToken, RegisterOAuthClientInput, RegisteredOAuthClient, SetupIncompleteAuthOptions, SocialProviderId, StaffRole, StaffUserInfo, } from "@aotter/mantle-auth";
|
|
7
|
+
export type { MantleAuth as Auth } from "@aotter/mantle-auth";
|
|
8
|
+
/** Workers KV as a Better Auth session cache. Key naming and TTL policy stay
|
|
9
|
+
* in `@aotter/mantle-auth`; this only stores what it is handed. */
|
|
10
|
+
export declare function kvSessionCache(kv: KVNamespace): AuthSessionCache;
|
|
11
|
+
export interface CreateAuthConfig extends Omit<CreateMantleAuthOptions, "database" | "driver" | "sessionCache" | "ipAddressHeaders"> {
|
|
174
12
|
readonly database: D1Database;
|
|
175
13
|
/** Deployment-owned KV used by Better Auth for session reads. Session rows
|
|
176
14
|
* stay in D1; verification codes and rate limits never use eventually
|
|
177
15
|
* consistent KV. */
|
|
178
16
|
readonly sessionCacheKv?: KVNamespace;
|
|
179
|
-
readonly baseURL: string;
|
|
180
|
-
/** Better Auth route prefix. Defaults to `/api/auth`. Set this when
|
|
181
|
-
* multiple auth instances live in one Worker, e.g. hosted platform
|
|
182
|
-
* provider + site staff auth + launch GitHub auth. */
|
|
183
|
-
readonly basePath?: string;
|
|
184
|
-
/** Same-origin destination for auth failures. Defaults to `/`. */
|
|
185
|
-
readonly errorURL?: string;
|
|
186
|
-
readonly secret: string;
|
|
187
|
-
/** Registered auth methods. Boot fails fast when this and `plugins` are both empty. */
|
|
188
|
-
readonly methods: ReadonlyArray<AuthMethodConfig>;
|
|
189
|
-
/** Native Better Auth plugins for flows whose callbacks and UI are fully adopter-owned. */
|
|
190
|
-
readonly plugins?: ReadonlyArray<BetterAuthPlugin>;
|
|
191
|
-
/** Sends an English notification after Admin successfully assigns a staff role. */
|
|
192
|
-
readonly staffInvitationSender?: EmailSender;
|
|
193
|
-
/** First-user-becomes-owner rule. Without it, the `owner` role must
|
|
194
|
-
* be assigned manually in D1. */
|
|
195
|
-
readonly bootstrapOwner?: BootstrapOwnerRule;
|
|
196
|
-
/** Better Auth's always-enabled rate limit. Email methods default to
|
|
197
|
-
* 10/minute, others to 100/minute; plugin-specific limits still apply. */
|
|
198
|
-
readonly rateLimit?: {
|
|
199
|
-
readonly window: number;
|
|
200
|
-
readonly max: number;
|
|
201
|
-
};
|
|
202
|
-
/** Additional Better Auth trusted origins. SDK still injects
|
|
203
|
-
* provider-required origins such as Apple automatically. */
|
|
204
|
-
readonly trustedOrigins?: ReadonlyArray<string>;
|
|
205
|
-
/** Forwarded to Better Auth's `advanced.crossSubDomainCookies`.
|
|
206
|
-
* Use only for trusted first-party app families. */
|
|
207
|
-
readonly crossSubDomainCookies?: CrossSubDomainCookiesConfig;
|
|
208
|
-
/** Forwarded to Better Auth's `advanced.cookiePrefix`. Set this
|
|
209
|
-
* when multiple Better Auth apps share a parent cookie domain. */
|
|
210
|
-
readonly cookiePrefix?: string;
|
|
211
|
-
/** HTTPS-only __Host- cookies for isolation from sibling tenant domains.
|
|
212
|
-
* Incompatible with crossSubDomainCookies.enabled. Defaults to false. */
|
|
213
|
-
readonly hostOnlyCookies?: boolean;
|
|
214
|
-
/** Turn this Better Auth instance into an OAuth/OIDC provider.
|
|
215
|
-
* Consumer sites should use `methods: [{ kind: "oauth", ... }]`
|
|
216
|
-
* against its discovery document. */
|
|
217
|
-
readonly oauthProvider?: OAuthProviderConfig;
|
|
218
|
-
}
|
|
219
|
-
export declare function buildTrustedOriginsFor(methods: ReadonlyArray<AuthMethodConfig>, configured?: ReadonlyArray<string>): string[];
|
|
220
|
-
/**
|
|
221
|
-
* Public-facing method descriptor exposed via `Auth.methods` and the
|
|
222
|
-
* `GET /api/auth/methods` endpoint. The `social` kind carries the
|
|
223
|
-
* upstream `provider` so the admin SPA can render a per-provider
|
|
224
|
-
* button (label + future brand icon). Secrets, senders, and per-
|
|
225
|
-
* provider extras stay private.
|
|
226
|
-
*/
|
|
227
|
-
export type AuthMethodInfo = {
|
|
228
|
-
readonly kind: "email-otp";
|
|
229
|
-
} | {
|
|
230
|
-
readonly kind: "magic-link";
|
|
231
|
-
} | {
|
|
232
|
-
readonly kind: "social";
|
|
233
|
-
readonly provider: SocialProviderId;
|
|
234
|
-
} | {
|
|
235
|
-
readonly kind: "oauth";
|
|
236
|
-
readonly providerId: string;
|
|
237
|
-
readonly displayName?: string;
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Linked-account row as exposed to consumers. Mirrors the BA `account`
|
|
241
|
-
* table's identity columns; OAuth tokens and other secret-shaped
|
|
242
|
-
* columns are intentionally excluded — callers should never need them
|
|
243
|
-
* to render a "signed in via <provider>" list.
|
|
244
|
-
*/
|
|
245
|
-
export interface LinkedAccountInfo {
|
|
246
|
-
readonly id: string;
|
|
247
|
-
readonly providerId: string;
|
|
248
|
-
readonly accountId: string;
|
|
249
|
-
readonly createdAt: Date;
|
|
250
|
-
readonly updatedAt: Date;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* User row as exposed to the staff-management surface. Mirrors the BA
|
|
254
|
-
* `user` table's identity columns; password hashes, ban metadata, and
|
|
255
|
-
* other secret-shaped columns are intentionally excluded.
|
|
256
|
-
*
|
|
257
|
-
* `emailVerified: false` + no linked account identifies a pending
|
|
258
|
-
* invitation; invited rows already carry their requested staff role.
|
|
259
|
-
*/
|
|
260
|
-
export interface StaffUserInfo {
|
|
261
|
-
readonly id: string;
|
|
262
|
-
readonly email: string;
|
|
263
|
-
readonly name: string;
|
|
264
|
-
readonly role: string | null;
|
|
265
|
-
readonly githubLogin: string | null;
|
|
266
|
-
readonly emailVerified: boolean;
|
|
267
|
-
readonly createdAt: Date;
|
|
268
|
-
}
|
|
269
|
-
export type MemberUserInfo = Pick<StaffUserInfo, "id" | "email" | "name" | "emailVerified" | "createdAt">;
|
|
270
|
-
export interface MemberListResult {
|
|
271
|
-
readonly items: readonly MemberUserInfo[];
|
|
272
|
-
readonly previousCursor: string | null;
|
|
273
|
-
readonly nextCursor: string | null;
|
|
274
|
-
}
|
|
275
|
-
export interface ListMembersArgs {
|
|
276
|
-
readonly search?: string;
|
|
277
|
-
readonly cursor?: string;
|
|
278
|
-
readonly cursorDirection?: "forward" | "backward";
|
|
279
|
-
readonly limit: number;
|
|
280
|
-
}
|
|
281
|
-
/** Stable, secret-free user projection for consumer-owned services. */
|
|
282
|
-
export interface AuthUserInfo extends StaffUserInfo {
|
|
283
|
-
readonly image: string | null;
|
|
284
|
-
}
|
|
285
|
-
/** Result of `inviteUser`. `exists` carries the prior row's id so the
|
|
286
|
-
* caller can point the operator at the existing user instead of
|
|
287
|
-
* surfacing a bare failure. */
|
|
288
|
-
export type InviteUserResult = {
|
|
289
|
-
readonly kind: "created";
|
|
290
|
-
readonly id: string;
|
|
291
|
-
} | {
|
|
292
|
-
readonly kind: "exists";
|
|
293
|
-
readonly id: string;
|
|
294
|
-
};
|
|
295
|
-
export interface ProviderAccessToken {
|
|
296
|
-
readonly accessToken: string;
|
|
297
|
-
readonly accessTokenExpiresAt?: Date;
|
|
298
|
-
readonly scopes: readonly string[];
|
|
299
|
-
}
|
|
300
|
-
export type OAuthAccessTokenVerification = {
|
|
301
|
-
readonly ok: true;
|
|
302
|
-
readonly userId: string;
|
|
303
|
-
readonly clientId: string | null;
|
|
304
|
-
readonly credentialId: string | null;
|
|
305
|
-
readonly scopes: readonly string[];
|
|
306
|
-
} | {
|
|
307
|
-
readonly ok: false;
|
|
308
|
-
readonly status: 401 | 403;
|
|
309
|
-
readonly reason: "invalid-token" | "invalid-dpop-proof" | "insufficient-scope";
|
|
310
|
-
readonly missingScopes?: readonly string[];
|
|
311
|
-
};
|
|
312
|
-
export interface Auth {
|
|
313
|
-
readonly basePath: string;
|
|
314
|
-
/** Better Auth's per-isolate context; Workers must anchor this before responding. */
|
|
315
|
-
readonly ready?: Promise<void>;
|
|
316
|
-
/** Canonical MCP protected resource when this Auth owns one. */
|
|
317
|
-
readonly mcpResource?: string;
|
|
318
|
-
readonly handler: (request: Request) => Promise<Response>;
|
|
319
|
-
readonly getSession: (request: Request) => Promise<{
|
|
320
|
-
session: {
|
|
321
|
-
id: string;
|
|
322
|
-
userId: string;
|
|
323
|
-
expiresAt: Date;
|
|
324
|
-
};
|
|
325
|
-
user: {
|
|
326
|
-
id: string;
|
|
327
|
-
email: string;
|
|
328
|
-
name: string;
|
|
329
|
-
image?: string | null;
|
|
330
|
-
role?: string | null;
|
|
331
|
-
/** The role came from the same uncached database read as this session. */
|
|
332
|
-
roleCurrent?: true;
|
|
333
|
-
githubLogin?: string | null;
|
|
334
|
-
};
|
|
335
|
-
} | null>;
|
|
336
|
-
/** Authoritative `user.role` lookup. Protected Admin, MCP, preview,
|
|
337
|
-
* and HTTP Trigger calls use this on every request so custom Auth
|
|
338
|
-
* session snapshots cannot retain revoked staff access. */
|
|
339
|
-
readonly getUserRole: (userId: string) => Promise<string | null>;
|
|
340
|
-
/** Read one Better Auth-owned user without coupling consumers to its SQL schema.
|
|
341
|
-
* Optional so existing custom Auth implementations remain source-compatible. */
|
|
342
|
-
readonly getUser?: (userId: string) => Promise<AuthUserInfo | null>;
|
|
343
|
-
/** Retrieve (and, when expired, refresh) a linked provider token for
|
|
344
|
-
* the user identified by the current local session request. Refresh
|
|
345
|
-
* tokens and account rows are never returned. */
|
|
346
|
-
readonly getProviderAccessToken: (request: Request, providerId: string) => Promise<ProviderAccessToken>;
|
|
347
|
-
/** Verify a JWT access token against this Auth instance's issuer and
|
|
348
|
-
* JWKS. Passing a Request also enforces DPoP proof binding and persistent
|
|
349
|
-
* replay protection. Opaque tokens and remote introspection are not
|
|
350
|
-
* supported. */
|
|
351
|
-
readonly verifyOAuthAccessToken: (tokenOrRequest: string | Request, options: {
|
|
352
|
-
readonly audience: string;
|
|
353
|
-
readonly scopes?: readonly string[];
|
|
354
|
-
}) => Promise<OAuthAccessTokenVerification>;
|
|
355
|
-
/** Secret-free client projection for the current consent redirect. */
|
|
356
|
-
readonly getOAuthConsentRequest: (request: Request) => Promise<OAuthConsentRequest | null>;
|
|
357
|
-
/** Submit the original signed query and return the validated client redirect. */
|
|
358
|
-
readonly completeOAuthConsent: (request: Request, accept: boolean) => Promise<string>;
|
|
359
|
-
/** User-facing OAuth grants. Optional so custom Auth facades stay compatible. */
|
|
360
|
-
readonly listOAuthConsents?: (userId: string) => Promise<readonly OAuthConsentInfo[]>;
|
|
361
|
-
/** Revoke every token and consent row for one user/client grant. */
|
|
362
|
-
readonly revokeOAuthConsent?: (userId: string, consentId: string) => Promise<boolean>;
|
|
363
|
-
/** Methods the consumer registered, in declaration order. The admin
|
|
364
|
-
* SPA renders sign-in sections per this list. Secrets, senders, and
|
|
365
|
-
* per-provider extras are intentionally excluded — UI doesn't need
|
|
366
|
-
* them. `social` methods carry the upstream `provider` id for
|
|
367
|
-
* per-provider rendering. */
|
|
368
|
-
readonly methods: ReadonlyArray<AuthMethodInfo>;
|
|
369
|
-
/** List a user's linked social/credential accounts. Ordered by
|
|
370
|
-
* `createdAt` ascending so the UI can render "linked since" in a
|
|
371
|
-
* stable order across reloads. Read-only — uses the underlying D1
|
|
372
|
-
* binding directly, no Better Auth API call. */
|
|
373
|
-
readonly listLinkedAccounts: (userId: string) => Promise<readonly LinkedAccountInfo[]>;
|
|
374
|
-
/** Unlink a single account by `(userId, providerId)`. Returns true if
|
|
375
|
-
* a row was deleted, false if no matching account existed. Does NOT
|
|
376
|
-
* guard against unlinking the user's only sign-in method — the
|
|
377
|
-
* caller knows their auth method mix and decides whether the
|
|
378
|
-
* resulting state is sign-in-able. The runtime can't, because
|
|
379
|
-
* email-OTP / magic-link sign-ins do not write to the `account`
|
|
380
|
-
* table at all, so "rows left" is not a reliable indicator. */
|
|
381
|
-
readonly unlinkAccount: (userId: string, providerId: string) => Promise<boolean>;
|
|
382
|
-
/** List only users with a staff role, ordered by `createdAt`
|
|
383
|
-
* ascending. End-user identities stay outside the team-management
|
|
384
|
-
* surface. Owner-only enforcement is the mount layer's job. */
|
|
385
|
-
readonly listUsers: () => Promise<readonly StaffUserInfo[]>;
|
|
386
|
-
/** List non-staff identities for the member-management surface. */
|
|
387
|
-
readonly listMembers: (args: ListMembersArgs) => Promise<MemberListResult>;
|
|
388
|
-
/** Assign or clear a user's staff role. `null` revokes staff access
|
|
389
|
-
* (the row keeps existing — the user can still sign in, but every
|
|
390
|
-
* staff-gated surface 403s). Returns false when no row matched.
|
|
391
|
-
* Throws on a non-staff role string — programmer error, not an
|
|
392
|
-
* operator input path (endpoints validate before calling). Does NOT
|
|
393
|
-
* guard self-demotion; that's session-aware and lives in the mount
|
|
394
|
-
* layer. */
|
|
395
|
-
readonly setUserRole: (userId: string, role: StaffRole | null) => Promise<boolean>;
|
|
396
|
-
/** Invite a staff member by email: pre-create the user row
|
|
397
|
-
* (`emailVerified: 0`) with the role already assigned, so the
|
|
398
|
-
* invitee's FIRST sign-in with that email lands with the role in
|
|
399
|
-
* effect — no second assignment step. Magic-link / email-OTP
|
|
400
|
-
* sign-ins match the row by email; social sign-ins with the same
|
|
401
|
-
* email link onto it only when the provider is listed in
|
|
402
|
-
* `accountLinking.trustedProviders` (document this to operators).
|
|
403
|
-
* Email is normalized (trim + lowercase). Returns `exists` instead
|
|
404
|
-
* of throwing when the email already has a row. */
|
|
405
|
-
readonly inviteUser: (email: string, role: StaffRole) => Promise<InviteUserResult>;
|
|
406
|
-
readonly sendStaffInvitation?: (email: string, role: StaffRole) => Promise<void>;
|
|
407
|
-
/** Delete an invitation row. Guarded to rows nobody ever signed in
|
|
408
|
-
* to (`emailVerified = 0` AND no linked `account` row) so a real
|
|
409
|
-
* user with sessions/accounts can never be cascade-deleted through
|
|
410
|
-
* this path. Returns false when the row didn't match the guard. */
|
|
411
|
-
readonly revokeInvite: (userId: string) => Promise<boolean>;
|
|
412
|
-
/** Register an OAuth/OIDC client when `oauthProvider` is configured.
|
|
413
|
-
* Uses Better Auth's own provider plugin endpoint and returns the
|
|
414
|
-
* client secret only on creation. The caller must pass the current
|
|
415
|
-
* owner/admin request headers so Better Auth can enforce privileges. */
|
|
416
|
-
readonly registerOAuthClient: (input: RegisterOAuthClientInput) => Promise<RegisteredOAuthClient>;
|
|
417
|
-
}
|
|
418
|
-
/** True only for the fail-closed facade returned by createSetupIncompleteAuth. */
|
|
419
|
-
export declare function isSetupIncompleteAuth(auth: Auth): boolean;
|
|
420
|
-
export declare function createAuth(config: CreateAuthConfig): Auth;
|
|
421
|
-
export interface SetupIncompleteAuthOptions {
|
|
422
|
-
readonly basePath?: string;
|
|
423
|
-
readonly message?: string;
|
|
424
|
-
readonly response?: () => Response | Promise<Response>;
|
|
425
17
|
}
|
|
426
|
-
/**
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
|
|
430
|
-
* the consumer; this facade never authenticates anyone.
|
|
431
|
-
*/
|
|
432
|
-
export declare function createSetupIncompleteAuth(options?: SetupIncompleteAuthOptions): Auth;
|
|
18
|
+
/** Better Auth on Cloudflare: D1 for state, optional Workers KV for session
|
|
19
|
+
* reads. Wiring only — the auth surface itself is host-neutral. Always
|
|
20
|
+
* supplies `cf-connecting-ip` as the rate-limit identity header. */
|
|
21
|
+
export declare function createAuth(config: CreateAuthConfig): MantleAuth;
|
|
433
22
|
//# sourceMappingURL=createAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAuth.d.ts","sourceRoot":"","sources":["../../src/auth/createAuth.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAWrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAwBlE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,CAAC;AACvC;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAAwB,CAAC;AAExE;;;;;GAKG;AACH,MAAM,MAAM,gBA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