chore(v2): establish protocol and test foundation
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://backup-tool.invalid/contracts/repository/v1/manifest.schema.json",
|
||||
"title": "Backup Tool Manifest v1",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"format_version", "backup_id", "repository_id", "source_id", "job_id", "execution_id",
|
||||
"requested_mode", "effective_mode", "created_at", "source_consistency", "exclusion_policy",
|
||||
"entries", "aggregates", "encryption_key_id", "manifest_digest"
|
||||
],
|
||||
"properties": {
|
||||
"format_version": {"const": 1},
|
||||
"backup_id": {"type": "string", "format": "uuid"},
|
||||
"repository_id": {"type": "string", "format": "uuid"},
|
||||
"source_id": {"type": "string", "format": "uuid"},
|
||||
"job_id": {"type": "string", "format": "uuid"},
|
||||
"execution_id": {"type": "string", "format": "uuid"},
|
||||
"requested_mode": {"enum": ["full", "incremental"]},
|
||||
"effective_mode": {"enum": ["full", "incremental"]},
|
||||
"created_at": {"type": "string", "format": "date-time"},
|
||||
"source_consistency": {"type": "object"},
|
||||
"exclusion_policy": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["matcher", "version", "patterns"],
|
||||
"properties": {
|
||||
"matcher": {"const": "gitignore"},
|
||||
"version": {"type": "integer", "minimum": 1},
|
||||
"patterns": {"type": "array", "items": {"type": "string"}}
|
||||
}
|
||||
},
|
||||
"entries": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/$defs/entry"}
|
||||
},
|
||||
"aggregates": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["entry_count", "logical_bytes", "stored_bytes"],
|
||||
"properties": {
|
||||
"entry_count": {"type": "integer", "minimum": 0},
|
||||
"logical_bytes": {"type": "integer", "minimum": 0},
|
||||
"stored_bytes": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"encryption_key_id": {"type": ["string", "null"]},
|
||||
"manifest_digest": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"$defs": {
|
||||
"entry": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["path", "type", "size", "blob_digest", "mode", "mtime_ns", "link_target", "metadata_support"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "minLength": 1, "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$"},
|
||||
"type": {"enum": ["file", "directory", "symlink"]},
|
||||
"size": {"type": "integer", "minimum": 0},
|
||||
"blob_digest": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
|
||||
"mode": {"type": ["integer", "null"], "minimum": 0},
|
||||
"mtime_ns": {"type": ["integer", "null"], "minimum": 0},
|
||||
"link_target": {"type": ["string", "null"]},
|
||||
"metadata_support": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user