signature-acd 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/signature/request.rb +1 -1
- data/lib/signature/version.rb +1 -1
- metadata +2 -3
- data/lib/signature/header.rb +0 -31
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e7987e7c51751a69866f925f5f219b6285804ec3
         | 
| 4 | 
            +
              data.tar.gz: 6831aed39ab6b5c072caf19ffd7174aa6bf81d3e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 7019b7eb991aa110fa3ce68019482bb32220ee20e67df2faaa3a64e1df0c213c661f6fbcb93bb93c03e3f2c00f9533c4a639832a510121903233180005065098
         | 
| 7 | 
            +
              data.tar.gz: 6b64c6d445724a9c092da03c893b4c3320567a5bb28686248cd9cc6a3f25d1960dc88d5c7ea3e8a1b8a0d61ef8ba5544a0cebefbf95e680c0cd74e0a9583d5c8
         | 
    
        data/lib/signature/request.rb
    CHANGED
    
    
    
        data/lib/signature/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: signature-acd
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.10
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Thomas Hanson
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2014-05- | 
| 13 | 
            +
            date: 2014-05-23 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: rspec
         | 
| @@ -70,7 +70,6 @@ files: | |
| 70 70 | 
             
            - Rakefile
         | 
| 71 71 | 
             
            - lib/signature.rb
         | 
| 72 72 | 
             
            - lib/signature/exceptions.rb
         | 
| 73 | 
            -
            - lib/signature/header.rb
         | 
| 74 73 | 
             
            - lib/signature/query_encoder.rb
         | 
| 75 74 | 
             
            - lib/signature/request.rb
         | 
| 76 75 | 
             
            - lib/signature/token.rb
         | 
    
        data/lib/signature/header.rb
    DELETED
    
    | @@ -1,31 +0,0 @@ | |
| 1 | 
            -
            module Signature
         | 
| 2 | 
            -
              module Header
         | 
| 3 | 
            -
                class Request < ::Signature::Request
         | 
| 4 | 
            -
                  AUTH_HEADER_PREFIX = "X-API-"
         | 
| 5 | 
            -
                  AUTH_HEADER_PREFIX_REGEX = /^X\-API\-(AUTH\-.+)$/
         | 
| 6 | 
            -
             | 
| 7 | 
            -
                  def self.parse_headers headers={}
         | 
| 8 | 
            -
                    hh = {}
         | 
| 9 | 
            -
                    headers.each do |k,v|
         | 
| 10 | 
            -
                      if match = k.upcase.match(AUTH_HEADER_PREFIX_REGEX)
         | 
| 11 | 
            -
                        hh[match[1].downcase.gsub!('-', '_')] = v
         | 
| 12 | 
            -
                      end
         | 
| 13 | 
            -
                    end
         | 
| 14 | 
            -
                    hh
         | 
| 15 | 
            -
                  end
         | 
| 16 | 
            -
             | 
| 17 | 
            -
                  def initialize method, path, query={}, headers={}
         | 
| 18 | 
            -
                    auth_hash = self.class.parse_headers(headers)
         | 
| 19 | 
            -
                    super(method, path, query.merge(auth_hash))
         | 
| 20 | 
            -
                  end
         | 
| 21 | 
            -
             | 
| 22 | 
            -
                  def sign token
         | 
| 23 | 
            -
                    auth_hash = super(token)
         | 
| 24 | 
            -
                    auth_hash.inject({}) do |memo, (k,v)|
         | 
| 25 | 
            -
                      memo["#{AUTH_HEADER_PREFIX}#{k.to_s.upcase.gsub('_', '-')}"] = v
         | 
| 26 | 
            -
                      memo
         | 
| 27 | 
            -
                    end
         | 
| 28 | 
            -
                  end
         | 
| 29 | 
            -
                end
         | 
| 30 | 
            -
              end
         | 
| 31 | 
            -
            end
         |