tcb storage objects sign
Generate a temporary download URL for an object; add --upload to switch to an upload URL.
v3.4.0+
PG mode storage commands have been available since @cloudbase/cli@3.4.0.
Usage
# Download signature
tcb storage objects sign <keys...> -b <bucketId> [--expires-in <seconds>] [--json]
# Upload signature
tcb storage objects sign <key> --upload -b <bucketId> [--upsert] [--json]
Parameters
| Parameter | Required | Description | Default |
|---|---|---|---|
<keys...> | Yes | 1 to 500 in download mode; exactly 1 in upload mode | — |
-b, --bucket <bucketId> | Yes | Bucket ID | — |
--upload | No | Switch to upload signature mode | false |
--expires-in <seconds> | No | Expiry in seconds, at least 1, download mode only | 600 |
--upsert | No | Allow overwriting, equivalent to x-upsert: true, upload mode only | false |
--json | No | Download mode outputs [{ path, signedURL, error }]; upload mode outputs { url, token } | — |
Mutual exclusion rules:
--uploadand--expires-incannot be combined.--upsertis rejected in download mode.--uploadsigns exactly one key per call.
Examples
tcb storage objects sign test/hello.txt -b my-bucket --expires-in 3600
tcb storage objects sign test/hello.txt -b my-bucket --upload --upsert