59 lines
4.4 KiB
JSON
59 lines
4.4 KiB
JSON
{
|
|
"/api/v1/blobs/{app_id}/{sha256}": {
|
|
"parameters": [
|
|
{"name":"app_id","in":"path","required":true,"schema":{"type":"string"}},
|
|
{"name":"sha256","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},
|
|
{"name":"X-Mesh-Tx","in":"header","required":true,"schema":{"type":"string"}}
|
|
],
|
|
"put": {
|
|
"summary":"Store immutable private encrypted bytes on this node",
|
|
"description":"Bearer and account/device transaction signatures are required. Body SHA-256 must equal the path. Maximum 16 MiB. Blobs are scoped to account and active app; they are excluded from mesh replication.",
|
|
"security":[{"bearerAuth":[]}],
|
|
"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},
|
|
"responses":{"204":{"description":"Stored atomically"},"400":{"description":"Invalid address or hash"},"401":{"description":"Missing or invalid authorization"},"403":{"description":"App inactive"},"409":{"description":"Replay rejected"},"413":{"description":"Empty or oversized blob"},"507":{"description":"Storage unavailable"}}
|
|
},
|
|
"get": {
|
|
"summary":"Read account-private encrypted bytes",
|
|
"security":[{"bearerAuth":[]}],
|
|
"responses":{"200":{"description":"Integrity-checked ciphertext","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Authorization required"},"404":{"description":"No blob in this account/app"},"503":{"description":"Integrity check failed"}}
|
|
},
|
|
"head": {
|
|
"summary":"Check an account-private ciphertext blob before resuming upload",
|
|
"security":[{"bearerAuth":[]}],
|
|
"responses":{"200":{"description":"Blob available"},"401":{"description":"Authorization required"},"404":{"description":"Blob unavailable"}}
|
|
},
|
|
"delete": {
|
|
"summary":"Delete an account-private blob the account no longer references",
|
|
"description":"Bearer and account/device transaction signatures are required. The blob stops counting toward the account's storage. Deleting a missing blob also succeeds.",
|
|
"security":[{"bearerAuth":[]}],
|
|
"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid authorization"},"403":{"description":"App inactive"},"409":{"description":"Replay rejected"},"507":{"description":"Storage unavailable"}}
|
|
}
|
|
},
|
|
"/api/v1/blobs/{app_id}/{sha256}/trash": {
|
|
"parameters": [
|
|
{"name":"app_id","in":"path","required":true,"schema":{"type":"string"}},
|
|
{"name":"sha256","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},
|
|
{"name":"X-Mesh-Tx","in":"header","required":true,"schema":{"type":"string"}}
|
|
],
|
|
"post": {
|
|
"summary":"Move an account-private blob to the trash",
|
|
"description":"Bearer and account/device transaction signatures are required, with an empty body. A trashed blob stays readable but stops counting toward the account's storage at once. The node deletes it after its trash period, 30 days after it was first trashed by default, unless it is restored or stored again. Trashing a blob already in the trash also succeeds.",
|
|
"security":[{"bearerAuth":[]}],
|
|
"responses":{"204":{"description":"In the trash"},"401":{"description":"Missing or invalid authorization"},"403":{"description":"App inactive"},"404":{"description":"No blob in this account/app"},"409":{"description":"Replay rejected"}}
|
|
}
|
|
},
|
|
"/api/v1/blobs/{app_id}/{sha256}/restore": {
|
|
"parameters": [
|
|
{"name":"app_id","in":"path","required":true,"schema":{"type":"string"}},
|
|
{"name":"sha256","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"}},
|
|
{"name":"X-Mesh-Tx","in":"header","required":true,"schema":{"type":"string"}}
|
|
],
|
|
"post": {
|
|
"summary":"Take an account-private blob out of the trash",
|
|
"description":"Bearer and account/device transaction signatures are required, with an empty body. The blob counts toward the account's storage again, so a full account is refused with storage_full. Restoring a blob that is not in the trash also succeeds.",
|
|
"security":[{"bearerAuth":[]}],
|
|
"responses":{"204":{"description":"Restored"},"401":{"description":"Missing or invalid authorization"},"403":{"description":"App inactive"},"404":{"description":"No blob in this account/app"},"409":{"description":"Replay rejected"},"413":{"description":"Account storage full"}}
|
|
}
|
|
}
|
|
}
|