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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
client_id | string | yes | The service principal (oauth client id). |
|
capability | string | yes |
| |
audience | string | yes |
| |
change | enum | yes |
| |
namespaces | array of string |
| ||
expires_at | string | null |
| ||
reason | string | null |
| ||
actor_subject | string | null | The 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 }] }