88 lines
3.3 KiB
JSON
88 lines
3.3 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://basicstack.de/schemas/ds/receipts/v1.0.0.json",
|
|
"title": "DataSource Response: ds:receipts /receipt v1.0.0",
|
|
"description": "Metadaten-Rückgabe des Receipt-Adapters für einen bekannten Beleg (identifiziert über content_hash). Der eigentliche Beleg-Blob wird separat per /api/v1/receipts/{content_hash}/content geladen (nur nach OPA-Prüfung). Diese Response enthält ausschließlich Metadaten und Referenzen — keine PII-Inhalte.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["schema", "data_source", "resource", "filters", "receipt", "returned_at"],
|
|
"properties": {
|
|
"schema": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "version"],
|
|
"properties": {
|
|
"name": { "const": "ds.receipts" },
|
|
"version": { "const": "1.0.0" }
|
|
}
|
|
},
|
|
"data_source": { "const": "ds:receipts" },
|
|
"resource": { "const": "receipt" },
|
|
"filters": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["content_hash"],
|
|
"properties": {
|
|
"content_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
|
|
}
|
|
},
|
|
"returned_at": { "type": "string", "format": "date-time" },
|
|
"receipt": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"content_hash",
|
|
"pii_store_ref",
|
|
"mime_type",
|
|
"size_bytes",
|
|
"uploaded_by_agent",
|
|
"on_behalf_of_user",
|
|
"uploaded_at",
|
|
"attestation_ref"
|
|
],
|
|
"properties": {
|
|
"content_hash": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
|
|
"pii_store_ref": {
|
|
"type": "string",
|
|
"pattern": "^pii://[A-Za-z0-9/._-]+$",
|
|
"description": "Logischer Pfad im PII-Store (verschlüsselter Bucket). KEIN Download-Link; der Blob kommt über einen separaten authorisierten Endpunkt."
|
|
},
|
|
"mime_type": {
|
|
"type": "string",
|
|
"enum": ["application/pdf", "image/png", "image/jpeg", "image/webp"]
|
|
},
|
|
"size_bytes": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 20971520,
|
|
"description": "Beleg-Blob-Grösse in Bytes. Hartes Oberlimit: 20 MiB."
|
|
},
|
|
"uploaded_by_agent": {
|
|
"type": "string",
|
|
"description": "agent_id der uploadenden Komponente (typischerweise agent-travel)."
|
|
},
|
|
"on_behalf_of_user": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["iss", "sub", "session_id"],
|
|
"properties": {
|
|
"iss": { "type": "string" },
|
|
"sub": { "type": "string" },
|
|
"session_id": { "type": "string" }
|
|
}
|
|
},
|
|
"uploaded_at": { "type": "string", "format": "date-time" },
|
|
"attestation_ref": {
|
|
"type": "string",
|
|
"pattern": "^sha256:[0-9a-f]{64}$",
|
|
"description": "SHA-256 der Receipt Attestation (predicateType https://basicstack.de/attestations/receipt_ingest/v1)."
|
|
},
|
|
"deleted_at": {
|
|
"type": ["string", "null"],
|
|
"format": "date-time",
|
|
"description": "Wenn gesetzt: der Beleg wurde gelöscht (Retention oder DSGVO-Antrag). GET auf den Blob-Endpunkt liefert dann 410 Gone."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|