ShareUpdateRequest share.update-request@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.1.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/share/update-request.v1.json

share.update-request@1: network-wide sharing. Ids only; no resource title or content. Members apply to people audience; pending recipients may preview for seven days. `lock` sets how the resource itself is sealed (Locker).

Fields

FieldTypeRequiredDescriptionConstraints
audienceenum
  • one of "public", "link", "people", "private"
membersshare.member-input
  • maxItems 100
notifyboolean
  • default true
lockenumHow the resource is sealed (Locker). Set when the item is registered; a save may echo the same value but cannot change it.
  • one of "none", "people", "password", "link"
envelopestringA locker.envelope@1, base64: the content re-sealed for the people who stay, sent with the members that remain when someone is removed from a people-locked item. The service stores it (never opens it) before it drops the member.
  • pattern ^[A-Za-z0-9+/]+={0,2}$
  • maxLength 11184812

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: example
{
  "audience": "people",
  "members": [
    {
      "subject": {
        "type": "user",
        "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
      },
      "role": "editor"
    }
  ],
  "notify": false
}
Valid: lock
{
  "lock": "password"
}
Valid: reseal
{
  "members": [
    {
      "subject": {
        "type": "user",
        "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
      },
      "role": "viewer",
      "key_slot": {
        "subject": {
          "type": "user",
          "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
        },
        "algorithm": "ECDH-P256/HKDF-SHA256/AES-256-GCM",
        "recipient_key": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
        "ephemeral_public_key": {
          "kty": "EC",
          "crv": "P-256",
          "x": "eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHg",
          "y": "eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXl5eXk"
        },
        "salt": "c3Nzc3Nzc3Nzc3Nzc3Nzcw==",
        "nonce": "bm5ubm5ubm5ubm5u",
        "wrapped_key": "d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3"
      }
    }
  ],
  "envelope": "T1ZMSwAAAAE="
}
Rejected: empty
{}
Rejected: lock
{
  "lock": "secret"
}
Rejected: unknown-field
{
  "audience": "people",
  "members": [
    {
      "subject": {
        "type": "user",
        "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
      },
      "role": "editor"
    }
  ],
  "title": "must never appear"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('share.update-request@1', value);   // { valid, errors: [{ path, message }] }