190 lines
4.5 KiB
JSON
190 lines
4.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://edu-tools.local/rv-launcher/tokens.schema.json",
|
|
"title": "RV launcher tokens",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["version", "tokens"],
|
|
"properties": {
|
|
"version": {
|
|
"const": 3
|
|
},
|
|
"tokens": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/$defs/token"
|
|
}
|
|
}
|
|
},
|
|
"$defs": {
|
|
"server": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["type", "endpoint", "scheme", "host", "port"],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string"
|
|
},
|
|
"endpoint": {
|
|
"type": "string",
|
|
"format": "uri"
|
|
},
|
|
"scheme": {
|
|
"enum": ["http", "https"]
|
|
},
|
|
"host": {
|
|
"type": "string"
|
|
},
|
|
"port": {
|
|
"type": ["integer", "null"],
|
|
"minimum": 1,
|
|
"maximum": 65535
|
|
}
|
|
}
|
|
},
|
|
"scope_permissions": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["a", "A", "i", "m", "n", "o", "p", "r", "u"],
|
|
"properties": {
|
|
"a": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "activitypub"
|
|
},
|
|
"A": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "admin"
|
|
},
|
|
"i": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "issue"
|
|
},
|
|
"m": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "misc"
|
|
},
|
|
"n": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "notification"
|
|
},
|
|
"o": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "organization"
|
|
},
|
|
"p": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "package"
|
|
},
|
|
"r": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "repository"
|
|
},
|
|
"u": {
|
|
"$ref": "#/$defs/scope_value",
|
|
"description": "user"
|
|
}
|
|
}
|
|
},
|
|
"org_permissions": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["o", "a", "w", "r", "c"],
|
|
"properties": {
|
|
"o": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "owner"
|
|
},
|
|
"a": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "admin"
|
|
},
|
|
"w": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "write"
|
|
},
|
|
"r": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "read"
|
|
},
|
|
"c": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "create repository"
|
|
}
|
|
}
|
|
},
|
|
"repo_permissions": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["o", "a", "w", "r"],
|
|
"properties": {
|
|
"o": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "owner"
|
|
},
|
|
"a": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "admin"
|
|
},
|
|
"w": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "write"
|
|
},
|
|
"r": {
|
|
"$ref": "#/$defs/flag_value",
|
|
"description": "read"
|
|
}
|
|
}
|
|
},
|
|
"scope_value": {
|
|
"enum": ["w", "r", "-", "?", "!"]
|
|
},
|
|
"flag_value": {
|
|
"enum": ["+", "-", "?", "!"]
|
|
},
|
|
"token": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["id", "value", "server", "org", "repo"],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"minLength": 1,
|
|
"description": "Git remote name, for example r1 or r1a."
|
|
},
|
|
"value": {
|
|
"type": "string",
|
|
"description": "Token secret. May be empty only in a manual skeleton."
|
|
},
|
|
"server": {
|
|
"$ref": "#/$defs/server"
|
|
},
|
|
"user": {
|
|
"type": "string",
|
|
"description": "User/login used in the authenticated remote URL."
|
|
},
|
|
"org": {
|
|
"type": "string"
|
|
},
|
|
"repo": {
|
|
"type": "string"
|
|
},
|
|
"valid": {
|
|
"type": "string"
|
|
},
|
|
"expires_at": {
|
|
"type": "string"
|
|
},
|
|
"scope": {
|
|
"$ref": "#/$defs/scope_permissions"
|
|
},
|
|
"org_perm": {
|
|
"$ref": "#/$defs/org_permissions"
|
|
},
|
|
"repo_perm": {
|
|
"$ref": "#/$defs/repo_permissions"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|