@sockethub/platform-feeds 4.0.0-beta.0 → 4.0.0-beta.1

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 CHANGED
@@ -160,8 +160,12 @@ exhaustion, using the shared guarded fetch dispatcher from `@sockethub/util`:
160
160
  * The connection is refused if the destination resolves to a loopback, private,
161
161
  link-local, carrier-grade NAT, or otherwise non-public address — validated at
162
162
  the connection layer, so it also covers every redirect hop (no
163
- check-then-fetch rebinding gap). IPv4-mapped, IPv4-compatible, and NAT64 IPv6
164
- spellings of those ranges are normalized and blocked as well.
163
+ check-then-fetch rebinding gap). IPv4-mapped, IPv4-compatible, and
164
+ well-known NAT64 (`64:ff9b::/96`) embeddings are judged as the embedded IPv4
165
+ address, so a public embedding is allowed. The local-use NAT64 prefix
166
+ `64:ff9b:1::/48` is refused entirely. The same address rules apply to
167
+ metadata, CalDAV, and CardDAV; see
168
+ [Outbound URL guard](../../docs/configuration.md#outbound-url-guard).
165
169
  * Response bodies are capped (a missing or lying `Content-Length` does not
166
170
  bypass the cap).
167
171
  * Non-2xx responses fail the job with a descriptive error.
package/dist/index.js CHANGED
@@ -41057,7 +41057,7 @@ var ActivityStreamSchema = {
41057
41057
  var package_default = {
41058
41058
  name: "@sockethub/schemas",
41059
41059
  description: "JSON schema files for validating Sockethub Activity Streams",
41060
- version: "3.0.0-beta.0",
41060
+ version: "3.0.0-beta.1",
41061
41061
  type: "module",
41062
41062
  private: false,
41063
41063
  author: "Nick Jennings <nick@silverbucket.net>",
@@ -41127,7 +41127,7 @@ var package_default = {
41127
41127
  "ajv-formats": "^2.1.1",
41128
41128
  "ajv-formats-draft2019": "^1.6.1"
41129
41129
  },
41130
- gitHead: "75002ae8f15d7679bd58a9327f5a1d7eeaffa237",
41130
+ gitHead: "06c9062f1cb5f0c0599fd979e6e91da79f08eda0",
41131
41131
  types: "./dist/index.d.ts"
41132
41132
  };
41133
41133
 
@@ -41289,7 +41289,8 @@ var SockethubConfigSchema = {
41289
41289
  type: "object",
41290
41290
  additionalProperties: false,
41291
41291
  properties: {
41292
- connectTimeoutMs: { type: "number" }
41292
+ connectTimeoutMs: { type: "number" },
41293
+ allowPrivateAddresses: { type: "boolean" }
41293
41294
  }
41294
41295
  },
41295
41296
  "@sockethub/platform-metadata": {
@@ -41379,11 +41380,23 @@ var SockethubConfigSchema = {
41379
41380
  type: "object",
41380
41381
  additionalProperties: false,
41381
41382
  properties: {
41383
+ maxInstancesPerSession: {
41384
+ type: "integer",
41385
+ minimum: 0,
41386
+ default: 10,
41387
+ description: "Maximum persistent instances per socket session. 0 disables the cap."
41388
+ },
41389
+ maxInstancesPerIp: {
41390
+ type: "integer",
41391
+ minimum: 0,
41392
+ default: 20,
41393
+ description: "Maximum persistent instances per client IP, including HTTP actions. 0 disables the cap."
41394
+ },
41382
41395
  maxPlatformInstances: {
41383
41396
  type: "number",
41384
41397
  minimum: 0,
41385
41398
  default: 100,
41386
- description: "Upper bound on concurrently running platform instances " + "(child processes). Each persistent-platform actor forks " + "its own process, so an unbounded count is a resource " + "exhaustion risk on public instances. 0 disables the cap."
41399
+ description: "Upper bound on concurrently running persistent platform instances " + "(child processes). Each persistent-platform actor forks " + "its own process, so an unbounded count is a resource " + "exhaustion risk on public instances. 0 disables the cap."
41387
41400
  }
41388
41401
  }
41389
41402
  },
@@ -41564,33 +41577,66 @@ var SockethubConfigSchema = {
41564
41577
  };
41565
41578
  var SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
41566
41579
 
41567
- // ../schemas/src/service-descriptor.ts
41568
- var import_ajv = __toESM(require_ajv(), 1);
41569
- var ajv = new import_ajv.default({ strictTypes: false, allErrors: true });
41580
+ // ../schemas/src/helpers/codegen.ts
41581
+ var available;
41582
+ var warned = false;
41583
+ function isCodegenAvailable() {
41584
+ if (available === undefined) {
41585
+ try {
41586
+ new Function("return true");
41587
+ available = true;
41588
+ } catch {
41589
+ available = false;
41590
+ }
41591
+ }
41592
+ return available;
41593
+ }
41594
+ function warnCodegenUnavailable() {
41595
+ if (warned) {
41596
+ return;
41597
+ }
41598
+ warned = true;
41599
+ console.warn("[@sockethub/schemas] Schema validation is disabled: this environment's Content Security Policy blocks `new Function`, which Ajv needs to compile schemas. The Sockethub server still validates every message.");
41600
+ }
41570
41601
 
41571
41602
  // ../schemas/src/validator.ts
41572
- var import_ajv2 = __toESM(require_ajv(), 1);
41603
+ var import_ajv = __toESM(require_ajv(), 1);
41573
41604
  var import_ajv_formats = __toESM(require_dist(), 1);
41574
41605
  var import_ajv_formats_draft2019 = __toESM(require_ajv_formats_draft2019(), 1);
41575
- var ajv2 = new import_ajv2.default({ strictTypes: false, allErrors: true });
41576
- import_ajv_formats.default(ajv2);
41577
- import_ajv_formats_draft2019.default(ajv2);
41578
41606
  var schemaURL = "https://sockethub.org/schemas/v0";
41579
41607
  var schemas = {};
41580
41608
  var systemContextsRegistered = false;
41581
41609
  schemas[`${schemaURL}/activity-stream`] = ActivityStreamSchema;
41582
- for (const uri in schemas) {
41583
- ajv2.addSchema(schemas[uri], uri);
41610
+ var ajv;
41611
+ function getAjv() {
41612
+ if (!isCodegenAvailable()) {
41613
+ warnCodegenUnavailable();
41614
+ return;
41615
+ }
41616
+ if (!ajv) {
41617
+ const instance = new import_ajv.default({ strictTypes: false, allErrors: true });
41618
+ import_ajv_formats.default(instance);
41619
+ import_ajv_formats_draft2019.default(instance);
41620
+ for (const uri in schemas) {
41621
+ instance.addSchema(schemas[uri], uri);
41622
+ }
41623
+ ajv = instance;
41624
+ }
41625
+ return ajv;
41584
41626
  }
41585
41627
  function registerSystemContext(platformId, contextUrl) {
41586
41628
  registerPlatformContext(platformId, contextUrl, `${schemaURL}/context/${platformId}/messages`, `${schemaURL}/context/${platformId}/credentials`);
41629
+ const instance = getAjv();
41630
+ if (!instance) {
41631
+ return;
41632
+ }
41587
41633
  const messageSchemaRef = `${schemaURL}/context/${platformId}/messages`;
41588
- if (!ajv2.getSchema(messageSchemaRef)) {
41589
- ajv2.addSchema({}, messageSchemaRef);
41634
+ if (!instance.getSchema(messageSchemaRef)) {
41635
+ instance.addSchema({}, messageSchemaRef);
41590
41636
  }
41591
41637
  const credentialsSchemaRef = `${schemaURL}/context/${platformId}/credentials`;
41592
- if (!ajv2.getSchema(credentialsSchemaRef)) {
41593
- ajv2.addSchema({}, credentialsSchemaRef);
41638
+ if (!instance.getSchema(credentialsSchemaRef)) {
41639
+ instance.addSchema({}, credentialsSchemaRef);
41594
41640
  }
41595
41641
  }
41596
41642
  function registerSystemPlatformContexts() {
@@ -42076,7 +42122,7 @@ var import_podparse = __toESM(require_podparse(), 1);
42076
42122
  var package_default2 = {
42077
42123
  name: "@sockethub/platform-feeds",
42078
42124
  description: "A sockethub platform module implementing RSS/Atom functionality",
42079
- version: "4.0.0-beta.0",
42125
+ version: "4.0.0-beta.1",
42080
42126
  type: "module",
42081
42127
  private: false,
42082
42128
  author: "Nick Jennings <nick@silverbucket.net>",
@@ -42121,24 +42167,24 @@ var package_default2 = {
42121
42167
  "clean:deps": "rm -rf node_modules"
42122
42168
  },
42123
42169
  dependencies: {
42124
- "@sockethub/util": "^1.0.0-beta.0",
42170
+ "@sockethub/util": "^1.0.0-beta.1",
42125
42171
  "html-tags": "^3.3.1",
42126
42172
  htmlparser2: "^9.1.0",
42127
42173
  podparse: "^1.6.0"
42128
42174
  },
42129
42175
  devDependencies: {
42130
- "@sockethub/schemas": "^3.0.0-beta.0",
42176
+ "@sockethub/schemas": "^3.0.0-beta.1",
42131
42177
  "@types/bun": "latest"
42132
42178
  },
42133
42179
  peerDependencies: {
42134
- "@sockethub/server": "5.0.0-beta.0"
42180
+ "@sockethub/server": "5.0.0-beta.1"
42135
42181
  },
42136
42182
  peerDependenciesMeta: {
42137
42183
  "@sockethub/server": {
42138
42184
  optional: true
42139
42185
  }
42140
42186
  },
42141
- gitHead: "75002ae8f15d7679bd58a9327f5a1d7eeaffa237",
42187
+ gitHead: "06c9062f1cb5f0c0599fd979e6e91da79f08eda0",
42142
42188
  types: "./dist/index.d.ts"
42143
42189
  };
42144
42190
 
@@ -42252,8 +42298,8 @@ var FEEDS_CONTEXT = buildCanonicalContext(schema_default.contextUrl);
42252
42298
  var basic = /\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i;
42253
42299
  var full = new RegExp(html_tags_default.map((tag) => `<${tag}\\b[^>]*>`).join("|"), "i");
42254
42300
  function isHtml(s) {
42255
- const limitedString = s.trim().slice(0, 1000);
42256
- return basic.test(limitedString) || full.test(s);
42301
+ const limitedString = s.slice(0, 1000).trim();
42302
+ return basic.test(limitedString) || full.test(limitedString);
42257
42303
  }
42258
42304
 
42259
42305
  class Feeds {
@@ -42403,4 +42449,4 @@ export {
42403
42449
  extractFetchParams
42404
42450
  };
42405
42451
 
42406
- //# debugId=B33C7094A94498B464756E2164756E21
42452
+ //# debugId=79A32653B1566A3364756E2164756E21