@rebasepro/server 0.24.0 → 0.24.1-canary.g19596ef
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 +27 -2
- package/dist/GCSStorageController-DEga1ULx.js +402 -0
- package/dist/GCSStorageController-DEga1ULx.js.map +1 -0
- package/dist/S3StorageController-Btx-6bJ5.js +480 -0
- package/dist/S3StorageController-Btx-6bJ5.js.map +1 -0
- package/dist/api/errors.d.ts +32 -0
- package/dist/api/live-schema-routes.d.ts +27 -3
- package/dist/api/mount-path.d.ts +30 -0
- package/dist/api/mount.d.ts +6 -13
- package/dist/api/rest/api-generator.d.ts +53 -1
- package/dist/api/rest/auth-collection-writes.d.ts +28 -21
- package/dist/api/rest/field-access-query.d.ts +28 -8
- package/dist/api/rest/field-ops.d.ts +19 -7
- package/dist/api/rest/query-body.d.ts +10 -0
- package/dist/api/rest/write-validation.d.ts +7 -5
- package/dist/api/schema-editor-routes.d.ts +10 -1
- package/dist/api/sql-export-routes.d.ts +8 -0
- package/dist/api/types.d.ts +35 -0
- package/dist/{ast-schema-editor-CWqS_sLJ.js → ast-schema-editor-mCeSC03x.js} +3 -3
- package/dist/{ast-schema-editor-CWqS_sLJ.js.map → ast-schema-editor-mCeSC03x.js.map} +1 -1
- package/dist/auth/access.d.ts +62 -11
- package/dist/auth/admin-user-ops.d.ts +24 -2
- package/dist/auth/admin-users-route.d.ts +1 -0
- package/dist/auth/api-keys/api-key-middleware.d.ts +10 -3
- package/dist/auth/api-keys/api-key-routes.d.ts +4 -1
- package/dist/auth/builtin-auth-adapter.d.ts +13 -0
- package/dist/auth/email-change-routes.d.ts +3 -0
- package/dist/auth/expired-token-sweep.d.ts +5 -1
- package/dist/auth/interfaces.d.ts +10 -0
- package/dist/auth/jwks-routes.d.ts +5 -1
- package/dist/auth/jwt-crypto.d.ts +7 -0
- package/dist/auth/jwt-keys.d.ts +4 -0
- package/dist/auth/jwt.d.ts +282 -166
- package/dist/auth/magic-link-routes.d.ts +3 -0
- package/dist/auth/mfa-crypto.d.ts +9 -3
- package/dist/auth/mfa-gate.d.ts +4 -2
- package/dist/auth/mfa-routes.d.ts +6 -0
- package/dist/auth/middleware.d.ts +9 -2
- package/dist/auth/otp-routes.d.ts +3 -0
- package/dist/auth/rate-limiter.d.ts +61 -34
- package/dist/auth/registration-policy.d.ts +17 -0
- package/dist/auth/require-auth.d.ts +1 -1
- package/dist/auth/routes.d.ts +16 -0
- package/dist/auth/session-routes.d.ts +6 -0
- package/dist/auth/token-revocation.d.ts +6 -0
- package/dist/auth/user-picking.d.ts +37 -0
- package/dist/auth/verify-credential.d.ts +25 -4
- package/dist/{auth-DMLngxn_.js → auth-CSBky1mt.js} +2927 -1882
- package/dist/auth-CSBky1mt.js.map +1 -0
- package/dist/auth_adapter-CIItCTc8.js +21 -0
- package/dist/auth_adapter-CIItCTc8.js.map +1 -0
- package/dist/backend/create-backend.d.ts +281 -0
- package/dist/backend/default-backend.d.ts +35 -0
- package/dist/backend/no-collections.d.ts +19 -0
- package/dist/backend/options.d.ts +912 -0
- package/dist/backend/scope.d.ts +23 -0
- package/dist/backend/services.d.ts +54 -0
- package/dist/backend-DTAOsLQc.js.map +1 -1
- package/dist/backup/backup-common.d.ts +14 -3
- package/dist/backup/backup-routes.d.ts +23 -2
- package/dist/backup/backup-storage.d.ts +3 -1
- package/dist/backup/index.d.ts +3 -1
- package/dist/{backup-CN0s50D2.js → backup-DBGRUVTS.js} +178 -37
- package/dist/backup-DBGRUVTS.js.map +1 -0
- package/dist/boot/boot.d.ts +2 -2
- package/dist/boot/driver.d.ts +3 -0
- package/dist/boot/env.d.ts +9 -2
- package/dist/boot/http-server.d.ts +22 -0
- package/dist/boot/options.d.ts +16 -1
- package/dist/boot/provision.d.ts +4 -2
- package/dist/boot/resource-adapters.d.ts +11 -14
- package/dist/boot/runtime-cors.d.ts +17 -0
- package/dist/boot/sources.d.ts +9 -0
- package/dist/boot/static-routing.d.ts +9 -0
- package/dist/{contract-routes-fz8i4pxs.js → contract-routes-DiFwiLg2.js} +5 -21
- package/dist/contract-routes-DiFwiLg2.js.map +1 -0
- package/dist/cron/cron-loader.d.ts +77 -18
- package/dist/cron/cron-routes.d.ts +1 -1
- package/dist/cron/cron-scheduler.d.ts +69 -3
- package/dist/cron/cron-store.d.ts +33 -5
- package/dist/cron/define-cron.d.ts +6 -2
- package/dist/cron/index.d.ts +3 -3
- package/dist/cron-loader-NHqRfKF0.js +202 -0
- package/dist/cron-loader-NHqRfKF0.js.map +1 -0
- package/dist/{cron-routes-Bc-SB0Se.js → cron-routes-DsH8Jwn5.js} +29 -6
- package/dist/cron-routes-DsH8Jwn5.js.map +1 -0
- package/dist/{cron-scheduler-CYQgco86.js → cron-scheduler-D1DT0nw5.js} +300 -34
- package/dist/cron-scheduler-D1DT0nw5.js.map +1 -0
- package/dist/cron-store-DEpVstUU.js +577 -0
- package/dist/cron-store-DEpVstUU.js.map +1 -0
- package/dist/{ddl-bootstrap-BaqMSa4Y.js → ddl-bootstrap-BNqi2NZe.js} +2 -2
- package/dist/{ddl-bootstrap-BaqMSa4Y.js.map → ddl-bootstrap-BNqi2NZe.js.map} +1 -1
- package/dist/email/smtp-email-service.d.ts +23 -0
- package/dist/email/types.d.ts +18 -0
- package/dist/env.d.ts +0 -37
- package/dist/{errors-D6_y86c5.js → errors-Cqp86KnA.js} +166 -7
- package/dist/errors-Cqp86KnA.js.map +1 -0
- package/dist/filter-dialect-O1HK6Nvr.js +1628 -0
- package/dist/filter-dialect-O1HK6Nvr.js.map +1 -0
- package/dist/{function-loader-D7o5Epjj.js → function-loader-DbCSoNJj.js} +69 -39
- package/dist/function-loader-DbCSoNJj.js.map +1 -0
- package/dist/{function-routes-CaNG4waN.js → function-routes-BSTClQNa.js} +6 -5
- package/dist/function-routes-BSTClQNa.js.map +1 -0
- package/dist/functions/context.d.ts +9 -0
- package/dist/functions/define-function.d.ts +10 -6
- package/dist/functions/function-loader.d.ts +75 -18
- package/dist/functions/function-routes.d.ts +2 -1
- package/dist/functions/index.d.ts +5 -4
- package/dist/functions/index.js +59 -15
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/internal.d.ts +2 -2
- package/dist/functions/proxy.d.ts +6 -2
- package/dist/functions/request-timeout.d.ts +7 -5
- package/dist/history/history-routes.d.ts +9 -0
- package/dist/history/retention-sweep.d.ts +81 -0
- package/dist/{history-recorder-Nr8zLvoU.js → history-recorder-RZ1Ow4YY.js} +4 -4
- package/dist/{history-recorder-Nr8zLvoU.js.map → history-recorder-RZ1Ow4YY.js.map} +1 -1
- package/dist/{history-store-rcAm_xFR.js → history-store-DPofGVDp.js} +2 -2
- package/dist/{history-store-rcAm_xFR.js.map → history-store-DPofGVDp.js.map} +1 -1
- package/dist/index.d.ts +24 -11
- package/dist/index.es.js +24758 -20153
- package/dist/index.es.js.map +1 -1
- package/dist/init/docs.d.ts +35 -10
- package/dist/init/process-safety.d.ts +7 -2
- package/dist/init/shutdown.d.ts +18 -3
- package/dist/init.d.ts +49 -865
- package/dist/internal-tables-L2t39RdT.js +136 -0
- package/dist/internal-tables-L2t39RdT.js.map +1 -0
- package/dist/jobs/job-queue.d.ts +8 -0
- package/dist/jobs/job-store.d.ts +24 -0
- package/dist/jobs/types.d.ts +25 -4
- package/dist/{jobs-DqYNfquG.js → jobs-8G-_agld.js} +235 -25
- package/dist/jobs-8G-_agld.js.map +1 -0
- package/dist/{jwt-R6bSPMjk.js → jwt-CBaFc34Y.js} +530 -455
- package/dist/jwt-CBaFc34Y.js.map +1 -0
- package/dist/{keys-GAVZqbqx.js → keys-COzQ2aE8.js} +2 -2
- package/dist/{keys-GAVZqbqx.js.map → keys-COzQ2aE8.js.map} +1 -1
- package/dist/load-failure-L5hvfDoG.js +80 -0
- package/dist/load-failure-L5hvfDoG.js.map +1 -0
- package/dist/{logger-D-S-hO5e.js → logger-Bt32sHFw.js} +17 -4
- package/dist/logger-Bt32sHFw.js.map +1 -0
- package/dist/{logs-routes-DAdv37GI.js → logs-routes-DQJhrf-b.js} +3 -3
- package/dist/{logs-routes-DAdv37GI.js.map → logs-routes-DQJhrf-b.js.map} +1 -1
- package/dist/mcp/mcp-routes.d.ts +6 -0
- package/dist/mcp/mcp-tools.d.ts +8 -0
- package/dist/mcp/oauth-routes.d.ts +7 -0
- package/dist/metrics/index.d.ts +18 -0
- package/dist/metrics/pool-wait.d.ts +50 -0
- package/dist/offline-QNQgsPOq-B2yGeXkn.js +3305 -0
- package/dist/offline-QNQgsPOq-B2yGeXkn.js.map +1 -0
- package/dist/offline-store-Cm5sAX81-CALiO4Gn.js +1915 -0
- package/dist/offline-store-Cm5sAX81-CALiO4Gn.js.map +1 -0
- package/dist/{openapi-generator-DAq_XVDu.js → openapi-generator-CeGW2dLC.js} +366 -82
- package/dist/openapi-generator-CeGW2dLC.js.map +1 -0
- package/dist/policy-PdzX-Opd.js +121 -0
- package/dist/policy-PdzX-Opd.js.map +1 -0
- package/dist/project_manifest-R6y_KHms.js +59 -0
- package/dist/project_manifest-R6y_KHms.js.map +1 -0
- package/dist/{proxy-qRlqeUmO.js → proxy-BEKbsil6.js} +5 -4
- package/dist/proxy-BEKbsil6.js.map +1 -0
- package/dist/{query-parser-BgiKJKvc.js → query-parser-ECxP0nDw.js} +511 -16
- package/dist/query-parser-ECxP0nDw.js.map +1 -0
- package/dist/{request-timeout-DgH7j8qO.js → request-timeout-BiRelY-U.js} +17 -10
- package/dist/request-timeout-BiRelY-U.js.map +1 -0
- package/dist/resumable-upload-threshold-CKv-Ry0l.js +24 -0
- package/dist/resumable-upload-threshold-CKv-Ry0l.js.map +1 -0
- package/dist/schema-edit/apply-schema-change.d.ts +10 -0
- package/dist/schema-edit/local-source.d.ts +29 -0
- package/dist/schema-edit/remote-source.d.ts +13 -3
- package/dist/schema-edit/source-editor.d.ts +28 -0
- package/dist/{schema-editor-routes-oIyuWl3L.js → schema-editor-routes-DRXBAbZy.js} +55 -11
- package/dist/schema-editor-routes-DRXBAbZy.js.map +1 -0
- package/dist/services/outbound-post.d.ts +50 -0
- package/dist/services/outbound-url-guard.d.ts +34 -5
- package/dist/services/routed-realtime-service.d.ts +5 -0
- package/dist/services/webhook-service.d.ts +66 -14
- package/dist/singleton.d.ts +9 -5
- package/dist/soft-delete-params-CBryZXMq.js +668 -0
- package/dist/soft-delete-params-CBryZXMq.js.map +1 -0
- package/dist/sql-export-routes-D8ZaRvoR.js +240 -0
- package/dist/sql-export-routes-D8ZaRvoR.js.map +1 -0
- package/dist/{src-CatHFUym.js → src-D5Y3N-S4.js} +2 -1
- package/dist/{src-CatHFUym.js.map → src-D5Y3N-S4.js.map} +1 -1
- package/dist/storage/GCSStorageController.d.ts +46 -2
- package/dist/storage/LocalStorageController.d.ts +67 -2
- package/dist/storage/S3StorageController.d.ts +37 -3
- package/dist/storage/image-transform.d.ts +15 -0
- package/dist/storage/maintenance-routes.d.ts +23 -0
- package/dist/storage/maintenance.d.ts +126 -0
- package/dist/storage/rendition-cache.d.ts +9 -11
- package/dist/storage/request-principals.d.ts +30 -0
- package/dist/storage/routes.d.ts +20 -0
- package/dist/storage/source-variables.d.ts +10 -0
- package/dist/storage/streams.d.ts +42 -0
- package/dist/storage/tus-handler.d.ts +46 -2
- package/dist/storage/types.d.ts +82 -7
- package/dist/storage/upload-validation.d.ts +13 -0
- package/dist/storage-resumable-VO-cMpse-C_YX71pO.js +125 -0
- package/dist/storage-resumable-VO-cMpse-C_YX71pO.js.map +1 -0
- package/dist/strings.es-BeZWAodn.js +256 -0
- package/dist/strings.es-BeZWAodn.js.map +1 -0
- package/dist/upload-validation-CVobI5xO.js +172 -0
- package/dist/upload-validation-CVobI5xO.js.map +1 -0
- package/dist/utils/byte-size.d.ts +10 -0
- package/dist/utils/compression.d.ts +6 -0
- package/dist/utils/load-failure.d.ts +14 -0
- package/dist/utils/logger.d.ts +9 -0
- package/package.json +5 -5
- package/dist/GCSStorageController-BSiP1c-f.js +0 -256
- package/dist/GCSStorageController-BSiP1c-f.js.map +0 -1
- package/dist/S3StorageController-CAwFRgjV.js +0 -276
- package/dist/S3StorageController-CAwFRgjV.js.map +0 -1
- package/dist/auth-DMLngxn_.js.map +0 -1
- package/dist/backup-CN0s50D2.js.map +0 -1
- package/dist/contract-routes-fz8i4pxs.js.map +0 -1
- package/dist/cron-loader-CwaANlOG.js +0 -118
- package/dist/cron-loader-CwaANlOG.js.map +0 -1
- package/dist/cron-routes-Bc-SB0Se.js.map +0 -1
- package/dist/cron-scheduler-CYQgco86.js.map +0 -1
- package/dist/cron-store-D2Q9-Aco.js +0 -300
- package/dist/cron-store-D2Q9-Aco.js.map +0 -1
- package/dist/dynamic-import-X40pTZUQ.js +0 -23
- package/dist/dynamic-import-X40pTZUQ.js.map +0 -1
- package/dist/errors-D6_y86c5.js.map +0 -1
- package/dist/function-loader-D7o5Epjj.js.map +0 -1
- package/dist/function-routes-CaNG4waN.js.map +0 -1
- package/dist/jobs-DqYNfquG.js.map +0 -1
- package/dist/jwt-R6bSPMjk.js.map +0 -1
- package/dist/logger-D-S-hO5e.js.map +0 -1
- package/dist/openapi-generator-DAq_XVDu.js.map +0 -1
- package/dist/proxy-qRlqeUmO.js.map +0 -1
- package/dist/query-parser-BgiKJKvc.js.map +0 -1
- package/dist/request-timeout-DgH7j8qO.js.map +0 -1
- package/dist/schema-editor-routes-oIyuWl3L.js.map +0 -1
- package/dist/soft-delete-params-BWPilMPF.js +0 -59
- package/dist/soft-delete-params-BWPilMPF.js.map +0 -1
- package/dist/src-I3aG1PcY.js +0 -6870
- package/dist/src-I3aG1PcY.js.map +0 -1
- package/dist/types-BfKcm9do.js +0 -39
- package/dist/types-BfKcm9do.js.map +0 -1
|
@@ -23,6 +23,7 @@ import { type DataDriver } from "@rebasepro/types";
|
|
|
23
23
|
import type { HonoEnv } from "../../api/types.js";
|
|
24
24
|
import type { ApiKeyStore } from "./api-key-store.js";
|
|
25
25
|
import type { ApiKeyMasked } from "./api-key-types.js";
|
|
26
|
+
import { type AccessControl } from "../access.js";
|
|
26
27
|
/**
|
|
27
28
|
* Check whether a token looks like a Rebase API key.
|
|
28
29
|
*/
|
|
@@ -41,8 +42,12 @@ export interface ApiKeyRefusal {
|
|
|
41
42
|
/**
|
|
42
43
|
* Verify a presented key: it exists, is live, and — for a personal key —
|
|
43
44
|
* personal keys are on and its owner still exists. Records the use.
|
|
45
|
+
*
|
|
46
|
+
* `access` is the backend the key belongs to: whether it takes personal keys,
|
|
47
|
+
* how it finds their owners, and what their roles hold. The process default
|
|
48
|
+
* when omitted.
|
|
44
49
|
*/
|
|
45
|
-
export declare function resolveApiKey(store: ApiKeyStore, token: string): Promise<ApiKeyIdentity | ApiKeyRefusal>;
|
|
50
|
+
export declare function resolveApiKey(store: ApiKeyStore, token: string, access?: AccessControl): Promise<ApiKeyIdentity | ApiKeyRefusal>;
|
|
46
51
|
/**
|
|
47
52
|
* Options for the API key authentication handler.
|
|
48
53
|
*/
|
|
@@ -81,9 +86,11 @@ export declare function createTusScopeGuard(): MiddlewareHandler<HonoEnv>;
|
|
|
81
86
|
*
|
|
82
87
|
* @param mountPrefix - The path the functions router is mounted at
|
|
83
88
|
* (e.g. `/api/functions`), used to extract the function
|
|
84
|
-
* name from the request path.
|
|
89
|
+
* name from the request path. Omitted, it is the
|
|
90
|
+
* `mountPath` the functions group recorded for this
|
|
91
|
+
* request — wherever the application mounted it.
|
|
85
92
|
*/
|
|
86
|
-
export declare function createFunctionScopeGuard(mountPrefix
|
|
93
|
+
export declare function createFunctionScopeGuard(mountPrefix?: string): MiddlewareHandler<HonoEnv>;
|
|
87
94
|
/**
|
|
88
95
|
* Pre-auth middleware for `rk_` bearer tokens.
|
|
89
96
|
*
|
|
@@ -33,7 +33,10 @@ export interface ApiKeyRouteOptions {
|
|
|
33
33
|
revocationRepo?: import("../token-revocation.js").AccessJudgeRepository;
|
|
34
34
|
/** What a scope's target may name. Unset, targets are not checked for existence. */
|
|
35
35
|
targets?: KeyTargets;
|
|
36
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The access model to validate scopes against. Defaults to the one of the
|
|
38
|
+
* backend answering the request.
|
|
39
|
+
*/
|
|
37
40
|
accessModel?: () => AccessModel;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* present the same functionality through the pluggable `AuthAdapter` contract.
|
|
11
11
|
*/
|
|
12
12
|
import type { AuthAdapter } from "@rebasepro/types";
|
|
13
|
+
import { type JwtService } from "./jwt.js";
|
|
14
|
+
import type { AuthLimiters } from "./rate-limiter.js";
|
|
15
|
+
import type { AccessControl } from "./access.js";
|
|
13
16
|
import type { CaptchaConfig } from "./captcha.js";
|
|
14
17
|
import type { AuthRepository, OAuthProvider } from "./interfaces.js";
|
|
15
18
|
import type { AuthHooks } from "./auth-hooks.js";
|
|
@@ -23,6 +26,16 @@ import type { EmailService, EmailConfig } from "../email/index.js";
|
|
|
23
26
|
export interface BuiltinAuthAdapterConfig {
|
|
24
27
|
/** The bootstrapper-provided auth repository (users, roles, tokens). */
|
|
25
28
|
authRepository: AuthRepository;
|
|
29
|
+
/**
|
|
30
|
+
* The backend this adapter signs and verifies tokens for —
|
|
31
|
+
* `backend.services.jwt`, or a service of your own from `createJwtService`.
|
|
32
|
+
* The process default (what `configureJwt` sets) when omitted.
|
|
33
|
+
*/
|
|
34
|
+
jwt?: JwtService;
|
|
35
|
+
/** The backend's auth limiters, counting in its own store. The process default's set when omitted. */
|
|
36
|
+
limiters?: AuthLimiters;
|
|
37
|
+
/** The backend's access model, which the default role is checked against. The process default when omitted. */
|
|
38
|
+
access?: AccessControl;
|
|
26
39
|
/** Email service for password resets, verification, etc. */
|
|
27
40
|
emailService?: EmailService;
|
|
28
41
|
/** Email configuration. */
|
|
@@ -26,6 +26,7 @@ import { z } from "zod";
|
|
|
26
26
|
import type { HonoEnv } from "../api/types.js";
|
|
27
27
|
import type { MiddlewareHandler } from "hono";
|
|
28
28
|
import type { resolveAuthHooks } from "./auth-hooks.js";
|
|
29
|
+
import type { AuthLimiters } from "./rate-limiter.js";
|
|
29
30
|
import type { AuthModuleConfig } from "./routes.js";
|
|
30
31
|
/** How long an address-change link stays usable. */
|
|
31
32
|
export declare const EMAIL_CHANGE_TTL_MS: number;
|
|
@@ -36,6 +37,8 @@ interface EmailChangeRoutesConfig {
|
|
|
36
37
|
parseBody: <T>(schema: z.ZodSchema<T>, body: unknown) => T;
|
|
37
38
|
/** A signed-in user, with the revocation watermark consulted. */
|
|
38
39
|
requireLiveSession: MiddlewareHandler<HonoEnv>;
|
|
40
|
+
/** The backend's auth limiters. */
|
|
41
|
+
limiters: AuthLimiters;
|
|
39
42
|
}
|
|
40
43
|
export declare function mountEmailChangeRoutes(opts: EmailChangeRoutesConfig): void;
|
|
41
44
|
export {};
|
|
@@ -40,7 +40,11 @@ export type ExpiredTokenSweepOutcome = "swept" | "claimed-elsewhere" | "unclaime
|
|
|
40
40
|
export interface ExpiredTokenSweep {
|
|
41
41
|
/** Sweep now, then once per interval. */
|
|
42
42
|
start(): void;
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* No more ticks. Resolves once a tick already running has finished, so a
|
|
45
|
+
* caller about to close the pool can wait for the tick still using it.
|
|
46
|
+
*/
|
|
47
|
+
stop(): Promise<void>;
|
|
44
48
|
/** One tick: claim this interval's slot and, if it is ours, sweep. */
|
|
45
49
|
runSlot(): Promise<ExpiredTokenSweepOutcome>;
|
|
46
50
|
}
|
|
@@ -324,6 +324,16 @@ export interface UserRepository {
|
|
|
324
324
|
* List users with server-side pagination, search, and sorting.
|
|
325
325
|
*/
|
|
326
326
|
listUsersPaginated(options?: ListUsersOptions): Promise<PaginatedUsersResult>;
|
|
327
|
+
/**
|
|
328
|
+
* The ids of at most `limit` users, in no particular order. Answers "is
|
|
329
|
+
* there any user?" (`limit` 1) and "is this the only one?" (`limit` 2).
|
|
330
|
+
*
|
|
331
|
+
* `listUsersPaginated` answered those by counting the whole table and
|
|
332
|
+
* sorting it, on every anonymous `GET /auth/config` and every sign-up.
|
|
333
|
+
* Optional: a repository without it is asked through `listUsersPaginated`
|
|
334
|
+
* instead (`isUserTableEmpty` / `isOnlyUser` in `registration-policy.ts`).
|
|
335
|
+
*/
|
|
336
|
+
firstUserIds?(limit: number): Promise<string[]>;
|
|
327
337
|
/**
|
|
328
338
|
* Update user's password hash. `null` removes the password: the account
|
|
329
339
|
* then signs in only by link, code or provider.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import type { HonoEnv } from "../api/types.js";
|
|
3
|
+
import { type JwtService } from "./jwt.js";
|
|
3
4
|
/**
|
|
4
5
|
* `GET /.well-known/jwks.json` — the public keys that verify this issuer's
|
|
5
6
|
* access tokens.
|
|
@@ -13,5 +14,8 @@ import type { HonoEnv } from "../api/types.js";
|
|
|
13
14
|
* where every verifier looks — an issuer of `https://api.example.com` implies
|
|
14
15
|
* `https://api.example.com/.well-known/jwks.json`, whatever the API happens to
|
|
15
16
|
* be prefixed with.
|
|
17
|
+
*
|
|
18
|
+
* `jwt` is the issuer whose keys these are — a backend's own
|
|
19
|
+
* (`backend.services.jwt`), or the process default when omitted.
|
|
16
20
|
*/
|
|
17
|
-
export declare function createJwksRoutes(): Hono<HonoEnv>;
|
|
21
|
+
export declare function createJwksRoutes(jwt?: JwtService): Hono<HonoEnv>;
|
|
@@ -74,6 +74,13 @@ export declare function signJwt(payload: JwtClaims, key: JwtSigningKey, options:
|
|
|
74
74
|
export declare function verifyJwt(token: string, key: JwtVerificationKey, options: {
|
|
75
75
|
algorithms: string[];
|
|
76
76
|
}): Promise<JwtClaims>;
|
|
77
|
+
/**
|
|
78
|
+
* Whether a {@link verifyJwt} rejection says only that the token's `exp` has
|
|
79
|
+
* passed — the routine refusal that sends a client to refresh — rather than
|
|
80
|
+
* that the token is not one we signed. Here because the library decides how
|
|
81
|
+
* that is spelled.
|
|
82
|
+
*/
|
|
83
|
+
export declare function isExpiredJwtError(error: unknown): boolean;
|
|
77
84
|
/**
|
|
78
85
|
* The token's unverified header — `kid` and `alg` — or an empty object.
|
|
79
86
|
*
|
package/dist/auth/jwt-keys.d.ts
CHANGED
|
@@ -106,3 +106,7 @@ export declare function normalizePemFromEnv(value: string): string;
|
|
|
106
106
|
export declare function toJwks(keys: ResolvedJwtKey[]): {
|
|
107
107
|
keys: PublicJwk[];
|
|
108
108
|
};
|
|
109
|
+
/** A verification key, as `jsonwebtoken.verify` would import it, once per string. */
|
|
110
|
+
export declare function importedVerificationKey<K>(key: K): K | KeyObject;
|
|
111
|
+
/** A signing key, as `jsonwebtoken.sign` would import it, once per string. */
|
|
112
|
+
export declare function importedSigningKey<K>(key: K): K | KeyObject;
|