LinkAccessGrantToken link.access-grant-token@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/link/access-grant-token.v1.json

Claims of the signed grant JWT; target is audience, requester is subject.

Fields

FieldTypeRequiredDescriptionConstraints
issstringyes
audstringyes
  • pattern ^lnk_[0-9A-HJKMNP-TV-Z]{26}$
substringyes
  • pattern ^lnk_[0-9A-HJKMNP-TV-Z]{26}$
jtistringyes
  • pattern ^[a-z]{3}_[A-Za-z0-9_-]{8,80}$
grant_idstringyes
  • pattern ^[a-z]{3}_[A-Za-z0-9_-]{8,80}$
scopesarray of enumyes
  • minItems 1
  • unique items
  • items: one of "agent", "send", "screen", "desk", "computer", "worker"
iatintegeryes
expintegeryes

Examples

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

Valid: example
{
  "iss": "https://openvibe.network",
  "aud": "lnk_BBBBBBBBBBBBBBBBBBBBBBBBBB",
  "sub": "lnk_AAAAAAAAAAAAAAAAAAAAAAAAAA",
  "jti": "tok_12345678",
  "grant_id": "grt_12345678",
  "scopes": [
    "agent"
  ],
  "iat": 1794355200,
  "exp": 1794358800
}
Rejected: example
{}

Validate

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