Module Bucket.Cors

type options = {
  1. expected_bucket_owner : Account_id.t option;
    (*

    x-amz-expected-bucket-owner.

    *)
}

Bucket CORS request options.

module Method : sig ... end

Bucket CORS configuration.

type rule = {
  1. id : string option;
    (*

    Optional S3 rule id.

    *)
  2. allowed_origins : string list;
    (*

    Allowed CORS origins.

    *)
  3. allowed_methods : Method.t list;
    (*

    Allowed HTTP methods.

    *)
  4. allowed_headers : string list;
    (*

    Request headers allowed by browsers.

    *)
  5. expose_headers : string list;
    (*

    Response headers browsers may expose to callers.

    *)
  6. max_age_seconds : int option;
    (*

    Browser preflight cache lifetime.

    *)
}

One CORS rule. Lists are emitted in the order supplied by the caller.

type config = {
  1. rules : rule list;
}

Bucket CORS configuration sent to or returned from S3.

type result = {
  1. config : config;
  2. response : Awskit.Response.t;
}

GetBucketCors result metadata.

val default_options : options

Default bucket CORS options: no owner guard.

val options : ?expected_bucket_owner:Account_id.t -> unit -> (options, Awskit.Error.t) Stdlib.result

Build bucket CORS request options.

val options_exn : ?expected_bucket_owner:Account_id.t -> unit -> options

Like options, but raises on validation failure.