ey-hmac 0.1.2 → 0.1.3
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/ey-hmac/adapter.rb +3 -1
- data/lib/ey-hmac/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0094fa18946db8e6cd7ea46ce5963a890ef3cc36
|
4
|
+
data.tar.gz: 11d3c418d5fc5443ff15f51c25d702a0cbda5269
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcc4602c4b046d925238fbb1d4e405275242bd32ab413f752ec96a042c51d5e9e759176b894f0d36f6ca86c6c798b370052c7dab0049d2aacecb4161f1cd6e3f
|
7
|
+
data.tar.gz: 8fef1ea990200f6646517d78a970ce26a061a17b4b4c5b00efba50ca5961efec993dc11381398d5cfb3736d7c39c91a3835c2197e749217e743ce5d9d67cc736
|
data/lib/ey-hmac/adapter.rb
CHANGED
@@ -12,6 +12,8 @@ class Ey::Hmac::Adapter
|
|
12
12
|
# @option options [Integer] :version signature version
|
13
13
|
# @option options [String] :authorization_header ('Authorization') Authorization header key.
|
14
14
|
# @option options [String] :server ('EyHmac') service name prefixed to {#authorization}. set to {#service}
|
15
|
+
# @option options [Symbol] :sign_with (:sha_256) outgoing signature digest algorithm. See {OpenSSL::Digest#new}
|
16
|
+
# @option options [Array] :accepted_digests ([:sha_256]) accepted incoming signature digest algorithm. See {OpenSSL::Digest#new}
|
15
17
|
def initialize(request, options={})
|
16
18
|
@request, @options = request, options
|
17
19
|
|
@@ -122,7 +124,7 @@ class Ey::Hmac::Adapter
|
|
122
124
|
calculated_signatures = self.accept_digests.map { |ad| signature(key_secret, ad) }
|
123
125
|
|
124
126
|
unless calculated_signatures.any? { |cs| secure_compare(signature_value, cs) }
|
125
|
-
raise(Ey::Hmac::SignatureMismatch, "Calculated
|
127
|
+
raise(Ey::Hmac::SignatureMismatch, "Calculated signature #{signature_value} does not match #{calculated_signatures.inspect} using #{canonicalize.inspect}")
|
126
128
|
end
|
127
129
|
true
|
128
130
|
end
|
data/lib/ey-hmac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ey-hmac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane & Jason Hansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|