http_signatures 0.2.0 → 0.2.2

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: e7081d201a0f52168e49d42043f5a2dfd792b1e6
4
- data.tar.gz: 51fd29fdd9c4c20f09d4fbcfb2bf012ed36739bb
3
+ metadata.gz: d136cb544dc8b6205a43355d1e53bf2b54048516
4
+ data.tar.gz: 4d38e02586fb55893520c2c3f053326e74314082
5
5
  SHA512:
6
- metadata.gz: bac9b3f9a8b8e2f5583c5d4e02fada9053c516a0df7fce6909c065c064c2489ea3662fb11eb3a6fc827f7c2a9f5386ec4ce0a03b915ca76bfce55a5c09aad47b
7
- data.tar.gz: 0ce9bee030d5f433ed3391b420be018b59983b01c5d2ba384ba2f60ce966662b3a4533726da02927ae13422cacd58e4b9c8b0edfa894e4cb627690494716b885
6
+ metadata.gz: 380b2d510876617ed8d3a59aaeb3d8c76e7b9f6539713ebb942d220f853c3fbb47377a439d02a369ec7e14b51d5d56942a724393e376120d0e5457d7280e26be
7
+ data.tar.gz: 0f182c9d26ebf56596c84f9b6d9c7fdc1a848a6f6ddb8af4ebc974cee52d973106ba983fa61322ff304927dba7af5e878ad117e271c3e2c1009db61296ce96fa
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.1
4
+ install: bundle install
5
+ script: rspec
data/README.md CHANGED
@@ -10,6 +10,8 @@ See also:
10
10
 
11
11
  ## Usage
12
12
 
13
+ Add [`http_signatures`][gem] to your `Gemfile`.
14
+
13
15
  Configure a context with your algorithm, keys, headers to sign. In Rails,
14
16
  this is best placed in an initializer.
15
17
 
@@ -73,3 +75,4 @@ Pull Requests are welcome.
73
75
 
74
76
 
75
77
  [draft03]: http://tools.ietf.org/html/draft-cavage-http-signatures-03
78
+ [gem]: http://rubygems.org/gems/http_signatures
@@ -9,7 +9,7 @@ module HttpSignatures
9
9
  end
10
10
 
11
11
  def to_str
12
- @algorithm.sign(@key.secret, signing_string)
12
+ @algorithm.sign(@key.secret, signing_string.to_str)
13
13
  end
14
14
 
15
15
  private
@@ -18,7 +18,7 @@ module HttpSignatures
18
18
  SigningString.new(
19
19
  header_list: @header_list,
20
20
  message: @message,
21
- ).to_str
21
+ )
22
22
  end
23
23
 
24
24
  end
@@ -26,7 +26,7 @@ module HttpSignatures
26
26
  end
27
27
 
28
28
  def signature_base64
29
- Base64.strict_encode64(@signature)
29
+ Base64.strict_encode64(@signature.to_str)
30
30
  end
31
31
 
32
32
  end
@@ -23,7 +23,7 @@ module HttpSignatures
23
23
  key: @key,
24
24
  algorithm: @algorithm,
25
25
  header_list: @header_list,
26
- signature: signature(message).to_str,
26
+ signature: signature(message),
27
27
  )
28
28
  end
29
29
 
@@ -1,3 +1,3 @@
1
1
  module HttpSignatures
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -9,10 +9,10 @@ RSpec.describe HttpSignatures::SignatureParameters do
9
9
  )
10
10
  end
11
11
 
12
- let(:key) { double("Key", id: "pda") }
13
- let(:algorithm) { double("Algorithm", name: "hmac-test") }
14
- let(:header_list) { double("HeaderList", to_str: "a b c") }
15
- let(:signature) { "sigstring" }
12
+ let(:key) { instance_double("HttpSignatures::Key", id: "pda") }
13
+ let(:algorithm) { instance_double("HttpSignatures::Algorithm::Hmac", name: "hmac-test") }
14
+ let(:header_list) { instance_double("HttpSignatures::HeaderList", to_str: "a b c") }
15
+ let(:signature) { instance_double("HttpSignatures::Signature", to_str: "sigstring") }
16
16
 
17
17
  describe "#to_str" do
18
18
  it "builds parameters into string" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_signatures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Annesley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-01 00:00:00.000000000 Z
11
+ date: 2014-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
+ - ".travis.yml"
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md