aws-cloudfront-signed-cookies-0.1.0.0: Generate signed cookies for AWS CloudFront

Safe HaskellNone
LanguageHaskell2010

Network.AWS.CloudFront.SignedCookies.Policy

Contents

Synopsis

Defining a policy

data Policy Source #

A policy specifies what resource is being granted, for what time period, and to what IP addresses.

For AWS's documentation on what going into a CloudFront policy statement, see Values That You Specify in the Policy Statement for a Custom Policy for Signed Cookies.

Constructors

Policy 

Fields

simplePolicy Source #

Arguments

:: Resource

URL that the policy will grant access to, optionally containing asterisks for wildcards

-> Lifespan

How long from now the credentials expire

-> IO Policy 

This function provides one convenient way to construct a simple Policy.

For the full set of policy options, use the Policy constructor directly.

Components of a policy

newtype Resource Source #

URL that a policy will grant access to, optionally containing asterisks for wildcards.

Examples:

  • "https://d123example.cloudfront.net/index.html"
  • "https://d123example.cloudfront.net/*.jpeg"

Constructors

Resource Text 

data StartTime Source #

The time at which credentials begin to take effect

newtype EndTime Source #

The time at which credentials expire

Constructors

EndTime POSIXTime 

newtype Lifespan Source #

How long from now the credentials expire

data IpAddress Source #

The IP address or address range of clients allowed to make requests

Constructors

AnyIp 
IpAddress Text 

JSON representation

policyJSON :: Policy -> ByteString Source #

Encode a Policy as JSON, with no whitespace, as AWS requires.

Excerpt from Setting Signed Cookies Using a Custom Policy:

  • "Remove all whitespace (including tabs and newline characters) from the policy statement."