Class: Aws::CloudFront::CookieSigner
- Inherits:
-
Object
- Object
- Aws::CloudFront::CookieSigner
- Includes:
- Signer
- Defined in:
- lib/aws-sdk-core/cloudfront/cookie_signer.rb
Overview
Allows you to create signed cookie for Amazon CloudFront resources
signer = Aws::CloudFront::CookieSigner.new(
key_pair_id: "cf-keypair-id",
private_key_path: "./cf_private_key.pem"
)
= signer.(url,
policy: policy.to_json
)
Instance Method Summary collapse
-
#signed_cookie(url, params = {}) ⇒ Object
create a set of signed Amazon CloudFront cookie parameters.
Methods included from Signer
Instance Method Details
#signed_cookie(url, params = {}) ⇒ Object
create a set of signed Amazon CloudFront cookie parameters
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aws-sdk-core/cloudfront/cookie_signer.rb', line 27 def (url, params = {}) scheme, uri = scheme_and_uri(url) signed_content = signature( resource: resource(scheme, uri), expires: time(params[:expires]), policy: params[:policy] ) = {} signed_content.each { |k, v| ["CloudFront-#{k}"] = v.to_s.gsub("\n", '') } end |