Local filesystem storage adapter.
Implements IFileStorage for storing files on the local filesystem. Suitable for development and single-server deployments.
Local filesystem storage adapter. Implements IFileStorage for storing files on the local filesystem. Suitable for development and single-server deployments.
(create-local-storage {:keys [base-path url-base signing-secret
create-directories? logger]
:or {create-directories? true}})Create a local filesystem storage adapter.
Options:
Create a local filesystem storage adapter. Options: - :base-path - Root directory for file storage (required) - :url-base - Base URL for accessing files (optional) - :signing-secret - HMAC key enabling signed, expiring URLs (optional) - :create-directories? - Create base directory if missing (default: true) - :logger - Logger instance (optional)
(verify-signed-url signing-secret file-key {:keys [expires signature]})Verify a signed local-storage URL. Given the configured signing-secret, the
file-key, and the URL's query params (:expires epoch-seconds, :signature
hex), return true iff the signature matches and the URL has not expired.
The serving route is responsible for calling this before streaming a private file — the local adapter cannot enforce it at the filesystem layer.
Verify a signed local-storage URL. Given the configured `signing-secret`, the `file-key`, and the URL's query params (`:expires` epoch-seconds, `:signature` hex), return true iff the signature matches and the URL has not expired. The serving route is responsible for calling this before streaming a private file — the local adapter cannot enforce it at the filesystem layer.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |