ShareGrantedPayload share.granted@1

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

Version
1.0.0
Owner
network
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/share.granted.v1.json

share.granted@1: ids and access metadata only, for every audience. Produced by adopting services; Network owns the shared model.

Fields

FieldTypeRequiredDescriptionConstraints
refshare.resource-refyes
actoridentity.subject-refyes
owner_subjectidentity.subject-refyes
audienceenumyes
  • one of "public", "link", "people", "private"
subjectidentity.subject-refyes
occurred_atstringyes
  • format date-time
roleenum
  • one of "viewer", "editor"
expires_atstring
  • format date-time
reasonenum
  • one of "member_added", "member_removed", "member_expired", "audience_changed", "transfer_cancelled", "transfer_expired", "ownership_changed"
transfer_idstring
  • format uuid

Examples

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

Valid: example
{
  "ref": {
    "service": "community",
    "kind": "paste",
    "id": "abc"
  },
  "actor": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "owner_subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "audience": "people",
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "occurred_at": "2026-11-06T00:00:00Z",
  "role": "viewer"
}
Rejected: content-leak
{
  "ref": {
    "service": "community",
    "kind": "paste",
    "id": "abc"
  },
  "actor": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "owner_subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "audience": "people",
  "subject": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR"
  },
  "occurred_at": "2026-11-06T00:00:00Z",
  "role": "viewer",
  "content": "forbidden"
}

Validate

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