Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separates url building and signing #5

Merged
merged 2 commits into from Apr 29, 2015
Merged

Separates url building and signing #5

merged 2 commits into from Apr 29, 2015

Commits on Apr 21, 2015

  1. Separates url building and signing

    To be used in signing cookies. See PR for details.
    leonelgalan committed Apr 21, 2015
    Copy the full SHA
    d6c350f View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2015

  1. Renames build_url back to sign

    This allows it to be backwards compatible with the existing gem, as
    discussed in #5
    
    ## Usage:
    
    ```ruby
    # In a controller, before serving the images
    before_action :set_cookie
    
    def set_cookie
      signed_params = AWS::CF::Signer.signed_params(
                        nil,
                        resource: 'http://images.example.com/*',
                        expires: 1.day.from_now
                      )
    
      signed_params.each do |name, value|
        cookies["CloudFront-#{name}"] = { value: value,
                                          domain: :all,
                                          httponly: true }
      end
    end
    ```
    leonelgalan committed Apr 28, 2015
    Copy the full SHA
    fedcc31 View commit details
    Browse the repository at this point in the history