@rebasepro/server 0.21.2-canary.g1ea48be → 0.23.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.
- package/dist/{GCSStorageController-CLIJXwGS.js → GCSStorageController-CjrA4PMo.js} +37 -23
- package/dist/GCSStorageController-CjrA4PMo.js.map +1 -0
- package/dist/{S3StorageController-Dcuf8lMA.js → S3StorageController-B6pKDNVj.js} +2 -2
- package/dist/{S3StorageController-Dcuf8lMA.js.map → S3StorageController-B6pKDNVj.js.map} +1 -1
- package/dist/api/ast-schema-editor.d.ts +35 -0
- package/dist/api/live-schema-routes.d.ts +14 -0
- package/dist/api/rest/api-generator.d.ts +117 -35
- package/dist/api/rest/auth-collection-writes.d.ts +85 -0
- package/dist/api/rest/field-access-query.d.ts +6 -2
- package/dist/api/rest/idempotency.d.ts +7 -1
- package/dist/api/rest/nested-write-access.d.ts +46 -0
- package/dist/api/rest/write-validation.d.ts +32 -0
- package/dist/{ast-schema-editor-CslO8Oje.js → ast-schema-editor-Mvr50v_S.js} +104 -4
- package/dist/ast-schema-editor-Mvr50v_S.js.map +1 -0
- package/dist/auth/address-ownership.d.ts +53 -0
- package/dist/auth/admin-user-ops.d.ts +35 -2
- package/dist/auth/auth-hooks.d.ts +4 -0
- package/dist/auth/captcha.d.ts +5 -0
- package/dist/auth/interfaces.d.ts +36 -6
- package/dist/auth/jwt.d.ts +17 -0
- package/dist/auth/oauth-signin-policy.d.ts +25 -8
- package/dist/auth/rate-limiter.d.ts +31 -1
- package/dist/auth/session-routes.d.ts +7 -0
- package/dist/auth/token-revocation.d.ts +4 -1
- package/dist/{auth-DZXQRmYD.js → auth-B-GIMpDG.js} +643 -230
- package/dist/auth-B-GIMpDG.js.map +1 -0
- package/dist/backend-DTAOsLQc.js +30 -0
- package/dist/backend-DTAOsLQc.js.map +1 -0
- package/dist/backup/backup-common.d.ts +19 -0
- package/dist/{backup-DzI9jLwc.js → backup-D7YR94N3.js} +69 -8
- package/dist/backup-D7YR94N3.js.map +1 -0
- package/dist/boot/driver.d.ts +10 -0
- package/dist/boot/env.d.ts +2 -2
- package/dist/boot/fetch-bundle.d.ts +18 -1
- package/dist/boot/rls-audit-option.d.ts +26 -0
- package/dist/boot/sources.d.ts +1 -0
- package/dist/{contract-routes-eLxV0le1.js → contract-routes-CbFjuBwa.js} +2 -2
- package/dist/{contract-routes-eLxV0le1.js.map → contract-routes-CbFjuBwa.js.map} +1 -1
- package/dist/cron/cron-routes.d.ts +7 -2
- package/dist/cron/cron-scheduler.d.ts +128 -8
- package/dist/cron/cron-store.d.ts +72 -8
- package/dist/cron/index.d.ts +1 -1
- package/dist/{cron-loader-CQjvjpEw.js → cron-loader-DfTj2Hbi.js} +2 -2
- package/dist/{cron-loader-CQjvjpEw.js.map → cron-loader-DfTj2Hbi.js.map} +1 -1
- package/dist/{cron-routes-cv0hSd-O.js → cron-routes-eE8nif_b.js} +33 -12
- package/dist/cron-routes-eE8nif_b.js.map +1 -0
- package/dist/{cron-scheduler-COPQxlEq.js → cron-scheduler-B0pLfAix.js} +394 -68
- package/dist/cron-scheduler-B0pLfAix.js.map +1 -0
- package/dist/{cron-store-Bdm7JqFB.js → cron-store-TcoGz-xS.js} +133 -12
- package/dist/cron-store-TcoGz-xS.js.map +1 -0
- package/dist/{ddl-bootstrap-CfNvxMuK.js → ddl-bootstrap-C6mo0Kmz.js} +2 -25
- package/dist/ddl-bootstrap-C6mo0Kmz.js.map +1 -0
- package/dist/email/link-base.d.ts +5 -4
- package/dist/email/smtp-email-service.d.ts +13 -1
- package/dist/email/templates.d.ts +9 -0
- package/dist/email/types.d.ts +3 -2
- package/dist/env.d.ts +24 -5
- package/dist/{history-recorder-CYfkqP2X.js → history-recorder-B4MpJfJK.js} +8 -6
- package/dist/history-recorder-B4MpJfJK.js.map +1 -0
- package/dist/{history-store-B1CBwLfi.js → history-store-BhxWOuz9.js} +2 -2
- package/dist/{history-store-B1CBwLfi.js.map → history-store-BhxWOuz9.js.map} +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.es.js +2769 -878
- package/dist/index.es.js.map +1 -1
- package/dist/init/docs.d.ts +5 -2
- package/dist/init/global-callbacks.d.ts +21 -0
- package/dist/init/shutdown.d.ts +8 -3
- package/dist/jobs/index.d.ts +2 -2
- package/dist/jobs/job-queue.d.ts +23 -2
- package/dist/jobs/job-store.d.ts +37 -5
- package/dist/jobs/types.d.ts +8 -6
- package/dist/{jobs-2fO2BI8P.js → jobs-CazMYhyy.js} +305 -166
- package/dist/jobs-CazMYhyy.js.map +1 -0
- package/dist/{jwt-C4OW-DNq.js → jwt-DnQHNFCl.js} +77 -25
- package/dist/{jwt-C4OW-DNq.js.map → jwt-DnQHNFCl.js.map} +1 -1
- package/dist/{keys-Qfc4XieN.js → keys-CogCQpxG.js} +18 -3
- package/dist/{keys-Qfc4XieN.js.map → keys-CogCQpxG.js.map} +1 -1
- package/dist/{logs-routes-3EEzPjhl.js → logs-routes-Bj4TYYUl.js} +7 -4
- package/dist/{logs-routes-3EEzPjhl.js.map → logs-routes-Bj4TYYUl.js.map} +1 -1
- package/dist/mcp/mcp-routes.d.ts +38 -2
- package/dist/mcp/mcp-tools.d.ts +7 -1
- package/dist/mcp/oauth-routes.d.ts +27 -0
- package/dist/mcp/oauth-store.d.ts +29 -13
- package/dist/metrics/history-recorder.d.ts +1 -1
- package/dist/{openapi-generator-D8ZIN_ss.js → openapi-generator-O_O24MAT.js} +34 -12
- package/dist/openapi-generator-O_O24MAT.js.map +1 -0
- package/dist/{query-parser-CoIOmflr.js → query-parser-DGRVFNM3.js} +39 -30
- package/dist/query-parser-DGRVFNM3.js.map +1 -0
- package/dist/rls-audit/index.d.ts +4 -0
- package/dist/{schema-editor-routes-DdLihzp0.js → schema-editor-routes-C5-lh_jO.js} +2 -2
- package/dist/{schema-editor-routes-DdLihzp0.js.map → schema-editor-routes-C5-lh_jO.js.map} +1 -1
- package/dist/{src-BYax9_rm.js → src-pmvW7BFx.js} +189 -14
- package/dist/src-pmvW7BFx.js.map +1 -0
- package/dist/{src-Br6ARbs6.js → src-vkcwKXbT.js} +2 -27
- package/dist/{src-Br6ARbs6.js.map → src-vkcwKXbT.js.map} +1 -1
- package/dist/storage/GCSStorageController.d.ts +11 -1
- package/dist/storage/keys.d.ts +12 -0
- package/dist/storage/rendition-cache.d.ts +11 -1
- package/dist/storage/request-keys.d.ts +67 -0
- package/dist/storage/types.d.ts +17 -1
- package/dist/types-BfKcm9do.js.map +1 -1
- package/package.json +9 -9
- package/dist/GCSStorageController-CLIJXwGS.js.map +0 -1
- package/dist/ast-schema-editor-CslO8Oje.js.map +0 -1
- package/dist/auth-DZXQRmYD.js.map +0 -1
- package/dist/backup-DzI9jLwc.js.map +0 -1
- package/dist/cron-routes-cv0hSd-O.js.map +0 -1
- package/dist/cron-scheduler-COPQxlEq.js.map +0 -1
- package/dist/cron-store-Bdm7JqFB.js.map +0 -1
- package/dist/ddl-bootstrap-CfNvxMuK.js.map +0 -1
- package/dist/history-recorder-CYfkqP2X.js.map +0 -1
- package/dist/jobs-2fO2BI8P.js.map +0 -1
- package/dist/openapi-generator-D8ZIN_ss.js.map +0 -1
- package/dist/query-parser-CoIOmflr.js.map +0 -1
- package/dist/src-BYax9_rm.js.map +0 -1
|
@@ -4,7 +4,7 @@ globalThis.process ??= __rebaseProcess;
|
|
|
4
4
|
__rebaseCreateRequire(import.meta.url);
|
|
5
5
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./rolldown-runtime-dW7B1o5h.js";
|
|
6
6
|
import { r as logger } from "./logger-DO2PZc4i.js";
|
|
7
|
-
import {
|
|
7
|
+
import { a as canonicalStorageId } from "./keys-CogCQpxG.js";
|
|
8
8
|
import { createPrivateKey, createPublicKey } from "crypto";
|
|
9
9
|
//#region src/utils/portable-crypto.ts
|
|
10
10
|
/**
|
|
@@ -4436,6 +4436,7 @@ var jwt_exports = /* @__PURE__ */ __exportAll({
|
|
|
4436
4436
|
hasAsymmetricSigningKey: () => hasAsymmetricSigningKey,
|
|
4437
4437
|
hashRefreshToken: () => hashRefreshToken,
|
|
4438
4438
|
isJwtConfigured: () => isJwtConfigured,
|
|
4439
|
+
parseDurationMs: () => parseDurationMs,
|
|
4439
4440
|
signPurposeToken: () => signPurposeToken,
|
|
4440
4441
|
verifyAccessToken: () => verifyAccessToken,
|
|
4441
4442
|
verifyDownloadToken: () => verifyDownloadToken,
|
|
@@ -4523,9 +4524,18 @@ function configureJwt(config) {
|
|
|
4523
4524
|
active = resolved.find((key) => key.kid === config.activeKid) ?? null;
|
|
4524
4525
|
if (!active) throw new Error(`auth.activeKid is "${config.activeKid}", which is not among the configured signing keys (${resolved.map((k) => `"${k.kid}"`).join(", ")}). Signing with a key nobody published produces tokens no verifier can check.`);
|
|
4525
4526
|
} else active = resolved[0];
|
|
4527
|
+
const lifetimes = {};
|
|
4528
|
+
for (const key of ["accessExpiresIn", "refreshExpiresIn"]) {
|
|
4529
|
+
const value = config[key];
|
|
4530
|
+
if (value === void 0) continue;
|
|
4531
|
+
if (parseDurationMs(value) === null) throw new Error(`auth.${key} is "${value}", which is not a lifetime. Give a positive number and a unit — "15m", "1h", "30d", "1w", "2 weeks" — in the grammar the token signer reads (vercel/ms). A bare number is refused: the signer reads it as milliseconds.`);
|
|
4532
|
+
lifetimes[key] = value;
|
|
4533
|
+
}
|
|
4526
4534
|
jwtConfig = {
|
|
4527
4535
|
...jwtConfig,
|
|
4528
|
-
...config
|
|
4536
|
+
...config,
|
|
4537
|
+
accessExpiresIn: lifetimes.accessExpiresIn ?? jwtConfig.accessExpiresIn,
|
|
4538
|
+
refreshExpiresIn: lifetimes.refreshExpiresIn ?? jwtConfig.refreshExpiresIn
|
|
4529
4539
|
};
|
|
4530
4540
|
signingKeys = resolved;
|
|
4531
4541
|
activeSigningKey = active;
|
|
@@ -4585,16 +4595,59 @@ async function generateAccessToken(uid, roles, aal = "aal1", customClaims, isAno
|
|
|
4585
4595
|
* Get the expiration time of an access token in milliseconds from now
|
|
4586
4596
|
*/
|
|
4587
4597
|
function getAccessTokenExpiryMs() {
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
+
return parseDurationMs(jwtConfig.accessExpiresIn || "1h") ?? 3600 * 1e3;
|
|
4599
|
+
}
|
|
4600
|
+
var DURATION_UNIT_MS = {
|
|
4601
|
+
ms: 1,
|
|
4602
|
+
msec: 1,
|
|
4603
|
+
msecs: 1,
|
|
4604
|
+
millisecond: 1,
|
|
4605
|
+
milliseconds: 1,
|
|
4606
|
+
s: 1e3,
|
|
4607
|
+
sec: 1e3,
|
|
4608
|
+
secs: 1e3,
|
|
4609
|
+
second: 1e3,
|
|
4610
|
+
seconds: 1e3,
|
|
4611
|
+
m: 6e4,
|
|
4612
|
+
min: 6e4,
|
|
4613
|
+
mins: 6e4,
|
|
4614
|
+
minute: 6e4,
|
|
4615
|
+
minutes: 6e4,
|
|
4616
|
+
h: 36e5,
|
|
4617
|
+
hr: 36e5,
|
|
4618
|
+
hrs: 36e5,
|
|
4619
|
+
hour: 36e5,
|
|
4620
|
+
hours: 36e5,
|
|
4621
|
+
d: 864e5,
|
|
4622
|
+
day: 864e5,
|
|
4623
|
+
days: 864e5,
|
|
4624
|
+
w: 6048e5,
|
|
4625
|
+
week: 6048e5,
|
|
4626
|
+
weeks: 6048e5,
|
|
4627
|
+
y: 315576e5,
|
|
4628
|
+
yr: 315576e5,
|
|
4629
|
+
yrs: 315576e5,
|
|
4630
|
+
year: 315576e5,
|
|
4631
|
+
years: 315576e5
|
|
4632
|
+
};
|
|
4633
|
+
/**
|
|
4634
|
+
* A lifetime setting in milliseconds, or null when it is not one.
|
|
4635
|
+
*
|
|
4636
|
+
* The grammar is vercel/ms, because that is what `jsonwebtoken` reads
|
|
4637
|
+
* `expiresIn` with: the token's `exp` and the expiry this module reports
|
|
4638
|
+
* have to come from one reading of the same string, and they used to come
|
|
4639
|
+
* from two — ours understood `<integer><d|h|m|s>` and nothing else.
|
|
4640
|
+
*
|
|
4641
|
+
* Stricter than ms in two ways, both about values nobody means: a bare number
|
|
4642
|
+
* (ms reads "3600" as 3.6 seconds) and a lifetime of zero or less.
|
|
4643
|
+
*/
|
|
4644
|
+
function parseDurationMs(value) {
|
|
4645
|
+
const match = /^(\d+(?:\.\d+)?|\.\d+) *([a-z]+)$/i.exec(value);
|
|
4646
|
+
if (!match) return null;
|
|
4647
|
+
const unit = DURATION_UNIT_MS[match[2].toLowerCase()];
|
|
4648
|
+
if (unit === void 0) return null;
|
|
4649
|
+
const ms = parseFloat(match[1]) * unit;
|
|
4650
|
+
return ms > 0 && Number.isFinite(ms) ? ms : null;
|
|
4598
4651
|
}
|
|
4599
4652
|
/**
|
|
4600
4653
|
* Get the expiration timestamp for an access token
|
|
@@ -4670,7 +4723,7 @@ function hashRefreshToken(token) {
|
|
|
4670
4723
|
* what is actually enforced, which is worse than knowing the ceiling.
|
|
4671
4724
|
*/
|
|
4672
4725
|
var MAX_COOKIE_AGE_MS = 400 * 24 * 60 * 60 * 1e3;
|
|
4673
|
-
/** Fallback when `refreshExpiresIn` is unset
|
|
4726
|
+
/** Fallback when `refreshExpiresIn` is unset. {@link configureJwt} refuses an unparseable one. */
|
|
4674
4727
|
var DEFAULT_REFRESH_TTL_MS = MAX_COOKIE_AGE_MS;
|
|
4675
4728
|
/**
|
|
4676
4729
|
* How long a refresh token is valid for, in milliseconds.
|
|
@@ -4682,16 +4735,8 @@ var DEFAULT_REFRESH_TTL_MS = MAX_COOKIE_AGE_MS;
|
|
|
4682
4735
|
* when they say they expect to still be signed in.
|
|
4683
4736
|
*/
|
|
4684
4737
|
function getRefreshTokenTtlMs() {
|
|
4685
|
-
const
|
|
4686
|
-
|
|
4687
|
-
const value = parseInt(match[1], 10);
|
|
4688
|
-
switch (match[2]) {
|
|
4689
|
-
case "d": return value * 24 * 60 * 60 * 1e3;
|
|
4690
|
-
case "h": return value * 60 * 60 * 1e3;
|
|
4691
|
-
case "m": return value * 60 * 1e3;
|
|
4692
|
-
case "s": return value * 1e3;
|
|
4693
|
-
default: return DEFAULT_REFRESH_TTL_MS;
|
|
4694
|
-
}
|
|
4738
|
+
const duration = jwtConfig.refreshExpiresIn;
|
|
4739
|
+
return (duration ? parseDurationMs(duration) : null) ?? DEFAULT_REFRESH_TTL_MS;
|
|
4695
4740
|
}
|
|
4696
4741
|
/**
|
|
4697
4742
|
* Calculate refresh token expiration date
|
|
@@ -4732,13 +4777,20 @@ async function generateMfaPendingToken(uid, expiresInSeconds = 300) {
|
|
|
4732
4777
|
*
|
|
4733
4778
|
* Returns `null` for anything else — including a perfectly valid *access*
|
|
4734
4779
|
* token, which must not be interchangeable with this one in either direction.
|
|
4780
|
+
*
|
|
4781
|
+
* `iat` comes back with the uid because this token is a first factor that was
|
|
4782
|
+
* accepted at that instant, and a sign-out everywhere after it has to void it
|
|
4783
|
+
* the way it voids an access token — see `isAccessTokenRevoked`.
|
|
4735
4784
|
*/
|
|
4736
4785
|
async function verifyMfaPendingToken(token) {
|
|
4737
4786
|
if (!jwtConfig.secret) throw new Error("JWT secret not configured. Call configureJwt() first.");
|
|
4738
4787
|
try {
|
|
4739
4788
|
const decoded = await verifyJwt(token, jwtConfig.secret, { algorithms: ["HS256"] });
|
|
4740
4789
|
if (decoded.purpose !== "mfa-pending" || !decoded.uid) return null;
|
|
4741
|
-
return {
|
|
4790
|
+
return {
|
|
4791
|
+
uid: decoded.uid,
|
|
4792
|
+
iat: typeof decoded.iat === "number" ? decoded.iat : void 0
|
|
4793
|
+
};
|
|
4742
4794
|
} catch {
|
|
4743
4795
|
return null;
|
|
4744
4796
|
}
|
|
@@ -4916,4 +4968,4 @@ async function verifyMcpAccessToken(token, expectedAudience) {
|
|
|
4916
4968
|
//#endregion
|
|
4917
4969
|
export { require_jsonwebtoken as C, sha256Bytes as D, randomInt as E, sha256Hex as O, normalizePemFromEnv as S, randomHex as T, verifyAccessToken as _, generateMcpAccessToken as a, verifyMfaPendingToken as b, getAccessTokenExpiry as c, getRefreshTokenTtlMs as d, hasAsymmetricSigningKey as f, signPurposeToken as g, jwt_exports as h, generateDownloadToken as i, getJwks as l, isJwtConfigured as m, configureJwt as n, generateMfaPendingToken as o, hashRefreshToken as p, generateAccessToken as r, generateRefreshToken as s, MAX_COOKIE_AGE_MS as t, getRefreshTokenExpiry as u, verifyDownloadToken as v, constantTimeEqual as w, verifyPurposeToken as x, verifyMcpAccessToken as y };
|
|
4918
4970
|
|
|
4919
|
-
//# sourceMappingURL=jwt-
|
|
4971
|
+
//# sourceMappingURL=jwt-DnQHNFCl.js.map
|