VipPolicyRule vip.policy-rule@1

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

Version
1.0.0
Owner
vip
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/vip/policy-rule.v1.json

vip.policy-rule@1: a gated-resource rule on OpenVibe.VIP (server/domain/policies.js present): resource R (an EntityRef the product owns) is for members of creator C (requirement member), members of one plan (plan, plan_id), or members whose plan version includes a perk (perk, perk_key). sensitive rules always ask Billing, never the projection. A rule that was replaced or removed is disabled.

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^vgr_[0-9A-HJKMNP-TV-Z]{26}$
creatorone ofyes
creator_idstringyes
  • pattern ^vcr_[0-9A-HJKMNP-TV-Z]{26}$
resourcecommon.entity-refyes
requirementenumyes
  • one of "member", "plan", "perk"
plan_idstring | nullyes
perk_keystring | nullyes
sensitivebooleanyes
statusenumyes
  • one of "active", "disabled"
updated_atstringyes
  • format date-time

Examples

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

Valid: perk
{
  "id": "vgr_01JAB2C3D4E5F6G7H8J9K0MNPY",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "creator_id": "vcr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "resource": {
    "service": "blog",
    "type": "post",
    "id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPZ"
  },
  "requirement": "perk",
  "plan_id": null,
  "perk_key": "chat-badge",
  "sensitive": false,
  "status": "active",
  "updated_at": "2026-09-20T18:04:11.402Z"
}
Rejected: bad-requirement
{
  "id": "vgr_01JAB2C3D4E5F6G7H8J9K0MNPY",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "creator_id": "vcr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "resource": {
    "service": "blog",
    "type": "post",
    "id": "pst_01JAB2C3D4E5F6G7H8J9K0MNPZ"
  },
  "requirement": "follower",
  "plan_id": null,
  "perk_key": "chat-badge",
  "sensitive": false,
  "status": "active",
  "updated_at": "2026-09-20T18:04:11.402Z"
}

Validate

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