GitAccessRequest git.access-request@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- git
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/git/access-request.v1.json
git.access-request@1: the common request of git.read and git.write on OpenVibe.Git. owner and name name the repository at git.openvibe.codes; ref and path pick what is read; branch, message and files describe a contents write without a clone. A service names the person it acts for in X-OV-Subject, not in this body.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
owner | string | yes | The repository owner's lower-case OpenVibe username. |
|
name | string | yes | The repository name, lower-case and never ending in .git. |
|
ref | string | A branch or tag to read at; the default branch when absent. |
| |
path | string | A path inside the tree or a blob's path. |
| |
branch | string | The branch a contents write goes on. |
| |
message | string | The commit message of a contents write. |
| |
files | array of object | The files a contents write changes, by path and full content. |
| |
files[].path | string | yes |
| |
files[].content | string | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: read-a-file
{
"owner": "ada",
"name": "my-site",
"ref": "main",
"path": "README.md"
}Valid: write-without-a-clone
{
"owner": "ada",
"name": "my-site",
"branch": "agent/run-1",
"message": "Write the title without a clone",
"files": [
{
"path": "notes.txt",
"content": "made by the API\n"
}
]
}Rejected: name-carries-a-slash
{
"owner": "ada",
"name": "ada/my-site"
}Rejected: name-missing
{
"owner": "ada"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('git.access-request@1', value); // { valid, errors: [{ path, message }] }