NetworkGrantChangedPayload network.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.grant.changed.v1.json
network.grant.changed v1 (OpenVibe.Network server/developer/store.js grantEvent; ADR-014). A developer app's capability grant changed state: requested, approved, denied or revoked. Written through Network's developer event relay beside the project audit row. OpenVibe.Events stops an app's subscriptions at once when its events.app.subscribe grant leaves approved. Envelope: subject { type: app, id: <app_…> }, visibility internal. (A first-party service principal's grant is network.principal_grant.changed.)
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
project_id | string | yes |
| |
capability | string | yes |
| |
audience | string | yes |
| |
from | enum | yes |
| |
to | enum | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: revoked
{
"project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"capability": "events.app.subscribe",
"audience": "openvibe.events",
"from": "approved",
"to": "revoked"
}Rejected: bad-to
{
"project_id": "prj_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"capability": "events.app.subscribe",
"audience": "openvibe.events",
"from": "none",
"to": "granted"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('network.grant.changed@1', value); // { valid, errors: [{ path, message }] }