@sockethub/platform-carddav 1.0.0-beta.0 → 1.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
@@ -5,8 +5,12 @@ creating, updating, and deleting vCard contacts.
5
5
 
6
6
  The platform accepts public HTTPS services by default. Administrators may opt
7
7
  in to HTTP or private-network services with `allowInsecureHttp` and
8
- `allowPrivateAddresses`. Authentication supports Basic, Digest, or a
9
- caller-provided Bearer token through the standard Sockethub credentials flow.
8
+ `allowPrivateAddresses`. Address checks use the shared outbound URL guard,
9
+ including IPv6 embeddings of private ranges and the local-use NAT64 prefix
10
+ `64:ff9b:1::/48`. See
11
+ [Outbound URL guard](../../docs/configuration.md#outbound-url-guard).
12
+ Authentication supports Basic, Digest, or a caller-provided Bearer token
13
+ through the standard Sockethub credentials flow.
10
14
 
11
15
  ## Authentication
12
16
 
package/dist/index.js CHANGED
@@ -43199,7 +43199,7 @@ var ActivityStreamSchema = {
43199
43199
  var package_default = {
43200
43200
  name: "@sockethub/schemas",
43201
43201
  description: "JSON schema files for validating Sockethub Activity Streams",
43202
- version: "3.0.0-beta.0",
43202
+ version: "3.0.0-beta.1",
43203
43203
  type: "module",
43204
43204
  private: false,
43205
43205
  author: "Nick Jennings <nick@silverbucket.net>",
@@ -43269,7 +43269,7 @@ var package_default = {
43269
43269
  "ajv-formats": "^2.1.1",
43270
43270
  "ajv-formats-draft2019": "^1.6.1"
43271
43271
  },
43272
- gitHead: "75002ae8f15d7679bd58a9327f5a1d7eeaffa237",
43272
+ gitHead: "06c9062f1cb5f0c0599fd979e6e91da79f08eda0",
43273
43273
  types: "./dist/index.d.ts"
43274
43274
  };
43275
43275
 
@@ -43431,7 +43431,8 @@ var SockethubConfigSchema = {
43431
43431
  type: "object",
43432
43432
  additionalProperties: false,
43433
43433
  properties: {
43434
- connectTimeoutMs: { type: "number" }
43434
+ connectTimeoutMs: { type: "number" },
43435
+ allowPrivateAddresses: { type: "boolean" }
43435
43436
  }
43436
43437
  },
43437
43438
  "@sockethub/platform-metadata": {
@@ -43521,11 +43522,23 @@ var SockethubConfigSchema = {
43521
43522
  type: "object",
43522
43523
  additionalProperties: false,
43523
43524
  properties: {
43525
+ maxInstancesPerSession: {
43526
+ type: "integer",
43527
+ minimum: 0,
43528
+ default: 10,
43529
+ description: "Maximum persistent instances per socket session. 0 disables the cap."
43530
+ },
43531
+ maxInstancesPerIp: {
43532
+ type: "integer",
43533
+ minimum: 0,
43534
+ default: 20,
43535
+ description: "Maximum persistent instances per client IP, including HTTP actions. 0 disables the cap."
43536
+ },
43524
43537
  maxPlatformInstances: {
43525
43538
  type: "number",
43526
43539
  minimum: 0,
43527
43540
  default: 100,
43528
- 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."
43541
+ 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."
43529
43542
  }
43530
43543
  }
43531
43544
  },
@@ -43706,33 +43719,66 @@ var SockethubConfigSchema = {
43706
43719
  };
43707
43720
  var SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
43708
43721
 
43709
- // ../schemas/src/service-descriptor.ts
43710
- var import_ajv = __toESM(require_ajv(), 1);
43711
- var ajv = new import_ajv.default({ strictTypes: false, allErrors: true });
43722
+ // ../schemas/src/helpers/codegen.ts
43723
+ var available;
43724
+ var warned = false;
43725
+ function isCodegenAvailable() {
43726
+ if (available === undefined) {
43727
+ try {
43728
+ new Function("return true");
43729
+ available = true;
43730
+ } catch {
43731
+ available = false;
43732
+ }
43733
+ }
43734
+ return available;
43735
+ }
43736
+ function warnCodegenUnavailable() {
43737
+ if (warned) {
43738
+ return;
43739
+ }
43740
+ warned = true;
43741
+ 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.");
43742
+ }
43712
43743
 
43713
43744
  // ../schemas/src/validator.ts
43714
- var import_ajv2 = __toESM(require_ajv(), 1);
43745
+ var import_ajv = __toESM(require_ajv(), 1);
43715
43746
  var import_ajv_formats = __toESM(require_dist(), 1);
43716
43747
  var import_ajv_formats_draft2019 = __toESM(require_ajv_formats_draft2019(), 1);
43717
- var ajv2 = new import_ajv2.default({ strictTypes: false, allErrors: true });
43718
- import_ajv_formats.default(ajv2);
43719
- import_ajv_formats_draft2019.default(ajv2);
43720
43748
  var schemaURL = "https://sockethub.org/schemas/v0";
43721
43749
  var schemas = {};
43722
43750
  var systemContextsRegistered = false;
43723
43751
  schemas[`${schemaURL}/activity-stream`] = ActivityStreamSchema;
43724
- for (const uri in schemas) {
43725
- ajv2.addSchema(schemas[uri], uri);
43752
+ var ajv;
43753
+ function getAjv() {
43754
+ if (!isCodegenAvailable()) {
43755
+ warnCodegenUnavailable();
43756
+ return;
43757
+ }
43758
+ if (!ajv) {
43759
+ const instance = new import_ajv.default({ strictTypes: false, allErrors: true });
43760
+ import_ajv_formats.default(instance);
43761
+ import_ajv_formats_draft2019.default(instance);
43762
+ for (const uri in schemas) {
43763
+ instance.addSchema(schemas[uri], uri);
43764
+ }
43765
+ ajv = instance;
43766
+ }
43767
+ return ajv;
43726
43768
  }
43727
43769
  function registerSystemContext(platformId, contextUrl) {
43728
43770
  registerPlatformContext(platformId, contextUrl, `${schemaURL}/context/${platformId}/messages`, `${schemaURL}/context/${platformId}/credentials`);
43771
+ const instance = getAjv();
43772
+ if (!instance) {
43773
+ return;
43774
+ }
43729
43775
  const messageSchemaRef = `${schemaURL}/context/${platformId}/messages`;
43730
- if (!ajv2.getSchema(messageSchemaRef)) {
43731
- ajv2.addSchema({}, messageSchemaRef);
43776
+ if (!instance.getSchema(messageSchemaRef)) {
43777
+ instance.addSchema({}, messageSchemaRef);
43732
43778
  }
43733
43779
  const credentialsSchemaRef = `${schemaURL}/context/${platformId}/credentials`;
43734
- if (!ajv2.getSchema(credentialsSchemaRef)) {
43735
- ajv2.addSchema({}, credentialsSchemaRef);
43780
+ if (!instance.getSchema(credentialsSchemaRef)) {
43781
+ instance.addSchema({}, credentialsSchemaRef);
43736
43782
  }
43737
43783
  }
43738
43784
  function registerSystemPlatformContexts() {
@@ -44337,7 +44383,7 @@ class CardDavClient extends DavClient {
44337
44383
  var package_default2 = {
44338
44384
  name: "@sockethub/platform-carddav",
44339
44385
  description: "A Sockethub platform for CardDAV address books and contacts",
44340
- version: "1.0.0-beta.0",
44386
+ version: "1.0.0-beta.1",
44341
44387
  type: "module",
44342
44388
  private: false,
44343
44389
  license: "LGPL-3.0+",
@@ -44366,21 +44412,21 @@ var package_default2 = {
44366
44412
  test: "bun test src/"
44367
44413
  },
44368
44414
  dependencies: {
44369
- "@sockethub/dav": "^1.0.0-beta.0",
44370
- "@sockethub/schemas": "^3.0.0-beta.0"
44415
+ "@sockethub/dav": "^1.0.0-beta.1",
44416
+ "@sockethub/schemas": "^3.0.0-beta.1"
44371
44417
  },
44372
44418
  devDependencies: {
44373
44419
  "@types/bun": "latest"
44374
44420
  },
44375
44421
  peerDependencies: {
44376
- "@sockethub/server": "^5.0.0-beta.0"
44422
+ "@sockethub/server": "^5.0.0-beta.1"
44377
44423
  },
44378
44424
  peerDependenciesMeta: {
44379
44425
  "@sockethub/server": {
44380
44426
  optional: true
44381
44427
  }
44382
44428
  },
44383
- gitHead: "75002ae8f15d7679bd58a9327f5a1d7eeaffa237"
44429
+ gitHead: "06c9062f1cb5f0c0599fd979e6e91da79f08eda0"
44384
44430
  };
44385
44431
 
44386
44432
  // src/schema.ts
@@ -44789,4 +44835,4 @@ export {
44789
44835
  parseVCard
44790
44836
  };
44791
44837
 
44792
- //# debugId=9B429FF2EF86262D64756E2164756E21
44838
+ //# debugId=994C753F4E4E8EBA64756E2164756E21