ResourceName common.resource-name@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- contracts
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-048
- Schema
https://openvibe.network/contracts/common/resource-name.v1.json
common.resource-name@1: the one stable, cross-service name of an OpenVibe resource (OVRN; ADR-034 section 2, ADR-048, plan T13): ovrn:<service>:<project_id>:<type>/<id>, for example ovrn:media:prj_01J0000000000000000000000A:object/med_01K0000000000000000000000B. The service segment is the authority that owns the resource; the project segment is its tenancy boundary; type is the second half of a common.resource-summary@1 kind and id is that summary's id, so the name composes from any resource summary. It is used in grant scopes, audit rows, event subjects, usage records, bill lines and console URLs. It never names a person, an app, a request, a session or an event. The pattern is the one common.usage-recorded@1 resource and common.resource-summary@1 ovrn already use.
Fields
This schema has no named fields.
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: media-object
"ovrn:media:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:object/med_01K6R3A1B2C3D4E5F6G7H8J9KB"Valid: run-sandbox
"ovrn:run:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:sandbox/run_01K6R3A1B2C3D4E5F6G7H8J9KA"Valid: zone-object-zone
"ovrn:zone:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:object-zone/zon_01K6R3A1B2C3D4E5F6G7H8J9KC"Rejected: kind-with-dot
"ovrn:media:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:media.object/med_01K6R3A1B2C3D4E5F6G7H8J9KB"Rejected: not-an-ovrn
"media/med_1"Rejected: two-letter-id
"ovrn:media:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:object/me_01K6R3A1B2C3D4E5F6G7H8J9KB"Rejected: user-id
"ovrn:identity:prj_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:user/usr_01K6R3A1B2C3D4E5F6G7H8J9KB"Rejected: user-not-project
"ovrn:events:usr_01K6R2Z8C4V7M9Q3T5W1X2Y3Z4:queue/evq_01K6R3A1B2C3D4E5F6G7H8J9KD"Validate
const contracts = require('openvibe-contracts');
contracts.validate('common.resource-name@1', value); // { valid, errors: [{ path, message }] }