NetworkPrincipalGrantChangedPayload network.principal_grant.changed@1

Generated at from openvibe-contracts v0.51.0 and openvibe-sdk v0.11.0.

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

network.principal_grant.changed v1 (OpenVibe.Network server/identity/grants-admin.js; roadmap WS-D task 3). A first-party service principal's capability grant was given, changed (namespaces or expiry), revoked by the owner, or expired. The seeded default grants are not announced. Written to Network's outbox in the transaction that changes principal_grants, beside an audit row. A service's next token (at most 5 minutes later) carries the change. Envelope: subject { type: grant, id: <client_id>:<capability>@<audience> }, visibility internal, actor the owner who changed it (or the system for an expiry). (A developer app's grant is network.grant.changed.)

Fields

FieldTypeRequiredDescriptionConstraints
client_idstringyesThe service principal (oauth client id).
  • pattern ^[a-z][a-z0-9_-]{0,63}$
capabilitystringyes
  • pattern ^[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\.[a-z][a-z0-9_]*$
audiencestringyes
  • pattern ^openvibe\.[a-z][a-z0-9_-]{0,63}$
changeenumyes
  • one of "granted", "updated", "revoked", "expired"
namespacesarray of string
  • maxItems 100
  • items: maxLength 200
expires_atstring | null
  • format date-time
reasonstring | null
  • maxLength 500
actor_subjectstring | nullThe owner who made the change; null for an expiry.

Examples

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

Valid: expired
{
  "client_id": "tools",
  "capability": "media.object.write",
  "audience": "openvibe.media",
  "change": "expired",
  "namespaces": [],
  "expires_at": "2026-09-25T00:00:00.000Z",
  "reason": null,
  "actor_subject": null
}
Valid: granted
{
  "client_id": "live",
  "capability": "network.modules.write",
  "audience": "openvibe.network",
  "change": "granted",
  "namespaces": [
    "live.profile"
  ],
  "expires_at": "2026-12-31T00:00:00.000Z",
  "reason": "profile summaries",
  "actor_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
Rejected: bad-change
{
  "client_id": "live",
  "capability": "network.modules.write",
  "audience": "openvibe.network",
  "change": "deleted"
}

Validate

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