View Source GoogleSignedUrl (google_signed_url v1.0.0)

Documentation for GoogleSignedUrl.

Link to this section Summary

Functions

Generates signed URLs for Google Cloud Storage without depending on gcloud/gsutil. Only thing required is a valid service account credentials file.

Link to this section Types

Specs

signing_option() ::
  {:expires, integer()}
  | {:headers, map()}
  | {:queries, map()}
  | {:subresource, String.t() | nil}

Specs

signing_options() :: [signing_option()]

Link to this section Functions

Link to this function

signed_url(cred_file, bucket, object_name, method, opts)

View Source

Specs

signed_url(String.t(), String.t(), String.t(), String.t(), signing_options()) ::
  String.t()

Generates signed URLs for Google Cloud Storage without depending on gcloud/gsutil. Only thing required is a valid service account credentials file.

Based on Googles Reference implementation in Python: https://cloud.google.com/storage/docs/access-control/signing-urls-manually

examples

Examples

iex> GoogleSignedUrl.signed_url(
  "path/to/cred_file",
  "bucketname",
  "object_name",
  "PUT",
  3600,
  headers: %{"x-goog-test" => "value"},
  queries: %{"key" => "value"},
  subresource: "somestring"
)