AccessKeyIssueRequest media.access-key-issue-request@1
Generated at from
openvibe-contracts v0.177.0 and
openvibe-sdk v0.44.0.
- Version
- 1.0.0
- Owner
- media
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-031
- Schema
https://openvibe.network/contracts/media/access-key-issue-request.v1.json
media.access-key-issue-request@1 (ADR-031): the body of POST /api/v1/projects/:project_id/access-keys on OpenVibe.Media (capability media.access_key.manage), sent by a first-party service (OpenVibe.Zone, OpenVibe.Services) for the person in on_behalf_of, who must be an admin or owner of the project (Network decides). The answer is 201 media.access-key-issued@1. A zone that is not an active zone of this project environment answers 404 media.access_key.unknown_zone; more than 50 live keys in one environment answer 409 media.access_key.limit.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
env | enum | yes |
| |
name | string | yes |
| |
permissions | enum |
| ||
zones | array of string |
| ||
on_behalf_of | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: basic
{
"env": "production",
"name": "backups",
"permissions": "write",
"zones": [
"zon_01JZ0000000000000000000Z01"
],
"on_behalf_of": "usr_01JZ0000000000000000000A01"
}Rejected: basic
{
"env": "staging",
"name": "backups",
"on_behalf_of": "usr_01JZ0000000000000000000A01"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('media.access-key-issue-request@1', value); // { valid, errors: [{ path, message }] }