View Source CozyOSS.Object (cozy_oss v0.2.0)

Provides object related helpers.

Link to this section Summary

Functions

Signs policy for PostObject, and returns the encoded policy and its signature.

Link to this section Functions

Link to this function

sign_post_object_policy(config, conditions, expiration_in_seconds)

View Source
@spec sign_post_object_policy(CozyOSS.Config.t(), list(), pos_integer()) :: %{
  policy: String.t(),
  signature: String.t()
}

Signs policy for PostObject, and returns the encoded policy and its signature.

See more at PostObject in the official documentation.

examples

Examples

conditions = [
  ["eq", "$key", "lenna.png"],
  ["eq", "$x-oss-object-acl", "private"],
  ["content-length-range", 1, 1024 * 1024 * 5]
]

sign_post_object_policy(config, conditions, 3600)