@fitzzero/quickdraw-core 5.1.0 → 5.1.2

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 (107) hide show
  1. package/README.md +533 -180
  2. package/dist/{admin-DKwkIh5i.d.ts → admin-DWWrT1h6.d.ts} +2 -2
  3. package/dist/{adminSchemas-2DUA_hZ8.d.ts → adminSchemas-D4bFKsrb.d.ts} +6 -4
  4. package/dist/{auth-BhWqdyb-.d.ts → auth-DXiSJZaf.d.ts} +42 -16
  5. package/dist/{caller-CXTFswBO.d.ts → caller-BT-Mv4bD.d.ts} +117 -22
  6. package/dist/{chunk-RT6OILOI.js → chunk-4D2DOGAW.js} +2 -14
  7. package/dist/chunk-4D2DOGAW.js.map +1 -0
  8. package/dist/chunk-5CGO426C.js +15 -0
  9. package/dist/chunk-5CGO426C.js.map +1 -0
  10. package/dist/{chunk-A6DJBGOG.js → chunk-6K5BY47X.js} +4594 -3481
  11. package/dist/chunk-6K5BY47X.js.map +1 -0
  12. package/dist/{chunk-VJTFXHOK.js → chunk-753VJIUP.js} +13 -15
  13. package/dist/chunk-753VJIUP.js.map +1 -0
  14. package/dist/{chunk-JZBCLNDU.js → chunk-7QCUX4TK.js} +4 -4
  15. package/dist/chunk-7QCUX4TK.js.map +1 -0
  16. package/dist/chunk-AK23XSWD.js +16 -0
  17. package/dist/chunk-AK23XSWD.js.map +1 -0
  18. package/dist/{chunk-3674EIRT.js → chunk-AONAFOYU.js} +14 -5
  19. package/dist/{chunk-3674EIRT.js.map → chunk-AONAFOYU.js.map} +1 -1
  20. package/dist/chunk-DKE6QO26.js +136 -0
  21. package/dist/chunk-DKE6QO26.js.map +1 -0
  22. package/dist/{chunk-H23KEFBA.js → chunk-DUBU3BB3.js} +30 -1
  23. package/dist/chunk-DUBU3BB3.js.map +1 -0
  24. package/dist/{chunk-CDKG4TFA.js → chunk-GKH3LJ7N.js} +1 -1
  25. package/dist/chunk-GKH3LJ7N.js.map +1 -0
  26. package/dist/{chunk-KNDDCVQJ.js → chunk-GSIPUNJL.js} +49 -9
  27. package/dist/chunk-GSIPUNJL.js.map +1 -0
  28. package/dist/{chunk-DD4SKCNO.js → chunk-LCC7HNFP.js} +12 -1
  29. package/dist/chunk-LCC7HNFP.js.map +1 -0
  30. package/dist/{chunk-2PWMUVC7.js → chunk-MBH6IDSM.js} +480 -12
  31. package/dist/chunk-MBH6IDSM.js.map +1 -0
  32. package/dist/{chunk-2UELNHDD.js → chunk-NMXYENH4.js} +10 -10
  33. package/dist/{chunk-2UELNHDD.js.map → chunk-NMXYENH4.js.map} +1 -1
  34. package/dist/chunk-NO4M6PO5.js +101 -0
  35. package/dist/chunk-NO4M6PO5.js.map +1 -0
  36. package/dist/{chunk-TBMKJ26R.js → chunk-NW6U45HX.js} +3 -1
  37. package/dist/chunk-NW6U45HX.js.map +1 -0
  38. package/dist/{chunk-REX5YPHX.js → chunk-RJ5I2VO3.js} +74 -19
  39. package/dist/chunk-RJ5I2VO3.js.map +1 -0
  40. package/dist/{chunk-QEKVYG5F.js → chunk-RL4VKLBX.js} +1 -1
  41. package/dist/{chunk-QEKVYG5F.js.map → chunk-RL4VKLBX.js.map} +1 -1
  42. package/dist/chunk-XH2IZVLT.js +62 -0
  43. package/dist/chunk-XH2IZVLT.js.map +1 -0
  44. package/dist/{chunk-4DIQHASK.js → chunk-Z5ILULF2.js} +26 -7
  45. package/dist/chunk-Z5ILULF2.js.map +1 -0
  46. package/dist/cli/quickdraw-docs.js +5 -3
  47. package/dist/cli/quickdraw-docs.js.map +1 -1
  48. package/dist/client/index.d.ts +30 -18
  49. package/dist/client/index.js +8 -6
  50. package/dist/client/index.js.map +1 -1
  51. package/dist/{clientTypes-Bc-G8n-U.d.ts → clientTypes-hWcPUVS9.d.ts} +3 -3
  52. package/dist/{connection-Cr1BU07W.d.ts → connection-CgijdGpT.d.ts} +8 -4
  53. package/dist/{createServer-CP9eDHZZ.d.ts → createServer-Cp-Wk500.d.ts} +36 -14
  54. package/dist/{createTestApp-UKVGEmOf.d.ts → createTestApp-BB_PkqQ7.d.ts} +16 -10
  55. package/dist/{envelope-Cp3YcVxC.d.ts → envelope-DzWyIXjj.d.ts} +18 -4
  56. package/dist/{http-Djj2Inuu.d.ts → http-DotQ5bj8.d.ts} +68 -17
  57. package/dist/index.d.ts +7 -7
  58. package/dist/index.js +37 -13
  59. package/dist/index.js.map +1 -1
  60. package/dist/{infer-Teo1xpsd.d.ts → infer-BmoZsL9a.d.ts} +43 -10
  61. package/dist/logger-Yz93KzdV.d.ts +30 -0
  62. package/dist/{metrics-BdBu5o8G.d.ts → metrics-DW80Exve.d.ts} +2 -2
  63. package/dist/origins-kvpxnVcW.d.ts +8 -0
  64. package/dist/prisma/index.d.ts +5 -5
  65. package/dist/prisma/index.js +130 -67
  66. package/dist/prisma/index.js.map +1 -1
  67. package/dist/{rateLimit-ZMIZJUZF.js → rateLimit-5RKBFLUR.js} +2 -2
  68. package/dist/server/auth/index.d.ts +82 -33
  69. package/dist/server/auth/index.js +273 -268
  70. package/dist/server/auth/index.js.map +1 -1
  71. package/dist/server/express/index.d.ts +9 -2
  72. package/dist/server/express/index.js +1 -1
  73. package/dist/server/index.d.ts +147 -67
  74. package/dist/server/index.js +520 -381
  75. package/dist/server/index.js.map +1 -1
  76. package/dist/server/mcp/index.d.ts +63 -17
  77. package/dist/server/mcp/index.js +256 -54
  78. package/dist/server/mcp/index.js.map +1 -1
  79. package/dist/server/otel.d.ts +3 -3
  80. package/dist/{sharing-DVa8W-yR.d.ts → sharing-UDLn1049.d.ts} +3 -3
  81. package/dist/testing/client.d.ts +14 -14
  82. package/dist/testing/client.js +9 -7
  83. package/dist/testing/client.js.map +1 -1
  84. package/dist/testing/index.d.ts +12 -12
  85. package/dist/testing/index.js +21 -12
  86. package/dist/testing/index.js.map +1 -1
  87. package/dist/testing/mock.d.ts +5 -5
  88. package/dist/testing/mock.js +8 -6
  89. package/dist/{types-Cu0vmx7c.d.ts → types-CYliTP65.d.ts} +1 -1
  90. package/dist/utils/index.d.ts +1 -1
  91. package/package.json +1 -1
  92. package/dist/chunk-2PWMUVC7.js.map +0 -1
  93. package/dist/chunk-4DIQHASK.js.map +0 -1
  94. package/dist/chunk-A6DJBGOG.js.map +0 -1
  95. package/dist/chunk-CDKG4TFA.js.map +0 -1
  96. package/dist/chunk-DD4SKCNO.js.map +0 -1
  97. package/dist/chunk-H23KEFBA.js.map +0 -1
  98. package/dist/chunk-JZBCLNDU.js.map +0 -1
  99. package/dist/chunk-KNDDCVQJ.js.map +0 -1
  100. package/dist/chunk-REX5YPHX.js.map +0 -1
  101. package/dist/chunk-RT6OILOI.js.map +0 -1
  102. package/dist/chunk-TBMKJ26R.js.map +0 -1
  103. package/dist/chunk-VJTFXHOK.js.map +0 -1
  104. package/dist/chunk-YSWH776Y.js +0 -13
  105. package/dist/chunk-YSWH776Y.js.map +0 -1
  106. package/dist/logger-BY28acW-.d.ts +0 -16
  107. /package/dist/{rateLimit-ZMIZJUZF.js.map → rateLimit-5RKBFLUR.js.map} +0 -0
@@ -1,8 +1,9 @@
1
- import { L as Logger } from '../../logger-BY28acW-.js';
1
+ import { L as Logger } from '../../logger-Yz93KzdV.js';
2
2
  import { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http';
3
- import { M as MaybePromise, P as Principal } from '../../types-Cu0vmx7c.js';
4
- import { b as AuthenticateRequest, H as HttpRequest } from '../../auth-BhWqdyb-.js';
5
- import '../../infer-Teo1xpsd.js';
3
+ import { M as MaybePromise, P as Principal } from '../../types-CYliTP65.js';
4
+ import { A as AllowedOrigin } from '../../origins-kvpxnVcW.js';
5
+ import { b as AuthenticateRequest, H as HttpRequest } from '../../auth-DXiSJZaf.js';
6
+ import '../../infer-BmoZsL9a.js';
6
7
  import 'socket.io';
7
8
 
8
9
  /**
@@ -60,10 +61,11 @@ interface SessionCookieOptions {
60
61
  }
61
62
  /**
62
63
  * Sets the session cookie, under the name {@link sessionCookieNameFor} gives
63
- * the response's request, so `socketAuth` and the HTTP transport read it.
64
+ * the response's request, so `socketAuth` and the HTTP transport read it,
65
+ * and clears a stale `__Host-session` that would shadow it.
64
66
  */
65
67
  declare function setSessionCookie(res: CookieResponse, jwt: string, options?: SessionCookieOptions): void;
66
- /** Clears the session cookie `setSessionCookie` sets on the same request. */
68
+ /** Clears the session cookie `setSessionCookie` sets on the same request, and a stale `__Host-session` beside it. */
67
69
  declare function clearSessionCookie(res: CookieResponse, options?: SessionCookieOptions): void;
68
70
 
69
71
  interface JWTPayload {
@@ -86,7 +88,13 @@ interface JWTPayload {
86
88
  */
87
89
  declare function createJWT(payload: Omit<JWTPayload, "exp" | "iat">, secret: string, expiresIn?: string): Promise<string>;
88
90
  /**
89
- * Verify and decode a JWT token.
91
+ * Verify and decode a JWT token: its signature and expiry, nothing more.
92
+ * It is never a session check: a token of a session that was signed out,
93
+ * logged out everywhere or revoked still verifies until the JWT expires (7
94
+ * days by default). Check a session token with `liveSession({ sessions,
95
+ * jwtSecret }, token)`, `bearerAuth(...)` or `socketAuth(...)`, which ask the
96
+ * session store on every call. In development it warns once per process
97
+ * when it verifies a token that carries a session (`sid`).
90
98
  *
91
99
  * @param token - The JWT token to verify
92
100
  * @param secret - The secret key for verification
@@ -190,10 +198,12 @@ declare const googleProvider: OAuthProvider<GoogleUser>;
190
198
  * via `registerMockOAuthProvider`. Users are supplied by the app (typically
191
199
  * seeded demo accounts); no real credentials are involved.
192
200
  *
193
- * Production hard-block: routes are never mounted when NODE_ENV is
194
- * "production" or ENABLE_MOCK_OAUTH !== "true", and every handler re-checks
195
- * NODE_ENV at request time. Apps should add a third layer and refuse to boot
196
- * in production with the flag set.
201
+ * Development only: routes are mounted only when ENABLE_MOCK_OAUTH is
202
+ * "true" and NODE_ENV is "development" or "test" (an allowlist: an unset
203
+ * NODE_ENV, "prod" or "staging" mount nothing, the 5.1 audit's AUTH-3), every
204
+ * handler re-checks NODE_ENV at request time, and mounting them logs a
205
+ * warning. Apps should add a third layer and refuse to boot outside
206
+ * development with the flag set.
197
207
  */
198
208
 
199
209
  interface MockOAuthUser {
@@ -203,6 +213,7 @@ interface MockOAuthUser {
203
213
  picture?: string | null;
204
214
  }
205
215
  declare const DEFAULT_MOCK_PATH_PREFIX = "/auth/mock/provider";
216
+ /** True when ENABLE_MOCK_OAUTH is "true" and NODE_ENV is "development" or "test". */
206
217
  declare function isMockOAuthEnabled(): boolean;
207
218
  interface MockOAuthProviderOptions {
208
219
  /**
@@ -259,8 +270,9 @@ interface RegisterMockOAuthOptions {
259
270
  * Mount the mock OAuth provider endpoints (authorize, token, userinfo) on an
260
271
  * Express-compatible router.
261
272
  *
262
- * No-ops (returning false) unless `isMockOAuthEnabled()` — i.e. in production
263
- * or without ENABLE_MOCK_OAUTH=true the routes are never mounted.
273
+ * No-ops (returning false) unless `isMockOAuthEnabled()` — i.e. without
274
+ * ENABLE_MOCK_OAUTH=true, or unless NODE_ENV is development or test, the
275
+ * routes are never mounted. Mounting them logs a warning.
264
276
  */
265
277
  declare function registerMockOAuthProvider(router: MockOAuthRouter, options: RegisterMockOAuthOptions): boolean;
266
278
 
@@ -351,8 +363,8 @@ interface RequireAuthOptions {
351
363
  /**
352
364
  * Cookie to read the JWT from. Default: the names `setSessionCookie` and
353
365
  * the auth routes set on the same request (`sessionCookieNamesFor`):
354
- * `__Host-session` over HTTPS, `session` (then `__Host-session`) over
355
- * plain HTTP or when `COOKIE_DOMAIN` is set.
366
+ * `__Host-session` over HTTPS, `__Host-session` then `session` over plain
367
+ * HTTP or when `COOKIE_DOMAIN` is set.
356
368
  */
357
369
  cookieName?: string;
358
370
  }
@@ -385,13 +397,6 @@ interface AuthRouteRequest extends IncomingMessage {
385
397
  /** The response the routes answer: Express's, which also sets cookies. */
386
398
  type AuthRouteResponse = ServerResponse & CookieResponse;
387
399
 
388
- /**
389
- * An allowed origin: exact (`"https://app.example.com"`), or a pattern over
390
- * whole origins, anchored at both ends
391
- * (`/^https:\/\/[a-z0-9-]+\.preview\.example\.com$/`).
392
- */
393
- type AllowedOrigin = string | RegExp;
394
-
395
400
  /** The cookie that carries a sign-in in progress, on a request that is not secure. */
396
401
  declare const OAUTH_STATE_COOKIE = "qd_oauth";
397
402
  /**
@@ -607,7 +612,8 @@ declare namespace discord {
607
612
  * The development sign-in: a picker of the app's demo users, served by the
608
613
  * routes through `registerMockOAuthProvider`. Left out (its routes answer
609
614
  * nothing) unless `isMockOAuthEnabled()`: `ENABLE_MOCK_OAUTH=true` and
610
- * `NODE_ENV` other than `production`.
615
+ * `NODE_ENV` `development` or `test` (an unset `NODE_ENV` leaves it out: set
616
+ * `NODE_ENV=development`). Mounting it logs a warning.
611
617
  */
612
618
  declare function mock(options: MockSignInOptions): MockSignInProvider;
613
619
 
@@ -767,8 +773,8 @@ interface SocketAuthOptions<P extends Principal = Principal> {
767
773
  * The session cookie's name. Default: the name the auth routes set on the
768
774
  * same handshake: `"session"` when `COOKIE_DOMAIN` gives the cookie a
769
775
  * domain; else `"__Host-session"` over HTTPS, where the plain name a
770
- * sibling site could plant is never read, and `"session"` (then
771
- * `"__Host-session"`) over plain HTTP. A name given here is the only one
776
+ * sibling site could plant is never read, and `"session"` over plain HTTP,
777
+ * where `"__Host-session"` is read first all the same. A name given here is the only one
772
778
  * read, on any handshake: give the routes' `cookie.name` here, or
773
779
  * `"session"` when their `cookie.domain` is set without `COOKIE_DOMAIN`. A
774
780
  * name the handshake repeats counts as no credential.
@@ -785,9 +791,11 @@ interface SocketAuthOptions<P extends Principal = Principal> {
785
791
  * Development sign-in without a session: a socket whose handshake carries
786
792
  * `auth: { userId }` and no token is that user, as this function answers:
787
793
  * their principal (its `userId` the one named), or `null` to refuse the
788
- * handshake (an unknown id). For a game editor or load-test bots. Never in
789
- * production: `socketAuth` throws when it is given while `NODE_ENV` is
790
- * `"production"`, and refuses such a handshake there anyway. HTTP calls
794
+ * handshake (an unknown id). For a game editor or load-test bots. Only
795
+ * while `NODE_ENV` is `development` or `test`: `socketAuth` throws when it
796
+ * is given otherwise (an unset `NODE_ENV` included: set
797
+ * `NODE_ENV=development`), refuses such a handshake once `NODE_ENV` says
798
+ * otherwise, and `createServer` warns at startup while it is on. HTTP calls
791
799
  * never use it. Pass it only when the app's own flag is on:
792
800
  * `devCredentials: env.ENABLE_DEV_CREDENTIALS ? findDevUser : undefined`.
793
801
  */
@@ -813,13 +821,19 @@ interface CookieOriginRequest {
813
821
  * `Sec-Fetch-Site` names another site, and a socket handshake only when
814
822
  * `Sec-Fetch-Site` is `same-origin` or with `allowMissingOrigin`. A bearer
815
823
  * token is not ambient: check only a credential that came from the cookie
816
- * (`request.credential === "cookie"` on an HTTP `authenticate` request).
824
+ * (`request.sessionCookie` on an HTTP `authenticate` request, where the
825
+ * transport hands an `authenticate` other than socketAuth's the cookie; it is
826
+ * in `auth.token` only for socketAuth's). Then check the session against the
827
+ * store, on every call (`liveSession`).
817
828
  *
818
829
  * @example
819
830
  * authenticate: async (request) => {
820
- * if (request.transport === "http" && request.credential === "cookie" &&
821
- * !cookieOriginAllowed(request, allowedOrigins)) {
822
- * throw new QuickdrawError("FORBIDDEN", "This page may not use the session cookie");
831
+ * if (request.transport === "http" && request.sessionCookie !== undefined) {
832
+ * if (!cookieOriginAllowed(request, allowedOrigins)) {
833
+ * throw new QuickdrawError("FORBIDDEN", "This page may not use the session cookie");
834
+ * }
835
+ * const session = await liveSession({ sessions, jwtSecret }, request.sessionCookie);
836
+ * // ...
823
837
  * }
824
838
  * // ...
825
839
  * }
@@ -836,6 +850,41 @@ declare function socketAuth<P extends Principal>(options: SocketAuthOptions<P> &
836
850
  }): SessionAuthenticate<P>;
837
851
  declare function socketAuth(options: SocketAuthOptions): SessionAuthenticate<Principal>;
838
852
 
853
+ /** Options of {@link bearerAuth}: the auth routes' session store and secret, and how a principal is built. */
854
+ interface BearerAuthOptions<P extends Principal = Principal> extends SessionKeys {
855
+ /**
856
+ * Builds the principal of a session's user, for example `kind: "agent"`
857
+ * for an MCP caller; its `userId` must be the session's. Default
858
+ * `{ userId, kind: "user" }`.
859
+ */
860
+ readonly loadPrincipal?: PrincipalLoader<P>;
861
+ }
862
+ /**
863
+ * What {@link bearerAuth} returns: the principal a bearer token signs in,
864
+ * `null` for no token, and a rejection (`UNAUTHENTICATED`) for a token that
865
+ * is not a live session's.
866
+ */
867
+ type BearerAuthenticate<P extends Principal> = (token: unknown) => Promise<P | null>;
868
+ /**
869
+ * Checks bearer tokens against the auth routes' sessions, on every call: no
870
+ * token (anything but a non-empty string) is anonymous (`null`); a token
871
+ * whose session was signed out, revoked or has expired, or a JWT without a
872
+ * session, is refused with `UNAUTHENTICATED`; a live session's token is its
873
+ * user's principal, built as `socketAuth` builds it. It records no socket
874
+ * session: for `createServer`'s `authenticate` use `socketAuth`.
875
+ *
876
+ * @example
877
+ * const verifySession = bearerAuth({ sessions, jwtSecret, loadPrincipal: (userId) => ({ userId, kind: "agent" }) });
878
+ * // the MCP bridge's principal hook
879
+ * createMcpRegistry({ ..., principal: (request) => verifySession(request.transport === "http" ? request.token : process.env.AGENT_TOKEN) });
880
+ * // an authenticate that takes bearer tokens only
881
+ * createHttpRouter({ dispatcher, auth: { authenticate: ({ auth }) => verifySession(auth.token) } });
882
+ */
883
+ declare function bearerAuth<P extends Principal>(options: BearerAuthOptions<P> & {
884
+ readonly loadPrincipal: PrincipalLoader<P>;
885
+ }): BearerAuthenticate<P>;
886
+ declare function bearerAuth(options: BearerAuthOptions): BearerAuthenticate<Principal>;
887
+
839
888
  /** Options of {@link requireSession}. */
840
889
  interface RequireSessionOptions<P extends Principal = Principal> {
841
890
  /**
@@ -927,4 +976,4 @@ declare function requireSession(keys: SessionKeys, options?: RequireSessionOptio
927
976
  */
928
977
  declare function sessionOf<P extends Principal = Principal>(req: object): RequestSession<P>;
929
978
 
930
- export { type AllowedOrigin, type AuthCookieOptions, type AuthMiddleware, type AuthProfile, type AuthProvider, type AuthProviderInfo, type AuthRateLimits, type AuthRequest, type AuthResponse, type AuthRouteRequest, type AuthRouteResponse, type AuthRoutes, type AuthRoutesOptions, type AuthSession, type CookieOriginRequest, type CookieResponse, type CookieSettings, DEFAULT_MOCK_PATH_PREFIX, DEFAULT_SESSION_TTL_MS, type DevCredentials, type DiscordUser, GUEST_MAX_BODY_BYTES, type GoogleUser, type GuestOptions, type GuestProvider, type GuestUser, HOST_OAUTH_STATE_COOKIE, HOST_SESSION_COOKIE, type IssuedSession, type JWTPayload, MIN_JWT_SECRET_LENGTH, type MemorySessionStore, type MockOAuthProviderOptions, type MockOAuthRouter, type MockOAuthUser, type MockSignInOptions, type MockSignInProvider, OAUTH_RETURN_ORIGIN_COOKIE, OAUTH_STATE_COOKIE, OAUTH_STATE_TTL_MS, type OAuthClientOptions, type OAuthConfig, type OAuthProvider, type OAuthSignInProvider, type OAuthTokenResponse, type OptionalClientOptions, type PrincipalLoader, type RegisterMockOAuthOptions, type RequestSession, type RequireAuthOptions, type RequireSessionOptions, SESSION_COOKIE, type SessionAuthenticate, type SessionCookieOptions, type SessionKeys, type SessionMeta, type SessionMiddleware, type SessionRequest, type SessionStore, type SocketAuthOptions, type ValidateOriginOptions, clearSessionCookie, cookieOriginAllowed, createAuthRoutes, createJWT, createMemorySessionStore, createMockOAuthProvider, createOAuthURL, createRequireAuth, discord, discordProvider, exchangeOAuthCode, extractBearerOrCookieToken, getDiscordAvatarUrl, google, googleProvider, guest, isMockOAuthEnabled, issueSession, liveSession, mock, registerMockOAuthProvider, requireSession, sessionOf, setSessionCookie, socketAuth, validateRedirectOrigin, verifyJWT };
979
+ export { AllowedOrigin, type AuthCookieOptions, type AuthMiddleware, type AuthProfile, type AuthProvider, type AuthProviderInfo, type AuthRateLimits, type AuthRequest, type AuthResponse, type AuthRouteRequest, type AuthRouteResponse, type AuthRoutes, type AuthRoutesOptions, type AuthSession, type BearerAuthOptions, type BearerAuthenticate, type CookieOriginRequest, type CookieResponse, type CookieSettings, DEFAULT_MOCK_PATH_PREFIX, DEFAULT_SESSION_TTL_MS, type DevCredentials, type DiscordUser, GUEST_MAX_BODY_BYTES, type GoogleUser, type GuestOptions, type GuestProvider, type GuestUser, HOST_OAUTH_STATE_COOKIE, HOST_SESSION_COOKIE, type IssuedSession, type JWTPayload, MIN_JWT_SECRET_LENGTH, type MemorySessionStore, type MockOAuthProviderOptions, type MockOAuthRouter, type MockOAuthUser, type MockSignInOptions, type MockSignInProvider, OAUTH_RETURN_ORIGIN_COOKIE, OAUTH_STATE_COOKIE, OAUTH_STATE_TTL_MS, type OAuthClientOptions, type OAuthConfig, type OAuthProvider, type OAuthSignInProvider, type OAuthTokenResponse, type OptionalClientOptions, type PrincipalLoader, type RegisterMockOAuthOptions, type RequestSession, type RequireAuthOptions, type RequireSessionOptions, SESSION_COOKIE, type SessionAuthenticate, type SessionCookieOptions, type SessionKeys, type SessionMeta, type SessionMiddleware, type SessionRequest, type SessionStore, type SocketAuthOptions, type ValidateOriginOptions, bearerAuth, clearSessionCookie, cookieOriginAllowed, createAuthRoutes, createJWT, createMemorySessionStore, createMockOAuthProvider, createOAuthURL, createRequireAuth, discord, discordProvider, exchangeOAuthCode, extractBearerOrCookieToken, getDiscordAvatarUrl, google, googleProvider, guest, isMockOAuthEnabled, issueSession, liveSession, mock, registerMockOAuthProvider, requireSession, sessionOf, setSessionCookie, socketAuth, validateRedirectOrigin, verifyJWT };