@crvouga/mockingbird-service-okta 0.5.0 → 0.7.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/CHANGELOG.md +13 -1
- package/dist/{chunk-WTDFDYUS.js → chunk-GKVEZUXA.js} +115 -15
- package/dist/chunk-GKVEZUXA.js.map +7 -0
- package/dist/{chunk-EAE2QDE5.js → chunk-ZD4UVIAV.js} +109 -26
- package/dist/chunk-ZD4UVIAV.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +35 -0
- package/dist/index.js +1 -1
- package/dist/server.d.ts +78 -0
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-EAE2QDE5.js.map +0 -7
- package/dist/chunk-WTDFDYUS.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-okta
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.7.0 (2026-10-21)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- raise the serve and fleet body limit to the S3 maximum ([86b9e2b](https://github.com/crvouga/mockingbird/commit/86b9e2b80bcaaaef57f52edbac50b27da0b42f33))
|
|
8
|
+
|
|
9
|
+
## 0.6.0 (2026-10-18)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- resolve the agent-reported issue queue in one batch ([25c52b6](https://github.com/crvouga/mockingbird/commit/25c52b668a53ddb80b968419601a20abf33f956b))
|
|
14
|
+
|
|
15
|
+
## 0.5.0 (2026-10-16)
|
|
4
16
|
|
|
5
17
|
### Features
|
|
6
18
|
|
|
@@ -3,17 +3,31 @@ import {
|
|
|
3
3
|
createRuntime,
|
|
4
4
|
normalizeBootControls,
|
|
5
5
|
normalizeControls,
|
|
6
|
+
normalizeIdBase,
|
|
6
7
|
ownedTransport,
|
|
7
8
|
parseDuration,
|
|
8
9
|
parseFaultHeader,
|
|
9
10
|
resolveAdminPrefix,
|
|
10
11
|
restoreClock
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZD4UVIAV.js";
|
|
12
13
|
|
|
13
14
|
// ../../adapters/node/dist/cli.js
|
|
14
15
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
15
16
|
import { parseArgs } from "node:util";
|
|
16
17
|
|
|
18
|
+
// ../../adapters/node/dist/boot-settings.js
|
|
19
|
+
var checkSettings = (target, settings, label) => {
|
|
20
|
+
if (!target.parseSettings)
|
|
21
|
+
throw new Error(`${label}: ${target.name} takes no boot settings`);
|
|
22
|
+
try {
|
|
23
|
+
return target.parseSettings(settings);
|
|
24
|
+
} catch (error) {
|
|
25
|
+
throw new Error(`${label}: ${error instanceof Error ? error.message : String(error)}`, {
|
|
26
|
+
cause: error
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
17
31
|
// ../../adapters/node/dist/fleet.js
|
|
18
32
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
19
33
|
import { createHash as createHash4, randomUUID as randomUUID4 } from "node:crypto";
|
|
@@ -2663,6 +2677,9 @@ var fleet_config_schema_default = {
|
|
|
2663
2677
|
adminControls: {
|
|
2664
2678
|
$ref: "#/$defs/controls"
|
|
2665
2679
|
},
|
|
2680
|
+
idBase: {
|
|
2681
|
+
$ref: "#/$defs/idBase"
|
|
2682
|
+
},
|
|
2666
2683
|
namespace: {
|
|
2667
2684
|
type: "string",
|
|
2668
2685
|
pattern: "^[A-Za-z0-9_.-]{1,64}$"
|
|
@@ -2752,6 +2769,12 @@ var fleet_config_schema_default = {
|
|
|
2752
2769
|
adminControls: {
|
|
2753
2770
|
$ref: "#/$defs/controls"
|
|
2754
2771
|
},
|
|
2772
|
+
idBase: {
|
|
2773
|
+
$ref: "#/$defs/idBase"
|
|
2774
|
+
},
|
|
2775
|
+
settings: {
|
|
2776
|
+
type: "object"
|
|
2777
|
+
},
|
|
2755
2778
|
fixtures: {
|
|
2756
2779
|
type: "object"
|
|
2757
2780
|
},
|
|
@@ -2798,6 +2821,18 @@ var fleet_config_schema_default = {
|
|
|
2798
2821
|
}
|
|
2799
2822
|
}
|
|
2800
2823
|
},
|
|
2824
|
+
idBase: {
|
|
2825
|
+
anyOf: [
|
|
2826
|
+
{
|
|
2827
|
+
type: "integer",
|
|
2828
|
+
minimum: 0
|
|
2829
|
+
},
|
|
2830
|
+
{
|
|
2831
|
+
type: "string",
|
|
2832
|
+
pattern: "^(boot|[0-9]+)$"
|
|
2833
|
+
}
|
|
2834
|
+
]
|
|
2835
|
+
},
|
|
2801
2836
|
controls: {
|
|
2802
2837
|
type: "object",
|
|
2803
2838
|
additionalProperties: false,
|
|
@@ -2947,6 +2982,8 @@ async function preflightFleet(config, options) {
|
|
|
2947
2982
|
throw new Error("protected archive policy requires a protected repository; configure its protector before startup");
|
|
2948
2983
|
resolveAdminPrefix(config.adminPrefix);
|
|
2949
2984
|
normalizeBootControls(config.adminControls);
|
|
2985
|
+
if (config.idBase !== void 0)
|
|
2986
|
+
normalizeIdBase(config.idBase, "idBase");
|
|
2950
2987
|
const targets = /* @__PURE__ */ new Map();
|
|
2951
2988
|
const ports = /* @__PURE__ */ new Set();
|
|
2952
2989
|
for (const [name, entry] of Object.entries(config.services)) {
|
|
@@ -2978,6 +3015,13 @@ async function preflightFleet(config, options) {
|
|
|
2978
3015
|
throw new Error("invalid protocol namespace selector");
|
|
2979
3016
|
}
|
|
2980
3017
|
}
|
|
3018
|
+
if (entry.idBase !== void 0)
|
|
3019
|
+
normalizeIdBase(entry.idBase, "idBase");
|
|
3020
|
+
if (entry.settings !== void 0) {
|
|
3021
|
+
if (protocol !== "http" || !("create" in target))
|
|
3022
|
+
throw new Error("settings: only HTTP services take boot settings");
|
|
3023
|
+
checkSettings(target, entry.settings, "settings");
|
|
3024
|
+
}
|
|
2981
3025
|
const port = entry.port ?? target.defaultPort;
|
|
2982
3026
|
if (port !== 0) {
|
|
2983
3027
|
const key = `${entry.host ?? "127.0.0.1"}:${port}`;
|
|
@@ -3013,7 +3057,7 @@ async function preflightFleet(config, options) {
|
|
|
3013
3057
|
break;
|
|
3014
3058
|
}
|
|
3015
3059
|
}
|
|
3016
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "0.
|
|
3060
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "0.7.0" });
|
|
3017
3061
|
} catch (error) {
|
|
3018
3062
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3019
3063
|
}
|
|
@@ -3239,7 +3283,11 @@ var serve = async (api, options = {}) => {
|
|
|
3239
3283
|
// ../../adapters/node/dist/listen.js
|
|
3240
3284
|
var listen = async (api, options = {}) => {
|
|
3241
3285
|
const host = options.host ?? "127.0.0.1";
|
|
3242
|
-
const server = await serve(api, {
|
|
3286
|
+
const server = await serve(api, {
|
|
3287
|
+
port: options.port ?? 0,
|
|
3288
|
+
host,
|
|
3289
|
+
...options.maxBodyBytes !== void 0 ? { maxBodyBytes: options.maxBodyBytes } : {}
|
|
3290
|
+
});
|
|
3243
3291
|
const address = server.address();
|
|
3244
3292
|
const port = typeof address === "object" && address !== null ? address.port : options.port ?? 0;
|
|
3245
3293
|
const shown = host.includes(":") ? `[${host}]` : host;
|
|
@@ -3333,6 +3381,7 @@ var httpChild = async (target, entry, options, admission, generation, privateAcc
|
|
|
3333
3381
|
options.onLog?.(entry2);
|
|
3334
3382
|
},
|
|
3335
3383
|
...entry.adminControls !== void 0 ? { adminControls: entry.adminControls } : {},
|
|
3384
|
+
...entry.settings !== void 0 ? { settings: checkSettings(target, entry.settings, "settings") } : {},
|
|
3336
3385
|
...entry.fixtures !== void 0 ? { fixtures: entry.fixtures } : {},
|
|
3337
3386
|
...(advertisedHttpBase(entry) ?? entry.baseUrl) !== void 0 ? { baseUrl: advertisedHttpBase(entry) ?? entry.baseUrl } : {}
|
|
3338
3387
|
});
|
|
@@ -3351,6 +3400,8 @@ var httpChild = async (target, entry, options, admission, generation, privateAcc
|
|
|
3351
3400
|
].some((method) => typeof created[method] !== "function"))
|
|
3352
3401
|
throw new Error("HTTP target does not implement the fleet runtime protocol; build/install matching supported service versions");
|
|
3353
3402
|
const runtime = created;
|
|
3403
|
+
if (entry.idBase !== void 0)
|
|
3404
|
+
runtime.setIdBase?.(entry.idBase);
|
|
3354
3405
|
const unobserve = runtime.webhooks?.observeDeliveries(observer.delivery);
|
|
3355
3406
|
if (options.outbound && runtime.webhooks)
|
|
3356
3407
|
runtime.webhooks.setTransportPolicy(ownedTransport(options.outbound));
|
|
@@ -3435,7 +3486,8 @@ var httpChild = async (target, entry, options, admission, generation, privateAcc
|
|
|
3435
3486
|
try {
|
|
3436
3487
|
server = await listen(api, {
|
|
3437
3488
|
port: entry.port ?? target.defaultPort,
|
|
3438
|
-
host: entry.host ?? "127.0.0.1"
|
|
3489
|
+
host: entry.host ?? "127.0.0.1",
|
|
3490
|
+
...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
|
|
3439
3491
|
});
|
|
3440
3492
|
target.listening?.(server);
|
|
3441
3493
|
} catch (error) {
|
|
@@ -3949,6 +4001,7 @@ async function startFleet(config, options) {
|
|
|
3949
4001
|
...entry,
|
|
3950
4002
|
adminPrefix: resolveAdminPrefix(entry.adminPrefix ?? adminPrefix),
|
|
3951
4003
|
...adminKey !== void 0 ? { adminKey } : {},
|
|
4004
|
+
...(entry.idBase ?? config.idBase) !== void 0 ? { idBase: entry.idBase ?? config.idBase } : {},
|
|
3952
4005
|
// Fleet-wide controls, with the service's own keys replacing them.
|
|
3953
4006
|
...config.adminControls !== void 0 || entry.adminControls !== void 0 ? { adminControls: { ...config.adminControls, ...entry.adminControls } } : {}
|
|
3954
4007
|
}, options, (namespace, request) => management?.admit(namespace, request), (namespace) => management?.generation(namespace), (namespace, request) => management?.privateRequest(namespace, request) ?? false, {
|
|
@@ -4633,6 +4686,16 @@ var COMMON_SERVE_OPTIONS = {
|
|
|
4633
4686
|
value: "<seed>",
|
|
4634
4687
|
description: "Seed for every random choice (env MOCKINGBIRD_SEED)"
|
|
4635
4688
|
},
|
|
4689
|
+
"id-base": {
|
|
4690
|
+
type: "string",
|
|
4691
|
+
value: "<n|boot>",
|
|
4692
|
+
description: "Start generated ids at this base so a restart does not reissue the last boot's ids; boot derives one from the clock (env MOCKINGBIRD_ID_BASE; default 0, the same ids every boot)"
|
|
4693
|
+
},
|
|
4694
|
+
settings: {
|
|
4695
|
+
type: "string",
|
|
4696
|
+
value: "<json|file>",
|
|
4697
|
+
description: "Service settings to boot with, as JSON or a JSON file; every namespace starts from them (env MOCKINGBIRD_SETTINGS; only for services that declare settings)"
|
|
4698
|
+
},
|
|
4636
4699
|
"admin-controls": {
|
|
4637
4700
|
type: "string",
|
|
4638
4701
|
value: "<json|file>",
|
|
@@ -4727,19 +4790,40 @@ var readJsonFile = async (path, label) => {
|
|
|
4727
4790
|
}
|
|
4728
4791
|
};
|
|
4729
4792
|
var isObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4793
|
+
var readJsonOption = async (source, label) => {
|
|
4794
|
+
const trimmed = source.trim();
|
|
4795
|
+
if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
4796
|
+
try {
|
|
4797
|
+
return JSON.parse(trimmed);
|
|
4798
|
+
} catch {
|
|
4799
|
+
throw new Error(`${label}: not valid JSON`);
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
return readJsonFile(source, label);
|
|
4803
|
+
};
|
|
4804
|
+
var resolveServeIdBase = (values, env = process.env) => {
|
|
4805
|
+
const source = asString(values["id-base"]) ?? env.MOCKINGBIRD_ID_BASE;
|
|
4806
|
+
if (source === void 0 || source.trim() === "")
|
|
4807
|
+
return void 0;
|
|
4808
|
+
normalizeIdBase(source.trim(), "--id-base");
|
|
4809
|
+
return source.trim();
|
|
4810
|
+
};
|
|
4811
|
+
var resolveServeSettings = async (target, values, env = process.env) => {
|
|
4812
|
+
const flag = asString(values.settings);
|
|
4813
|
+
const source = flag ?? env.MOCKINGBIRD_SETTINGS;
|
|
4814
|
+
if (source === void 0 || source.trim() === "")
|
|
4815
|
+
return void 0;
|
|
4816
|
+
const label = flag !== void 0 ? "--settings" : "MOCKINGBIRD_SETTINGS";
|
|
4817
|
+
const parsed = await readJsonOption(source, label);
|
|
4818
|
+
if (!isObject2(parsed))
|
|
4819
|
+
throw new Error(`${label}: expected a JSON object`);
|
|
4820
|
+
return checkSettings(target, parsed, label);
|
|
4821
|
+
};
|
|
4730
4822
|
var resolveServeControls = async (values, env = process.env, base) => {
|
|
4731
4823
|
const source = asString(values["admin-controls"]) ?? env.MOCKINGBIRD_ADMIN_CONTROLS;
|
|
4732
4824
|
let document = isObject2(base) ? { ...base } : {};
|
|
4733
4825
|
if (source !== void 0 && source.trim() !== "") {
|
|
4734
|
-
|
|
4735
|
-
if (source.trim().startsWith("{")) {
|
|
4736
|
-
try {
|
|
4737
|
-
parsed = JSON.parse(source);
|
|
4738
|
-
} catch {
|
|
4739
|
-
throw new Error("--admin-controls: not valid JSON");
|
|
4740
|
-
}
|
|
4741
|
-
} else
|
|
4742
|
-
parsed = await readJsonFile(source, "--admin-controls");
|
|
4826
|
+
const parsed = source.trim().startsWith("{") ? await readJsonOption(source, "--admin-controls") : await readJsonFile(source, "--admin-controls");
|
|
4743
4827
|
if (!isObject2(parsed))
|
|
4744
4828
|
throw new Error("--admin-controls: expected a JSON object");
|
|
4745
4829
|
document = { ...document, ...parsed };
|
|
@@ -4789,9 +4873,16 @@ var start = async (target, values, config) => {
|
|
|
4789
4873
|
adminKey: config.adminKey,
|
|
4790
4874
|
seed: config.seed,
|
|
4791
4875
|
onLog: formatLog(config.log),
|
|
4876
|
+
...config.settings !== void 0 ? { settings: config.settings } : {},
|
|
4792
4877
|
...config.adminControls !== void 0 ? { adminControls: config.adminControls } : {}
|
|
4793
4878
|
});
|
|
4794
|
-
|
|
4879
|
+
if (config.idBase !== void 0)
|
|
4880
|
+
runtime.setIdBase?.(config.idBase);
|
|
4881
|
+
const listening = await listen(runtime, {
|
|
4882
|
+
port: config.port,
|
|
4883
|
+
host: config.host,
|
|
4884
|
+
...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
|
|
4885
|
+
});
|
|
4795
4886
|
target.listening?.(listening);
|
|
4796
4887
|
console.log(`${target.name} emulator listening on ${listening.url}`);
|
|
4797
4888
|
console.log(`${target.name} health: GET ${listening.url}${adminPrefix}/health`);
|
|
@@ -4836,6 +4927,11 @@ var serveCommand = (target) => ({
|
|
|
4836
4927
|
const adminControls = await resolveServeControls(values, process.env, config.adminControls);
|
|
4837
4928
|
if (adminControls !== void 0)
|
|
4838
4929
|
config.adminControls = adminControls;
|
|
4930
|
+
if (values.settings !== void 0)
|
|
4931
|
+
throw new Error("--settings serves a single service; give each service its own `settings` in the config");
|
|
4932
|
+
const idBase = config.idBase ?? resolveServeIdBase(values);
|
|
4933
|
+
if (idBase !== void 0)
|
|
4934
|
+
config.idBase = idBase;
|
|
4839
4935
|
const fleet = await startFleet(config, {
|
|
4840
4936
|
load: (name) => loadTarget(name, target),
|
|
4841
4937
|
onLog: formatLog(config.log ?? log),
|
|
@@ -4865,8 +4961,12 @@ var serveCommand = (target) => ({
|
|
|
4865
4961
|
let listening;
|
|
4866
4962
|
try {
|
|
4867
4963
|
const adminControls = await resolveServeControls(values);
|
|
4964
|
+
const idBase = resolveServeIdBase(values);
|
|
4965
|
+
const settings = await resolveServeSettings(target, values);
|
|
4868
4966
|
listening = await start(target, values, {
|
|
4869
4967
|
...adminControls !== void 0 ? { adminControls } : {},
|
|
4968
|
+
...idBase !== void 0 ? { idBase } : {},
|
|
4969
|
+
...settings !== void 0 ? { settings } : {},
|
|
4870
4970
|
adminPrefix: resolveAdminPrefix(asString(values["admin-prefix"]) ?? process.env.MOCKINGBIRD_ADMIN_PREFIX),
|
|
4871
4971
|
port: port === void 0 ? target.defaultPort : Number.parseInt(port, 10),
|
|
4872
4972
|
host: asString(values.host) ?? "127.0.0.1",
|
|
@@ -4962,4 +5062,4 @@ export {
|
|
|
4962
5062
|
createServer2 as createServer,
|
|
4963
5063
|
serveTarget
|
|
4964
5064
|
};
|
|
4965
|
-
//# sourceMappingURL=chunk-
|
|
5065
|
+
//# sourceMappingURL=chunk-GKVEZUXA.js.map
|