@pithy-sh/auth 0.8.0 → 0.10.0

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 (164) hide show
  1. package/README.md +12 -2
  2. package/dist/audit/actions.d.ts +21 -0
  3. package/dist/audit/actions.d.ts.map +1 -1
  4. package/dist/audit/actions.js +22 -1
  5. package/dist/audit/emit.js +1 -1
  6. package/dist/caller/certificate.d.ts +83 -0
  7. package/dist/caller/certificate.d.ts.map +1 -0
  8. package/dist/caller/certificate.js +92 -0
  9. package/dist/caller/request.d.ts +66 -0
  10. package/dist/caller/request.d.ts.map +1 -0
  11. package/dist/caller/request.js +71 -0
  12. package/dist/caller/token.d.ts +130 -0
  13. package/dist/caller/token.d.ts.map +1 -0
  14. package/dist/caller/token.js +207 -0
  15. package/dist/capability.d.ts +70 -2
  16. package/dist/capability.d.ts.map +1 -1
  17. package/dist/capability.js +28 -7
  18. package/dist/client/lifecycle.d.ts +19 -0
  19. package/dist/client/lifecycle.d.ts.map +1 -0
  20. package/dist/client/lifecycle.js +25 -0
  21. package/dist/client/projection.d.ts +4 -0
  22. package/dist/client/projection.d.ts.map +1 -1
  23. package/dist/data/betterAuth.d.ts +5 -1
  24. package/dist/data/betterAuth.d.ts.map +1 -1
  25. package/dist/data/betterAuth.js +7 -3
  26. package/dist/data/kitFields.d.ts +20 -25
  27. package/dist/data/kitFields.d.ts.map +1 -1
  28. package/dist/data/kitFields.js +28 -32
  29. package/dist/data/tables.d.ts +29 -3
  30. package/dist/data/tables.d.ts.map +1 -1
  31. package/dist/data/tables.js +5 -3
  32. package/dist/data/userLifecycle.d.ts +61 -0
  33. package/dist/data/userLifecycle.d.ts.map +1 -0
  34. package/dist/data/userLifecycle.js +50 -0
  35. package/dist/http/credentialResign.d.ts +46 -0
  36. package/dist/http/credentialResign.d.ts.map +1 -0
  37. package/dist/http/credentialResign.js +203 -0
  38. package/dist/http/errorCallbackUrl.d.ts.map +1 -1
  39. package/dist/http/errorCallbackUrl.js +15 -9
  40. package/dist/http/guards.d.ts +23 -1
  41. package/dist/http/guards.d.ts.map +1 -1
  42. package/dist/http/guards.js +28 -3
  43. package/dist/http/lifecycleGate.d.ts +18 -0
  44. package/dist/http/lifecycleGate.d.ts.map +1 -0
  45. package/dist/http/lifecycleGate.js +75 -0
  46. package/dist/http/middleware.d.ts +5 -0
  47. package/dist/http/middleware.d.ts.map +1 -1
  48. package/dist/http/middleware.js +113 -21
  49. package/dist/http/providerRefusal.d.ts +8 -7
  50. package/dist/http/providerRefusal.d.ts.map +1 -1
  51. package/dist/http/providerRefusal.js +37 -32
  52. package/dist/http/resolve.d.ts.map +1 -1
  53. package/dist/http/resolve.js +23 -5
  54. package/dist/http/routes.d.ts.map +1 -1
  55. package/dist/http/routes.js +20 -1
  56. package/dist/instance/auth.d.ts +1280 -5
  57. package/dist/instance/auth.d.ts.map +1 -1
  58. package/dist/instance/auth.js +59 -4
  59. package/dist/instance/jwksReencryption.d.ts +75 -0
  60. package/dist/instance/jwksReencryption.d.ts.map +1 -0
  61. package/dist/instance/jwksReencryption.js +160 -0
  62. package/dist/instance/microsoftEmail.d.ts +70 -0
  63. package/dist/instance/microsoftEmail.d.ts.map +1 -0
  64. package/dist/instance/microsoftEmail.js +96 -0
  65. package/dist/instance/providerSignInGate.d.ts +14 -12
  66. package/dist/instance/providerSignInGate.d.ts.map +1 -1
  67. package/dist/instance/providerSignInGate.js +23 -20
  68. package/dist/instance/providers.d.ts +7 -5
  69. package/dist/instance/providers.d.ts.map +1 -1
  70. package/dist/instance/providers.js +5 -3
  71. package/dist/instance/secrets.d.ts +232 -4
  72. package/dist/instance/secrets.d.ts.map +1 -1
  73. package/dist/instance/secrets.js +129 -7
  74. package/dist/instance/sessionSecrets.d.ts +45 -0
  75. package/dist/instance/sessionSecrets.d.ts.map +1 -0
  76. package/dist/instance/sessionSecrets.js +29 -0
  77. package/dist/lifecycle/enforce.d.ts +40 -0
  78. package/dist/lifecycle/enforce.d.ts.map +1 -0
  79. package/dist/lifecycle/enforce.js +70 -0
  80. package/dist/lifecycle/hooks.d.ts +53 -0
  81. package/dist/lifecycle/hooks.d.ts.map +1 -0
  82. package/dist/lifecycle/hooks.js +2 -0
  83. package/dist/lifecycle/request.d.ts +15 -0
  84. package/dist/lifecycle/request.d.ts.map +1 -0
  85. package/dist/lifecycle/request.js +27 -0
  86. package/dist/lifecycle/state.d.ts +64 -0
  87. package/dist/lifecycle/state.d.ts.map +1 -0
  88. package/dist/lifecycle/state.js +90 -0
  89. package/dist/lifecycle/transitions.d.ts +132 -0
  90. package/dist/lifecycle/transitions.d.ts.map +1 -0
  91. package/dist/lifecycle/transitions.js +349 -0
  92. package/dist/migrations/0001_init.d.ts.map +1 -1
  93. package/dist/migrations/0003_account_issuer_nullable.d.ts +5 -0
  94. package/dist/migrations/0003_account_issuer_nullable.d.ts.map +1 -0
  95. package/dist/migrations/0003_account_issuer_nullable.js +131 -0
  96. package/dist/migrations/0004_user_lifecycle.d.ts +28 -0
  97. package/dist/migrations/0004_user_lifecycle.d.ts.map +1 -0
  98. package/dist/migrations/0004_user_lifecycle.js +47 -0
  99. package/dist/migrations/set.d.ts +3 -1
  100. package/dist/migrations/set.d.ts.map +1 -1
  101. package/dist/migrations/set.js +6 -2
  102. package/dist/peer.d.ts +4 -0
  103. package/dist/peer.d.ts.map +1 -1
  104. package/dist/test-utils/liveApp.d.ts +26 -0
  105. package/dist/test-utils/liveApp.d.ts.map +1 -1
  106. package/dist/test-utils/liveApp.js +1 -0
  107. package/dist/test-utils/schemaDrift.d.ts +49 -0
  108. package/dist/test-utils/schemaDrift.d.ts.map +1 -0
  109. package/dist/test-utils/schemaDrift.js +35 -0
  110. package/dist/test-utils/scopedBackend.d.ts +204 -0
  111. package/dist/test-utils/scopedBackend.d.ts.map +1 -0
  112. package/dist/test-utils/scopedBackend.js +166 -0
  113. package/dist/version.generated.d.ts +1 -1
  114. package/dist/version.generated.d.ts.map +1 -1
  115. package/dist/version.generated.js +1 -1
  116. package/docs/account-lifecycle.md +105 -0
  117. package/docs/apple-signin.md +7 -1
  118. package/docs/facebook-oauth.md +7 -1
  119. package/docs/github-oauth.md +7 -1
  120. package/docs/google-oauth.md +7 -1
  121. package/docs/microsoft-oauth.md +177 -0
  122. package/docs/server-authoritative.md +182 -0
  123. package/package.json +11 -8
  124. package/pithy.manifest.json +17 -3
  125. package/src/audit/actions.ts +23 -0
  126. package/src/audit/emit.ts +1 -1
  127. package/src/caller/certificate.ts +133 -0
  128. package/src/caller/request.ts +84 -0
  129. package/src/caller/token.ts +276 -0
  130. package/src/capability.ts +170 -38
  131. package/src/client/lifecycle.ts +27 -0
  132. package/src/client/projection.ts +4 -0
  133. package/src/data/betterAuth.ts +23 -2
  134. package/src/data/kitFields.ts +27 -0
  135. package/src/data/tables.ts +4 -2
  136. package/src/data/userLifecycle.ts +80 -0
  137. package/src/http/credentialResign.ts +268 -0
  138. package/src/http/errorCallbackUrl.ts +21 -13
  139. package/src/http/guards.ts +29 -1
  140. package/src/http/lifecycleGate.ts +78 -0
  141. package/src/http/middleware.ts +161 -37
  142. package/src/http/providerRefusal.ts +40 -32
  143. package/src/http/resolve.ts +34 -5
  144. package/src/http/routes.ts +39 -2
  145. package/src/instance/auth.ts +91 -6
  146. package/src/instance/jwksReencryption.ts +206 -0
  147. package/src/instance/microsoftEmail.ts +111 -0
  148. package/src/instance/providerSignInGate.ts +30 -27
  149. package/src/instance/providers.ts +8 -4
  150. package/src/instance/secrets.ts +153 -6
  151. package/src/instance/sessionSecrets.ts +64 -0
  152. package/src/lifecycle/enforce.ts +89 -0
  153. package/src/lifecycle/hooks.ts +54 -0
  154. package/src/lifecycle/request.ts +31 -0
  155. package/src/lifecycle/state.ts +101 -0
  156. package/src/lifecycle/transitions.ts +483 -0
  157. package/src/migrations/0001_init.ts +8 -10
  158. package/src/migrations/0003_account_issuer_nullable.ts +199 -0
  159. package/src/migrations/0004_user_lifecycle.ts +68 -0
  160. package/src/migrations/set.ts +5 -1
  161. package/src/test-utils/liveApp.ts +2 -1
  162. package/src/test-utils/schemaDrift.ts +82 -0
  163. package/src/test-utils/scopedBackend.ts +137 -0
  164. package/src/version.generated.ts +1 -1
@@ -22,9 +22,10 @@ import { APIError, getOAuthState } from "better-auth/api";
22
22
  * The mitigating fact is that it requires a provider-signed, audience-bound assertion of the address,
23
23
  * so it is not an address an attacker picks — which is why the claim above says *the redirect
24
24
  * callback* and not *provider sign-in*.
25
- * - **A plugin that calls `handleOAuthUserInfo` without going through `provider.getUserInfo`.**
26
- * `plugins/one-tap/index.mjs:45-70` builds the user info straight from a verified Google id token;
27
- * `plugins/oauth-proxy/index.mjs:110` lifts it out of an encrypted proxy payload. The kit composes
25
+ * - **A plugin that calls `handleOAuthUserInfo` outside the redirect callback.** `plugins/one-tap/index.mjs:64`
26
+ * resolves a verified Google id token through Google's own `getUserInfo` with no OAuth state, which
27
+ * this gate passes through, or builds the user info itself when Google is not configured;
28
+ * `plugins/oauth-proxy/index.mjs:127` lifts it out of an encrypted proxy payload. The kit composes
28
29
  * neither. `./refusalTransport` is where a composed plugin is ruled on.
29
30
  * - **An adopter plugin that replaces `ctx.socialProviders` in its own `init`.** Kit plugins run first
30
31
  * by contract (`./auth.ts` composes them ahead of the adopter's), so the wrap is installed before
@@ -44,8 +45,8 @@ import { APIError, getOAuthState } from "better-auth/api";
44
45
  * | 4 | Not attached, no account at that address | Refused |
45
46
  *
46
47
  * Rows 3 and 4 differ only in whether a row exists at an address **the caller chose**, and Better Auth
47
- * answers them with two different codes — `account_not_linked` (`oauth2/link-account.mjs:86`, returned
48
- * only inside `if (dbUser)`) and `signup_disabled` (`:202`, the `else` of that same branch). Both reach
48
+ * answers them with two different codes — `account_not_linked` (`oauth2/link-account.mjs:142`, returned
49
+ * only inside `if (dbUser)`) and `signup_disabled` (`:257`, the `else` of that same branch). Both reach
49
50
  * the browser as `?error=<code>`. That is an account-enumeration oracle needing one provider account,
50
51
  * none on the target, and no page render.
51
52
  *
@@ -55,20 +56,21 @@ import { APIError, getOAuthState } from "better-auth/api";
55
56
  * another, and the last keyed on a value `callbackURL` supplies, so it rewrote *successful* sign-ins.
56
57
  * By the time a response exists the fact that distinguished the two cases is gone and what is left is
57
58
  * partly the caller's. `getUserInfo` is the last seam that holds the fact itself: `callback.mjs:120`
58
- * calls it, `:220` calls `handleOAuthUserInfo`, and **nothing runs in between** — so a refusal thrown
59
+ * calls it, `:172` calls `handleOAuthUserInfo`, and **nothing between them reads a user row** — so a refusal thrown
59
60
  * here means neither of those two lines is ever reached and there is no pair left to collapse.
60
61
  *
61
62
  * ## Why a wrapper, and not a `getUserInfo` supplied in the config block
62
63
  *
63
64
  * `options.getUserInfo` short-circuits each provider's own resolver on its first line
64
- * (`social-providers/google.mjs:118`, `facebook.mjs:93`, `apple.mjs:62`, `github.mjs:65`), so supplying
65
- * one means reimplementing the profile fetch it replaced — Google's id-token decode, Facebook's
66
- * access-token-owner check. `./githubUserInfo.ts` already records what that costs: replacing GitHub's
67
- * resolver silently dropped `name` and `image`, which had to be re-derived. Wrapping calls the
68
- * dependency's own resolver and reads its result, so nothing is reimplemented and nothing reconstructed.
65
+ * (`social-providers/google.mjs:118`, `facebook.mjs:93`, `apple.mjs:62`, `github.mjs:65`,
66
+ * `microsoft-entra-id.mjs:99`), so supplying one means reimplementing the profile fetch it replaced —
67
+ * Google's id-token decode, Facebook's access-token-owner check. `./githubUserInfo.ts` already records
68
+ * what that costs: replacing GitHub's resolver silently dropped `name` and `image`, which had to be
69
+ * re-derived. Wrapping calls the dependency's own resolver and reads its result, so nothing is
70
+ * reimplemented and nothing reconstructed.
69
71
  *
70
72
  * **And it is the wrapping that makes the predicate read the right flag.** `mapProfileToUser` is applied
71
- * *inside* each provider's own `getUserInfo` — every one of the four spreads `...userMap` over the
73
+ * *inside* each provider's own `getUserInfo` — every one of the five spreads `...userMap` over the
72
74
  * `emailVerified` it computed — so the value this module reads is by construction the **effective** flag.
73
75
  * Facebook is the trap that makes this load-bearing: it sits outside `trustedProviders` like GitHub, but
74
76
  * `./auth.ts` asserts its address as verified with a documented reason, and its OAuth response carries no
@@ -103,8 +105,8 @@ const PROVIDER_SIGN_IN_REFUSAL_REASONS = {
103
105
  * than asserted:** `providerSignInGate.workers.test.ts` drives a refusal the dependency still emits
104
106
  * (`email_not_found`) beside one this gate emits and requires the two `Location` headers to differ in
105
107
  * nothing but the code. `ctx.redirect(url)` is itself only `new APIError("FOUND", undefined, headers)`
106
- * with `location` set (`better-call/dist/context.mjs:60`), and better-auth's router passes a `FOUND`
107
- * straight through its `onError` to `toResponse` (`api/index.mjs:192`), so this is the same object the
108
+ * with `location` set (`better-call/dist/context.mjs:62`), and better-auth's router passes a `FOUND`
109
+ * straight through its `onError` to `toResponse` (`api/index.mjs:196`), so this is the same object the
108
110
  * dependency would have thrown — built without the endpoint context `getUserInfo` is not handed.
109
111
  *
110
112
  * The value being appended to is the OAuth state's own `errorURL`, which is where `redirectOnError`
@@ -132,12 +134,13 @@ function refusalWithoutRedirect() {
132
134
  /**
133
135
  * Is this provider identity already attached to some account here? Row 1.
134
136
  *
135
- * **Keyed on `(providerId, accountId)`, which is wider than Better Auth's `(issuer, accountId)`, and
136
- * wider is the safe direction.** Deriving the issuer means copying `createOAuthAccountIssuer` —
137
- * `local:oauth:${encodeAccountIssuerProviderId(id)}` — from a package the kit does not depend on, and a
138
- * second copy of a dependency's decision is the defect class this repo has been bitten by four times
139
- * (#106, #108, #109, #113). A false match here passes the attempt through and lets Better Auth decide,
140
- * which is today's behavior; a false *miss* is what would be dangerous, and widening cannot cause one.
137
+ * **Keyed on `(providerId, accountId)`, which is Better Auth's own account key.** 1.7.0–1.7.2 keyed an
138
+ * account on `(issuer, accountId)` instead, and this gate read the wider pair rather than copy how Better
139
+ * Auth derived an issuer. 1.7.3 reverted to the 1.6 model (better-auth/better-auth#11153), and the lookup
140
+ * the callback makes is now `findAccountOwnerByKey({ providerId, accountId })` (`link-account.mjs:80`), so
141
+ * the two ask the same question of the same columns (#787). A false match here would pass the attempt
142
+ * through and let Better Auth decide, which is the safe direction; a false *miss* is what would be
143
+ * dangerous, and an identical key cannot cause one.
141
144
  *
142
145
  * It reads no address and no verified flag, which is what keeps an `allowDifferentEmails` link signing in.
143
146
  *
@@ -1,7 +1,7 @@
1
1
  // SPDX-FileCopyrightText: 2026 Pithy
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
4
- import type { AppleOAuthCredentials, FacebookOAuthCredentials, GithubOAuthCredentials, GoogleOAuthCredentials } from "./secrets";
4
+ import type { AppleOAuthCredentials, FacebookOAuthCredentials, GithubOAuthCredentials, GoogleOAuthCredentials, MicrosoftOAuthCredentials } from "./secrets";
5
5
  /**
6
6
  * What one social provider *is*, for one instance — three states, carried on the value (#381).
7
7
  *
@@ -51,15 +51,15 @@ export declare const PROVIDER_DISABLED: {
51
51
  readonly state: "disabled";
52
52
  };
53
53
  /** The social providers the kit composes. Ordered as they are declared in config. */
54
- export declare const SOCIAL_PROVIDER_IDS: readonly ["google", "apple", "facebook", "github"];
54
+ export declare const SOCIAL_PROVIDER_IDS: readonly ["google", "apple", "facebook", "github", "microsoft"];
55
55
  /** One of the kit's social providers. */
56
56
  export type SocialProviderId = (typeof SOCIAL_PROVIDER_IDS)[number];
57
57
  /**
58
58
  * Every provider's state for one instance.
59
59
  *
60
- * A record rather than four loose fields, because two things read it — the `socialProviders` block the
60
+ * A record rather than five loose fields, because two things read it — the `socialProviders` block the
61
61
  * instance is built from, and the refusal that answers a caller who asked for one that is not there —
62
- * and they must be reading the same four values or they will disagree about what is available.
62
+ * and they must be reading the same five values or they will disagree about what is available.
63
63
  */
64
64
  export interface ResolvedProviders {
65
65
  /** Google OAuth: disabled, ready with its credential pair, or declared and unreadable. */
@@ -70,10 +70,12 @@ export interface ResolvedProviders {
70
70
  facebook: ResolvedProvider<FacebookOAuthCredentials>;
71
71
  /** GitHub OAuth: disabled, ready with its credential pair, or declared and unreadable. */
72
72
  github: ResolvedProvider<GithubOAuthCredentials>;
73
+ /** Microsoft Entra ID: disabled, ready with its credential set and tenant, or declared and unreadable. */
74
+ microsoft: ResolvedProvider<MicrosoftOAuthCredentials>;
73
75
  }
74
76
  /**
75
77
  * Every provider disabled — what a composition that enables no social sign-in resolves to, and the
76
- * base a construction site spreads over rather than spelling four times.
78
+ * base a construction site spreads over rather than spelling five times.
77
79
  */
78
80
  export declare const NO_SOCIAL_PROVIDERS: Readonly<ResolvedProviders>;
79
81
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/instance/providers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEjE,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,gBAAgB,CAAC,WAAW,IACpC;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAA0B,CAAC;AAEvF,qFAAqF;AACrF,eAAO,MAAM,mBAAmB,YAAI,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AAEtF,yCAAyC;AACzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,MAAM,EAAE,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;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAQ1E"}
@@ -16,17 +16,19 @@ const SOCIAL_PROVIDER_IDS = [
16
16
  "google",
17
17
  "apple",
18
18
  "facebook",
19
- "github"
19
+ "github",
20
+ "microsoft"
20
21
  ];
21
22
  /**
22
23
  * Every provider disabled — what a composition that enables no social sign-in resolves to, and the
23
- * base a construction site spreads over rather than spelling four times.
24
+ * base a construction site spreads over rather than spelling five times.
24
25
  */
25
26
  const NO_SOCIAL_PROVIDERS = {
26
27
  google: PROVIDER_DISABLED,
27
28
  apple: PROVIDER_DISABLED,
28
29
  facebook: PROVIDER_DISABLED,
29
- github: PROVIDER_DISABLED
30
+ github: PROVIDER_DISABLED,
31
+ microsoft: PROVIDER_DISABLED
30
32
  };
31
33
  /**
32
34
  * Resolve one provider: `disabled` when the adopter did not enable it, `ready` with its credentials, or
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import type { SecretsStoreEnv } from "@pithy-sh/secrets/src/env/bindings";
4
4
  import { z } from "zod";
5
+ import type { SessionSecretVersions } from "./sessionSecrets";
5
6
  /**
6
7
  * The secrets `@pithy-sh/auth` reads, declared as a minimal registry. The secret name is the join key:
7
8
  * `secretsStore` resolves the same encrypted D1 row regardless of which capability's registry names it,
@@ -20,12 +21,43 @@ import { z } from "zod";
20
21
  * Read only when the provider is enabled; rotated in the Meta app dashboard, not on our schedule.
21
22
  * - `auth-github-credentials` — the GitHub OAuth app client id and secret, as a typed JSON value.
22
23
  * Read only when the provider is enabled; rotated in GitHub Developer settings, not on our schedule.
24
+ * - `auth-microsoft-credentials` — the Microsoft Entra ID app registration's client id, client secret,
25
+ * and tenant, as a typed JSON value. The tenant rides inside because it means nothing apart from the
26
+ * registration it belongs to. Rotatable: an Entra client secret expires (24 months at most).
23
27
  */
24
28
  export declare const AUTH_SESSION_SECRET = "auth-session-secret";
25
29
  export declare const AUTH_GOOGLE_CREDENTIALS = "auth-google-credentials";
26
30
  export declare const AUTH_APPLE_CREDENTIALS = "auth-apple-credentials";
27
31
  export declare const AUTH_FACEBOOK_CREDENTIALS = "auth-facebook-credentials";
28
32
  export declare const AUTH_GITHUB_CREDENTIALS = "auth-github-credentials";
33
+ export declare const AUTH_MICROSOFT_CREDENTIALS = "auth-microsoft-credentials";
34
+ /**
35
+ * The JWKS private keys, as `auth-session-secret`'s overlap names them (#602).
36
+ *
37
+ * Better Auth encrypts every key in `pithy_auth_jwks` under the session secret, and a key never expires —
38
+ * so retiring the version one is sealed under would leave a signing key nothing can open. The session
39
+ * secret's registry entry names this dependent, `instance/jwksReencryption.ts` moves the keys under the
40
+ * newest version and records it, and the secrets manager retires nothing until it has.
41
+ */
42
+ export declare const AUTH_JWKS_DEPENDENT = "auth-jwks";
43
+ /**
44
+ * The Better Auth plugins that seal rows of their own under the session secret, by id.
45
+ *
46
+ * `two-factor` seals every TOTP secret with `symmetricEncrypt({ key: ctx.context.secretConfig })`, and its
47
+ * backup codes the same way under `storeBackupCodes: "encrypted"` (`plugins/two-factor/index.mjs`,
48
+ * `backup-codes/index.mjs`). Neither expires. Nothing in the kit re-encrypts them, so an unattended rotation
49
+ * beside one is refused at `auth()` rather than allowed to retire the version they are sealed under.
50
+ */
51
+ export declare const SESSION_SECRET_SEALING_PLUGINS: readonly string[];
52
+ /**
53
+ * How many days a replaced session secret keeps verifying: the session's own lifetime, rounded up.
54
+ *
55
+ * **That is the whole of the overlap's argument.** A session in use is re-signed on its next request
56
+ * (`http/credentialResign.ts`), and its expiry slides forward on use — so a session that goes the whole
57
+ * overlap without one request has expired by the time the overlap ends. Any shorter, and a session used
58
+ * yesterday is signed out when the old version retires.
59
+ */
60
+ export declare function sessionSecretOverlapDays(sessionExpiresIn: number): number;
29
61
  /** The Google OAuth credential pair, stored as one typed JSON secret. */
30
62
  export declare const GoogleOAuthCredentials: z.ZodObject<{
31
63
  clientId: z.ZodString;
@@ -51,6 +83,19 @@ export declare const GithubOAuthCredentials: z.ZodObject<{
51
83
  clientSecret: z.ZodString;
52
84
  }, z.core.$strip>;
53
85
  export type GithubOAuthCredentials = z.infer<typeof GithubOAuthCredentials>;
86
+ /**
87
+ * The Microsoft Entra ID credentials, stored as one typed JSON secret.
88
+ *
89
+ * **`tenantId` is required and may not be empty.** Better Auth builds its endpoints from
90
+ * `options.tenantId || "common"`, so an empty string would not fail: it would quietly open a
91
+ * single-tenant app to every Entra tenant and every personal account.
92
+ */
93
+ export declare const MicrosoftOAuthCredentials: z.ZodObject<{
94
+ clientId: z.ZodString;
95
+ clientSecret: z.ZodString;
96
+ tenantId: z.ZodString;
97
+ }, z.core.$strip>;
98
+ export type MicrosoftOAuthCredentials = z.infer<typeof MicrosoftOAuthCredentials>;
54
99
  export declare const authSecretsRegistry: {
55
100
  readonly "auth-session-secret": {
56
101
  readonly backend: "d1";
@@ -69,7 +114,137 @@ export declare const authSecretsRegistry: {
69
114
  readonly rotation: {
70
115
  readonly kind: "local";
71
116
  };
117
+ readonly overlap: {
118
+ readonly days: 7;
119
+ readonly minimumDays: 7;
120
+ readonly reencrypt: readonly ["auth-jwks"];
121
+ };
122
+ };
123
+ readonly "auth-google-credentials": {
124
+ readonly backend: "d1";
125
+ readonly scope: "environment";
126
+ readonly rotatable: false;
127
+ readonly valueType: "json";
128
+ readonly schema: z.ZodObject<{
129
+ clientId: z.ZodString;
130
+ clientSecret: z.ZodString;
131
+ }, z.core.$strip>;
132
+ readonly origin: {
133
+ readonly kind: "obtained";
134
+ readonly issuer: "google";
135
+ readonly documentation: "https://console.cloud.google.com/apis/credentials";
136
+ };
137
+ readonly rotation: {
138
+ readonly kind: "manual";
139
+ readonly issuer: "google";
140
+ readonly documentation: "https://console.cloud.google.com/apis/credentials";
141
+ };
142
+ };
143
+ readonly "auth-apple-credentials": {
144
+ readonly backend: "d1";
145
+ readonly scope: "environment";
146
+ readonly rotatable: true;
147
+ readonly valueType: "json";
148
+ readonly schema: z.ZodObject<{
149
+ clientId: z.ZodString;
150
+ clientSecret: z.ZodString;
151
+ appBundleIdentifier: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strip>;
153
+ readonly origin: {
154
+ readonly kind: "obtained";
155
+ readonly issuer: "apple";
156
+ readonly documentation: "https://developer.apple.com/account/resources/authkeys/list";
157
+ };
158
+ readonly rotation: {
159
+ readonly kind: "manual";
160
+ readonly issuer: "apple";
161
+ readonly documentation: "https://developer.apple.com/account/resources/authkeys/list";
162
+ };
163
+ };
164
+ readonly "auth-facebook-credentials": {
165
+ readonly backend: "d1";
166
+ readonly scope: "environment";
167
+ readonly rotatable: false;
168
+ readonly valueType: "json";
169
+ readonly schema: z.ZodObject<{
170
+ clientId: z.ZodString;
171
+ clientSecret: z.ZodString;
172
+ }, z.core.$strip>;
173
+ readonly origin: {
174
+ readonly kind: "obtained";
175
+ readonly issuer: "facebook";
176
+ readonly documentation: "https://developers.facebook.com/apps/";
177
+ };
178
+ readonly rotation: {
179
+ readonly kind: "manual";
180
+ readonly issuer: "facebook";
181
+ readonly documentation: "https://developers.facebook.com/apps/";
182
+ };
72
183
  };
184
+ readonly "auth-github-credentials": {
185
+ readonly backend: "d1";
186
+ readonly scope: "environment";
187
+ readonly rotatable: false;
188
+ readonly valueType: "json";
189
+ readonly schema: z.ZodObject<{
190
+ clientId: z.ZodString;
191
+ clientSecret: z.ZodString;
192
+ }, z.core.$strip>;
193
+ readonly origin: {
194
+ readonly kind: "obtained";
195
+ readonly issuer: "github";
196
+ readonly documentation: "https://github.com/settings/developers";
197
+ };
198
+ readonly rotation: {
199
+ readonly kind: "manual";
200
+ readonly issuer: "github";
201
+ readonly documentation: "https://github.com/settings/developers";
202
+ };
203
+ };
204
+ readonly "auth-microsoft-credentials": {
205
+ readonly backend: "d1";
206
+ readonly scope: "environment";
207
+ readonly rotatable: true;
208
+ readonly valueType: "json";
209
+ readonly schema: z.ZodObject<{
210
+ clientId: z.ZodString;
211
+ clientSecret: z.ZodString;
212
+ tenantId: z.ZodString;
213
+ }, z.core.$strip>;
214
+ readonly origin: {
215
+ readonly kind: "obtained";
216
+ readonly issuer: "microsoft";
217
+ readonly documentation: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
218
+ };
219
+ readonly rotation: {
220
+ readonly kind: "manual";
221
+ readonly issuer: "microsoft";
222
+ readonly documentation: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
223
+ };
224
+ };
225
+ };
226
+ /**
227
+ * **The registry `auth()` contributes, from its own configuration (#602).**
228
+ *
229
+ * The session secret's overlap follows the configured session lifetime — {@link sessionSecretOverlapDays} —
230
+ * and it is both the overlap and its floor: an adopter who lengthens sessions lengthens the overlap with
231
+ * them, rather than holding a seven-day overlap against a thirty-day session. `rotateEveryDays` is
232
+ * `sessionSecretRotateEveryDays`, and only an adopter sets it: the kit turns no unattended rotation on.
233
+ *
234
+ * Checked by `defineSecretRegistry` like every registry, so a period no longer than the session lifetime is
235
+ * refused here, at `auth()`, naming the secret — rather than at a 03:00 cron that could only skip it.
236
+ *
237
+ * **A period is refused beside a plugin that seals rows under the session secret** —
238
+ * {@link SESSION_SECRET_SEALING_PLUGINS}. Only the JWKS keys are moved before a retirement; a plugin's own
239
+ * sealed rows would be left under the retired version, and nothing could open them again.
240
+ */
241
+ export declare function authSecretsRegistryFor(config: {
242
+ sessionExpiresIn: number;
243
+ sessionSecretRotateEveryDays?: number;
244
+ plugins?: readonly {
245
+ id: string;
246
+ }[];
247
+ }): {
73
248
  readonly "auth-google-credentials": {
74
249
  readonly backend: "d1";
75
250
  readonly scope: "environment";
@@ -151,6 +326,51 @@ export declare const authSecretsRegistry: {
151
326
  readonly documentation: "https://github.com/settings/developers";
152
327
  };
153
328
  };
329
+ readonly "auth-microsoft-credentials": {
330
+ readonly backend: "d1";
331
+ readonly scope: "environment";
332
+ readonly rotatable: true;
333
+ readonly valueType: "json";
334
+ readonly schema: z.ZodObject<{
335
+ clientId: z.ZodString;
336
+ clientSecret: z.ZodString;
337
+ tenantId: z.ZodString;
338
+ }, z.core.$strip>;
339
+ readonly origin: {
340
+ readonly kind: "obtained";
341
+ readonly issuer: "microsoft";
342
+ readonly documentation: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
343
+ };
344
+ readonly rotation: {
345
+ readonly kind: "manual";
346
+ readonly issuer: "microsoft";
347
+ readonly documentation: "https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade";
348
+ };
349
+ };
350
+ readonly "auth-session-secret": {
351
+ readonly backend: "d1";
352
+ readonly scope: "environment";
353
+ readonly rotatable: true;
354
+ readonly valueType: "text";
355
+ readonly devValue: "random";
356
+ readonly origin: {
357
+ readonly kind: "minted";
358
+ readonly recipe: {
359
+ readonly kind: "random";
360
+ readonly bytes: 32;
361
+ readonly encoding: "base64url";
362
+ };
363
+ };
364
+ readonly rotation: {
365
+ readonly kind: "local";
366
+ };
367
+ readonly overlap: {
368
+ readonly days: number;
369
+ readonly minimumDays: number;
370
+ readonly reencrypt: readonly ["auth-jwks"];
371
+ };
372
+ readonly rotateEveryDays?: number | undefined;
373
+ };
154
374
  };
155
375
  /**
156
376
  * Which provider a credential belongs to — the join the CLI must never make by spelling (#541).
@@ -159,15 +379,15 @@ export declare const authSecretsRegistry: {
159
379
  * nothing makes a secret name and a config key the same thing, and a reporting command that matched
160
380
  * them by substring would be right by luck. Stated here, once, beside both.
161
381
  */
162
- declare const PROVIDER_CREDENTIALS: readonly [readonly ["google", "auth-google-credentials"], readonly ["apple", "auth-apple-credentials"], readonly ["facebook", "auth-facebook-credentials"], readonly ["github", "auth-github-credentials"]];
163
- /** The four toggles this reads off the resolved `AuthConfig` — nothing else about it is its business. */
382
+ declare const PROVIDER_CREDENTIALS: readonly [readonly ["google", "auth-google-credentials"], readonly ["apple", "auth-apple-credentials"], readonly ["facebook", "auth-facebook-credentials"], readonly ["github", "auth-github-credentials"], readonly ["microsoft", "auth-microsoft-credentials"]];
383
+ /** The five toggles this reads off the resolved `AuthConfig` — nothing else about it is its business. */
164
384
  export type AuthProviderToggles = Record<(typeof PROVIDER_CREDENTIALS)[number][0], {
165
385
  enabled: boolean;
166
386
  }>;
167
387
  /**
168
388
  * **The provider credentials this composition cannot reach**, as the `inapplicableSecrets` contribution.
169
389
  *
170
- * Auth declares four credentials whether or not a project runs four providers, so a project on Google
390
+ * Auth declares five credentials whether or not a project runs five providers, so a project on Google
171
391
  * and GitHub carries two secrets nothing will ever read. `pithy doctor` asked for them every run under
172
392
  * *"fine to leave until you need it"* — softening, not silence, and "until you need it" is wrong about a
173
393
  * provider the configuration has not enabled.
@@ -179,8 +399,14 @@ export type AuthProviderToggles = Record<(typeof PROVIDER_CREDENTIALS)[number][0
179
399
  * do to turn this on* as well as *why am I being shown this*.
180
400
  */
181
401
  export declare function inapplicableProviderSecrets(providers: AuthProviderToggles): Record<string, string>;
182
- /** Resolve the Better Auth session secret for this invocation. */
402
+ /** Resolve the Better Auth session secret for this invocation — the current version alone. */
183
403
  export declare function resolveSessionSecret(env: SecretsStoreEnv): Promise<string>;
404
+ /**
405
+ * Resolve every retained version of the session secret (#602) — what an instance needs to open values sealed
406
+ * under the previous version, and what a credential signed under it is verified against. One read through
407
+ * the same cached accessor as {@link resolveSessionSecret}.
408
+ */
409
+ export declare function resolveSessionSecrets(env: SecretsStoreEnv): Promise<SessionSecretVersions>;
184
410
  /** Resolve the Google OAuth credential pair for this invocation (only call when Google is enabled). */
185
411
  export declare function resolveGoogleCredentials(env: SecretsStoreEnv): Promise<GoogleOAuthCredentials>;
186
412
  /** Resolve the Apple Sign-In credentials for this invocation (only call when Apple is enabled). */
@@ -189,5 +415,7 @@ export declare function resolveAppleCredentials(env: SecretsStoreEnv): Promise<A
189
415
  export declare function resolveFacebookCredentials(env: SecretsStoreEnv): Promise<FacebookOAuthCredentials>;
190
416
  /** Resolve the GitHub OAuth credential pair for this invocation (only call when GitHub is enabled). */
191
417
  export declare function resolveGithubCredentials(env: SecretsStoreEnv): Promise<GithubOAuthCredentials>;
418
+ /** Resolve the Microsoft Entra ID credentials for this invocation (only call when Microsoft is enabled). */
419
+ export declare function resolveMicrosoftCredentials(env: SecretsStoreEnv): Promise<MicrosoftOAuthCredentials>;
192
420
  export {};
193
421
  //# sourceMappingURL=secrets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/instance/secrets.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,eAAO,MAAM,yBAAyB,8BAA8B,CAAC;AACrE,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AAEjE,yEAAyE;AACzE,eAAO,MAAM,sBAAsB;;;iBAaoE,CAAC;AACxG,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE5E,sEAAsE;AACtE,eAAO,MAAM,qBAAqB;;;;iBAsB/B,CAAC;AACJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,2EAA2E;AAC3E,eAAO,MAAM,wBAAwB;;;iBAa6D,CAAC;AACnG,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAEhF,yEAAyE;AACzE,eAAO,MAAM,sBAAsB;;;iBAa6D,CAAC;AACjG,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAe5E,eAAO,MAAM,mBAAmB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