GitAccessResult git.access-result@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-result.v1.json

git.access-result@1: the common result of git.read and git.write on OpenVibe.Git. A repository names its full name, its page and clone addresses, its visibility and default branch; a contents write or a token also carries the branch or commit it made.

Fields

FieldTypeRequiredDescriptionConstraints
full_namestringyes
  • pattern ^[a-z0-9][a-z0-9._-]{0,38}/[a-z0-9][a-z0-9._-]{0,99}$
html_urlstring
  • pattern ^https://
  • format uri
clone_urlstring
  • pattern ^https://
  • format uri
visibilityenum
  • one of "public", "private"
default_branchstring
  • maxLength 255
branchstring
  • maxLength 255
shastring
  • pattern ^[0-9a-f]{40}([0-9a-f]{24})?$

Examples

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

Valid: contents-write
{
  "full_name": "ada/my-site",
  "branch": "agent/run-1",
  "sha": "0123456789abcdef0123456789abcdef01234567"
}
Valid: repository
{
  "full_name": "ada/my-site",
  "html_url": "https://git.openvibe.codes/ada/my-site",
  "clone_url": "https://git.openvibe.codes/ada/my-site.git",
  "visibility": "private",
  "default_branch": "main"
}
Rejected: insecure-clone-url
{
  "full_name": "ada/my-site",
  "clone_url": "http://git.openvibe.codes/ada/my-site.git"
}
Rejected: not-a-full-name
{
  "full_name": "ada"
}

Validate

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