@dnsid-ai/sdk 0.20.2 → 0.22.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/node.cjs CHANGED
@@ -318,6 +318,7 @@ var dnsidEnvironmentVariables = {
318
318
  kuUrl: "DNSID_KU_URL",
319
319
  dnsServer: "DNSID_DNS_SERVER",
320
320
  caBundlePath: "DNSID_CA_BUNDLE",
321
+ privateAddressHosts: "DNSID_PRIVATE_HOSTS",
321
322
  dnssecMode: "DNSID_DNSSEC_MODE",
322
323
  publicUrl: "DNSID_PUBLIC_URL",
323
324
  keyStorePath: "DNSID_KEY_STORE",
@@ -335,6 +336,7 @@ var environmentSchema = {
335
336
  kuUrl: stringField(dnsidEnvironmentVariables.kuUrl),
336
337
  dnsServer: stringField(dnsidEnvironmentVariables.dnsServer),
337
338
  caBundlePath: stringField(dnsidEnvironmentVariables.caBundlePath),
339
+ privateAddressHosts: listField(dnsidEnvironmentVariables.privateAddressHosts),
338
340
  dnssecMode: dnssecModeField(dnsidEnvironmentVariables.dnssecMode),
339
341
  publicUrl: stringField(dnsidEnvironmentVariables.publicUrl),
340
342
  keyStorePath: stringField(dnsidEnvironmentVariables.keyStorePath),
@@ -359,7 +361,7 @@ function configFromEnvironment(envOrOptions = process.env, options = {}) {
359
361
  kuUrl: parsed.kuUrl
360
362
  }),
361
363
  verification: defined({ dnssecMode: parsed.dnssecMode }),
362
- transport: defined({ dnsServer: parsed.dnsServer, caBundlePath: parsed.caBundlePath })
364
+ transport: defined({ dnsServer: parsed.dnsServer, caBundlePath: parsed.caBundlePath, privateAddressHosts: parsed.privateAddressHosts })
363
365
  };
364
366
  return {
365
367
  config,
@@ -406,6 +408,15 @@ function requireFields(parsed, fields) {
406
408
  function stringField(variable) {
407
409
  return { variable, parse: (value) => value };
408
410
  }
411
+ function listField(variable) {
412
+ return {
413
+ variable,
414
+ parse(value) {
415
+ const items = value.split(",").map((item) => item.trim()).filter(Boolean);
416
+ return items.length > 0 ? items : void 0;
417
+ }
418
+ };
419
+ }
409
420
  function positiveIntField(variable) {
410
421
  return {
411
422
  variable,
@@ -436,18 +447,18 @@ function protocolStatusUrl(registryUrl, domain) {
436
447
  // src/node.ts
437
448
  async function createNodeIdentityManager(config, deps = {}) {
438
449
  const { transport, ...core } = (0, import_protocol3.validateDnsidConfig)(config);
439
- const { dnsServer, caBundlePath, allowedUnsafeHosts } = transport;
450
+ const { dnsServer, caBundlePath, privateAddressHosts } = transport;
440
451
  if (dnsServer !== void 0 && deps.dnsResolver && deps.fetchJson) {
441
452
  throw new import_protocol3.ArgumentError("config.transport.dnsServer has no SDK-managed consumer when both dnsResolver and fetchJson are injected");
442
453
  }
443
454
  if (caBundlePath !== void 0 && deps.fetchJson) {
444
455
  throw new import_protocol3.ArgumentError("config.transport.caBundlePath has no SDK-managed consumer when fetchJson is injected");
445
456
  }
446
- if (allowedUnsafeHosts !== void 0 && deps.fetchJson) {
447
- throw new import_protocol3.ArgumentError("config.transport.allowedUnsafeHosts has no SDK-managed consumer when fetchJson is injected");
457
+ if (privateAddressHosts !== void 0 && deps.fetchJson) {
458
+ throw new import_protocol3.ArgumentError("config.transport.privateAddressHosts has no SDK-managed consumer when fetchJson is injected");
448
459
  }
449
460
  const transportModule = deps.fetchJson && deps.dnsResolver ? null : await loadNodeTransport();
450
- const fetchJson = deps.fetchJson ?? ((url, fetchOptions) => transportModule.fetchJson(url, { ...fetchOptions, dnsServer, caBundlePath, allowedUnsafeHosts }));
461
+ const fetchJson = deps.fetchJson ?? ((url, fetchOptions) => transportModule.fetchJson(url, { ...fetchOptions, dnsServer, caBundlePath, privateAddressHosts }));
451
462
  const dnsResolver = deps.dnsResolver ?? transportModule.createDefaultDnsResolver({ dnsServer });
452
463
  return new import_protocol3.IdentityManager(core, { ...deps, dnsResolver, fetchJson });
453
464
  }
package/dist/node.d.cts CHANGED
@@ -61,6 +61,7 @@ declare const dnsidEnvironmentVariables: {
61
61
  readonly kuUrl: "DNSID_KU_URL";
62
62
  readonly dnsServer: "DNSID_DNS_SERVER";
63
63
  readonly caBundlePath: "DNSID_CA_BUNDLE";
64
+ readonly privateAddressHosts: "DNSID_PRIVATE_HOSTS";
64
65
  readonly dnssecMode: "DNSID_DNSSEC_MODE";
65
66
  readonly publicUrl: "DNSID_PUBLIC_URL";
66
67
  readonly keyStorePath: "DNSID_KEY_STORE";
@@ -85,6 +86,7 @@ declare const environmentSchema: {
85
86
  kuUrl: EnvironmentField<string>;
86
87
  dnsServer: EnvironmentField<string>;
87
88
  caBundlePath: EnvironmentField<string>;
89
+ privateAddressHosts: EnvironmentField<string[] | undefined>;
88
90
  dnssecMode: EnvironmentField<DNSSECMode>;
89
91
  publicUrl: EnvironmentField<string>;
90
92
  keyStorePath: EnvironmentField<string>;
@@ -155,7 +157,7 @@ interface CreateNodeIdentityManagerFromDnsidOptions {
155
157
  *
156
158
  * `config.transport` configures only the SDK-managed defaults: `dnsServer` applies to whichever of
157
159
  * `dnsResolver`/`fetchJson` is not injected and is rejected when both are; `caBundlePath` and
158
- * `allowedUnsafeHosts` apply to the default fetcher and are rejected when `fetchJson` is injected. Injected dependencies are never
160
+ * `privateAddressHosts` apply to the default fetcher and are rejected when `fetchJson` is injected. Injected dependencies are never
159
161
  * inspected or modified. `@dnsid-ai/transport` is an optional peer; install it or inject both
160
162
  * dependencies. The system resolver reports `UNKNOWN`; `validated`/`required` DNSSEC modes need a
161
163
  * DNSSEC-aware resolver.
package/dist/node.d.ts CHANGED
@@ -61,6 +61,7 @@ declare const dnsidEnvironmentVariables: {
61
61
  readonly kuUrl: "DNSID_KU_URL";
62
62
  readonly dnsServer: "DNSID_DNS_SERVER";
63
63
  readonly caBundlePath: "DNSID_CA_BUNDLE";
64
+ readonly privateAddressHosts: "DNSID_PRIVATE_HOSTS";
64
65
  readonly dnssecMode: "DNSID_DNSSEC_MODE";
65
66
  readonly publicUrl: "DNSID_PUBLIC_URL";
66
67
  readonly keyStorePath: "DNSID_KEY_STORE";
@@ -85,6 +86,7 @@ declare const environmentSchema: {
85
86
  kuUrl: EnvironmentField<string>;
86
87
  dnsServer: EnvironmentField<string>;
87
88
  caBundlePath: EnvironmentField<string>;
89
+ privateAddressHosts: EnvironmentField<string[] | undefined>;
88
90
  dnssecMode: EnvironmentField<DNSSECMode>;
89
91
  publicUrl: EnvironmentField<string>;
90
92
  keyStorePath: EnvironmentField<string>;
@@ -155,7 +157,7 @@ interface CreateNodeIdentityManagerFromDnsidOptions {
155
157
  *
156
158
  * `config.transport` configures only the SDK-managed defaults: `dnsServer` applies to whichever of
157
159
  * `dnsResolver`/`fetchJson` is not injected and is rejected when both are; `caBundlePath` and
158
- * `allowedUnsafeHosts` apply to the default fetcher and are rejected when `fetchJson` is injected. Injected dependencies are never
160
+ * `privateAddressHosts` apply to the default fetcher and are rejected when `fetchJson` is injected. Injected dependencies are never
159
161
  * inspected or modified. `@dnsid-ai/transport` is an optional peer; install it or inject both
160
162
  * dependencies. The system resolver reports `UNKNOWN`; `validated`/`required` DNSSEC modes need a
161
163
  * DNSSEC-aware resolver.
package/dist/node.js CHANGED
@@ -277,6 +277,7 @@ var dnsidEnvironmentVariables = {
277
277
  kuUrl: "DNSID_KU_URL",
278
278
  dnsServer: "DNSID_DNS_SERVER",
279
279
  caBundlePath: "DNSID_CA_BUNDLE",
280
+ privateAddressHosts: "DNSID_PRIVATE_HOSTS",
280
281
  dnssecMode: "DNSID_DNSSEC_MODE",
281
282
  publicUrl: "DNSID_PUBLIC_URL",
282
283
  keyStorePath: "DNSID_KEY_STORE",
@@ -294,6 +295,7 @@ var environmentSchema = {
294
295
  kuUrl: stringField(dnsidEnvironmentVariables.kuUrl),
295
296
  dnsServer: stringField(dnsidEnvironmentVariables.dnsServer),
296
297
  caBundlePath: stringField(dnsidEnvironmentVariables.caBundlePath),
298
+ privateAddressHosts: listField(dnsidEnvironmentVariables.privateAddressHosts),
297
299
  dnssecMode: dnssecModeField(dnsidEnvironmentVariables.dnssecMode),
298
300
  publicUrl: stringField(dnsidEnvironmentVariables.publicUrl),
299
301
  keyStorePath: stringField(dnsidEnvironmentVariables.keyStorePath),
@@ -318,7 +320,7 @@ function configFromEnvironment(envOrOptions = process.env, options = {}) {
318
320
  kuUrl: parsed.kuUrl
319
321
  }),
320
322
  verification: defined({ dnssecMode: parsed.dnssecMode }),
321
- transport: defined({ dnsServer: parsed.dnsServer, caBundlePath: parsed.caBundlePath })
323
+ transport: defined({ dnsServer: parsed.dnsServer, caBundlePath: parsed.caBundlePath, privateAddressHosts: parsed.privateAddressHosts })
322
324
  };
323
325
  return {
324
326
  config,
@@ -365,6 +367,15 @@ function requireFields(parsed, fields) {
365
367
  function stringField(variable) {
366
368
  return { variable, parse: (value) => value };
367
369
  }
370
+ function listField(variable) {
371
+ return {
372
+ variable,
373
+ parse(value) {
374
+ const items = value.split(",").map((item) => item.trim()).filter(Boolean);
375
+ return items.length > 0 ? items : void 0;
376
+ }
377
+ };
378
+ }
368
379
  function positiveIntField(variable) {
369
380
  return {
370
381
  variable,
@@ -395,18 +406,18 @@ function protocolStatusUrl(registryUrl, domain) {
395
406
  // src/node.ts
396
407
  async function createNodeIdentityManager(config, deps = {}) {
397
408
  const { transport, ...core } = validateDnsidConfig(config);
398
- const { dnsServer, caBundlePath, allowedUnsafeHosts } = transport;
409
+ const { dnsServer, caBundlePath, privateAddressHosts } = transport;
399
410
  if (dnsServer !== void 0 && deps.dnsResolver && deps.fetchJson) {
400
411
  throw new ArgumentError2("config.transport.dnsServer has no SDK-managed consumer when both dnsResolver and fetchJson are injected");
401
412
  }
402
413
  if (caBundlePath !== void 0 && deps.fetchJson) {
403
414
  throw new ArgumentError2("config.transport.caBundlePath has no SDK-managed consumer when fetchJson is injected");
404
415
  }
405
- if (allowedUnsafeHosts !== void 0 && deps.fetchJson) {
406
- throw new ArgumentError2("config.transport.allowedUnsafeHosts has no SDK-managed consumer when fetchJson is injected");
416
+ if (privateAddressHosts !== void 0 && deps.fetchJson) {
417
+ throw new ArgumentError2("config.transport.privateAddressHosts has no SDK-managed consumer when fetchJson is injected");
407
418
  }
408
419
  const transportModule = deps.fetchJson && deps.dnsResolver ? null : await loadNodeTransport();
409
- const fetchJson = deps.fetchJson ?? ((url, fetchOptions) => transportModule.fetchJson(url, { ...fetchOptions, dnsServer, caBundlePath, allowedUnsafeHosts }));
420
+ const fetchJson = deps.fetchJson ?? ((url, fetchOptions) => transportModule.fetchJson(url, { ...fetchOptions, dnsServer, caBundlePath, privateAddressHosts }));
410
421
  const dnsResolver = deps.dnsResolver ?? transportModule.createDefaultDnsResolver({ dnsServer });
411
422
  return new IdentityManager(core, { ...deps, dnsResolver, fetchJson });
412
423
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnsid-ai/sdk",
3
- "version": "0.20.2",
3
+ "version": "0.22.0",
4
4
  "description": "Runtime-neutral DNSid SDK entrypoint with optional Node.js convenience helpers.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -39,15 +39,15 @@
39
39
  "typecheck": "tsc --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@dnsid-ai/protocol": "^0.20.2",
43
- "@dnsid-ai/http-signatures": "^0.20.2",
44
- "@dnsid-ai/jose": "^0.20.2",
45
- "@dnsid-ai/log-c2sp-tlog": "^0.20.2",
46
- "@dnsid-ai/registry": "^0.20.2",
47
- "@dnsid-ai/web-bot-auth": "^0.20.2"
42
+ "@dnsid-ai/protocol": "^0.22.0",
43
+ "@dnsid-ai/http-signatures": "^0.22.0",
44
+ "@dnsid-ai/jose": "^0.22.0",
45
+ "@dnsid-ai/log-c2sp-tlog": "^0.22.0",
46
+ "@dnsid-ai/registry": "^0.22.0",
47
+ "@dnsid-ai/web-bot-auth": "^0.22.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@dnsid-ai/transport": "^0.20.2"
50
+ "@dnsid-ai/transport": "^0.22.0"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "@dnsid-ai/transport": {