authmac 1.0.3 → 1.0.4
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/CHANGELOG.md +6 -2
- data/lib/authmac/hmac_checker.rb +4 -0
- data/lib/authmac/version.rb +1 -1
- data/spec/authmac/hmac_checker_spec.rb +12 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90105d4d9efdd25c6c15260a90dce6a807b82413
|
4
|
+
data.tar.gz: 713c8d6560a0f879af99e5ed4d3ba1152fe2dcba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac599e7b2238e0b346b8bb3b5dbc4bf2e7243c464a0b4fab90325264f10a4edf4e49ff39162d1c5b28bebafd9b475293936d79cebe5cbda02d22a58dfa2ac12
|
7
|
+
data.tar.gz: 86f1fa8713e62e8d5ac15cb395bde67d750daddbd339c1b544e5527ce259799ba0d2a53e1b36f618bfbdb4a60d56891113fab3201f34a4334e44395453f856ff
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
## Version 1.0.
|
1
|
+
## Version 1.0.4 / 2014-06-20
|
2
|
+
|
3
|
+
* Added HmacChecker#with_signature which returns the given hash with the HMAC merged in.
|
4
|
+
|
5
|
+
## Version 1.0.3 / 2014-05-12
|
2
6
|
|
3
7
|
* Raise error when insecure key is being used, assuming all keys are hex values (see rfc2104)
|
4
|
-
* Only compatible with ruby 2
|
8
|
+
* Only compatible with ruby 2
|
data/lib/authmac/hmac_checker.rb
CHANGED
data/lib/authmac/version.rb
CHANGED
@@ -47,6 +47,18 @@ module Authmac
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
describe '#with_signature' do
|
51
|
+
it 'adds the hmac' do
|
52
|
+
hash = {second: 'another', first: 'parameter'}
|
53
|
+
expect(checker.with_signature(hash)).to eq(hash.merge(hmac: hmacify('parameter|another')))
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'allows overriding the key to place the hmac under' do
|
57
|
+
hash = {second: 'another', first: 'parameter'}
|
58
|
+
expect(checker.with_signature(hash, :sig)).to eq(hash.merge(sig: hmacify('parameter|another')))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
50
62
|
describe '#calculate_hmac' do
|
51
63
|
it 'generates hmac' do
|
52
64
|
expect(checker.sign(second: 'another', first: 'parameter')).to eq(hmacify('parameter|another'))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authmac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marten Veldthuis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
requirements: []
|
89
89
|
rubyforge_project:
|
90
|
-
rubygems_version: 2.2.
|
90
|
+
rubygems_version: 2.2.2
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: Single Sign-On implementation based on HMAC.
|
@@ -95,3 +95,4 @@ test_files:
|
|
95
95
|
- spec/authmac/hmac_checker_spec.rb
|
96
96
|
- spec/authmac/timestamp_checker_spec.rb
|
97
97
|
- spec/authmac_spec.rb
|
98
|
+
has_rdoc:
|