Skip to Content
We are live but in Staging 🎉
Data EnginesObjectsCLI Guidedodil data bucket cors

dodil data bucket cors

S3 CORS configuration on a bucketset, get, delete. Mirrors CORS — API Reference. See Core Concepts → CORS for the type signature.

dodil data bucket cors set

dodil data bucket cors set [name] -f FILE dodil data bucket cors set [name] -f - # read from stdin

Reads a JSON document (file or stdin) and applies it as the bucket’s CORS configuration via PutBucketCors. The JSON is parsed with protojson and sent over gRPC, so it must match the BucketCorsConfiguration shape exactly — a corsRules array, camelCase fields throughout.

FlagShortTypeDefaultDescription
--file-fstring-JSON file path, or - for stdin

A set replaces the whole configuration. The server requires at least one rule and at most 100, each with a non-empty allowedOrigins; allowedMethods may only contain GET, HEAD, PUT, POST, DELETE, and maxAgeSeconds must be non-negative.

These rules bind api.data.dodil.io only. The object.uk-lon-1.dodil.io byte plane uses one fixed fleet-wide origin allow-list (localhost, dodil.io, dodil.cloud by default) and never reads BucketCorsConfiguration — setting a rule here will not unblock a browser fetch against the object endpoint. See CORS — API Reference.

Example — from a file:

cat > cors.json <<'EOF' { "corsRules": [ { "allowedOrigins": ["https://app.example.com"], "allowedMethods": ["GET", "PUT"], "allowedHeaders": ["*"], "exposeHeaders": ["ETag"], "maxAgeSeconds": 3600 } ] } EOF dodil data bucket cors set kb-prod -f cors.json

Or via stdin:

jq '.' cors.json | dodil data bucket cors set kb-prod -f -

dodil data bucket cors get

dodil data bucket cors get [name]

Returns the current BucketCorsConfiguration. Use -o json for machine-readable output suitable for round-trip editing. A bucket with no configuration errors with NotFound: no CORS configuration set on this bucket — it does not print an empty corsRules array.

Example:

dodil data bucket cors get kb-prod -o json

dodil data bucket cors delete

dodil data bucket cors delete [name]

Removes the CORS configuration from the bucket.

Example:

dodil data bucket cors delete kb-prod

See also