signature-acd 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb3d0b4d61f9b917ea4ff7b3767ee3b3fabd276b
4
- data.tar.gz: 94b38fe0aca3221961c9919dd57e6cda345ac5fd
3
+ metadata.gz: e7987e7c51751a69866f925f5f219b6285804ec3
4
+ data.tar.gz: 6831aed39ab6b5c072caf19ffd7174aa6bf81d3e
5
5
  SHA512:
6
- metadata.gz: fc32e214764d82a4e18266a0ec90831c64587507d57fc0c49332449f7dbeb0b4bef74db5be0f7d5b17175c66e0ef6b6a844a5571cdceb2f62c428d7ac3aeee1d
7
- data.tar.gz: 68f96770675a1ec5ff91e57c09a72b79438ec9f1111e11468a90bc6146496bea6af2f3fc6e0f7420bf4ec3f068a39a4058ef6f4b12bcc8bb756158b23e5fb7e6
6
+ metadata.gz: 7019b7eb991aa110fa3ce68019482bb32220ee20e67df2faaa3a64e1df0c213c661f6fbcb93bb93c03e3f2c00f9533c4a639832a510121903233180005065098
7
+ data.tar.gz: 6b64c6d445724a9c092da03c893b4c3320567a5bb28686248cd9cc6a3f25d1960dc88d5c7ea3e8a1b8a0d61ef8ba5544a0cebefbf95e680c0cd74e0a9583d5c8
@@ -4,7 +4,7 @@ require 'json'
4
4
  module Signature
5
5
  class Request
6
6
  AUTH_HEADER_PREFIX = "X-API-"
7
- AUTH_HEADER_PREFIX_REGEX = /^X\-API\-(AUTH\-.+)$/
7
+ AUTH_HEADER_PREFIX_REGEX = /X\-API\-(AUTH\-.+)$|X_API_(AUTH_.+)$/
8
8
 
9
9
  attr_accessor :path, :query_hash
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Signature
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
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.9
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-20 00:00:00.000000000 Z
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
@@ -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