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

FieldTypeRequiredDescriptionConstraints
ownerstringyesThe repository owner's lower-case OpenVibe username.
  • pattern ^[a-z0-9][a-z0-9._-]{0,38}$
namestringyesThe repository name, lower-case and never ending in .git.
  • pattern ^[a-z0-9][a-z0-9._-]{0,99}$
refstringA branch or tag to read at; the default branch when absent.
  • maxLength 255
pathstringA path inside the tree or a blob's path.
  • maxLength 4096
branchstringThe branch a contents write goes on.
  • maxLength 255
messagestringThe commit message of a contents write.
  • maxLength 2000
filesarray of objectThe files a contents write changes, by path and full content.
  • maxItems 200
  • items: no other fields
files[].pathstringyes
  • maxLength 4096
files[].contentstringyes

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 }] }