documents

Uploaded document handling: sniffs the file type from its bytes, signs short-lived download links and checks content-address names.

Built and tested in the harness, and not in the public repository yet. The install line and the source link appear here when it is.

What it is

documents.

Three pure functions for uploaded documents, with no storage behind them. sniff decides the file type from its bytes, never from a declared Content-Type or file name, and refuses what it cannot read, with the reason. sign and verify make HMAC-SHA256 download links that last five minutes, are bound to the scope, document and content hash, and cannot be moved to another document or scope or extended. store::is_sha256_hex checks a content-address name. Deduplication is left to the caller, who stores the bytes and keeps the rows. For presigned object-store URLs, use cratefield-core's Blob::signed_url instead.

From the crate’s own README.

History

Changelog.

Not released yet. Its changelog starts with its first release.

One of 95 crates in the harness, all of them MIT.