SubjectRef identity.subject-ref@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
network
Visibility
public
Status
active
Compatibility
backward
Decision
ADR-001
Schema
https://openvibe.network/contracts/identity/subject-ref.v1.json

The one cross-platform reference to an actor. Issued by OpenVibe.Network. Never a service-local integer id.

Fields

This schema has no named fields.

Examples

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

Valid: guest
{
  "type": "guest",
  "id": "gst_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
Valid: service
{
  "type": "service",
  "id": "live"
}
Valid: user
{
  "type": "user",
  "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}
Rejected: extra-field
{
  "type": "user",
  "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "username": "x"
}
Rejected: integer-id
{
  "type": "user",
  "id": 42
}
Rejected: live-local-id
{
  "type": "user",
  "id": "123"
}
Rejected: service-uppercase
{
  "type": "service",
  "id": "Live"
}
Rejected: unknown-type
{
  "type": "bot",
  "id": "x1"
}
Rejected: wrong-prefix
{
  "type": "user",
  "id": "gst_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}

Validate

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