ExOss.CDN.CloudFront (ExOss v1.0.0)

Copy Markdown View Source

CloudFront CDN adapter.

Implements ExOss.CDN.Behaviour to generate signed CloudFront URLs for both download and upload operations.

CloudFront signed URLs use an RSA-SHA1 signature over a JSON policy document, along with Key-Pair-Id, Expires, Signature, and Policy query parameters.

Configuration

config :my_app, MyApp.Storage,
  cdn: [
    provider: :cloudfront,
    endpoint: "https://d123456789.cloudfront.net",
    aws_key_id: "K2XXXXXXXXXXXXX",
    aws_private_key: "-----BEGIN RSA PRIVATE KEY-----\n..."
  ]

Summary

Functions

sign(policy, private_key)

@spec sign(binary(), binary()) :: binary()