draft
optional
Defines the /mirror
endpoint
A server may expose a PUT /mirror
endpoint to allow users to copy a blob from a URL instead of uploading it
Clients MUST pass the URL of the remote blob as a stringified JSON object in the request body
// request body
{
"url": "https://cdn.satellite.earth/b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf"
}
Clients MUST set the Authorization
header to an upload authorization event defined in BUD-02
The /mirror
endpoint MUST download the blob from the specified URL and verify that there is at least one x
tag in the authorization event matching the sha256 hash of the download blob
Multiple x
tags MUST NOT be interpreted as the user requesting a bulk mirror.
The endpoint MUST return a Blob Descriptor if the mirroring was successful or an error object if it was not
Servers should re-use the Content-Type
header returned from the URL to discover the mime type of the blob. if none is returned it may use the file extension in the URL
Servers MAY reject a mirror request for any reason and should respond with the appropriate HTTP 4xx
status code and an error message explaining the reason for the rejection
- Client signs authorization event and uploads blob to Server A
- Server A returns blob descriptor with
url
- Client sends the
url
to Server B/mirror
using the original authorization event - Server B downloads blob from Server A using the url
- Server B verifies downloaded blob hash matches
x
tag in authorization event - Server B returns Blob Descriptor