omniauth-signnow 0.5.0 → 0.5.1

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: 7a37c1eef09087180fed82d643241ae5cc961a28
4
- data.tar.gz: 0ecf07e019ec47656c71a36c015d755b88fa1808
3
+ metadata.gz: cfd9d3db9153ba00398c8a80601f13c659da3bd5
4
+ data.tar.gz: fd3b9c1cc04098707a6652c7e53eb7a2a0c15cb7
5
5
  SHA512:
6
- metadata.gz: 707645d365fb1760bd0ee0ca1cbbf66373b8e8ee78abd6a7a1e075b6347fa8cf07c0a4094ad31cff4696374b69797a4a05c31056d767cff311ada1e99b28f1ff
7
- data.tar.gz: db1d0716d7367dae52ddecff3631ac9c3bc889ddaccc3f1bd3aedda9bfa3edcb5320daf296e3e0bddcf00a379bb76de726d74f6e4a93ac533f8810dc02eb9b51
6
+ metadata.gz: a9c78f06a020078278def775f235b5d5fdf9605891765be0c013634135116a86e64ee5fec32f9091ef2f6a54a47cc7fe6b39b542f0373cb401f41b2dc3fb2d73
7
+ data.tar.gz: 8ebd4dd14d5b9ea3aa0fac9818954ad7d280aa8f1b5f8889c4480a4d6b2d20943c614e955260fc39df4748860be4f97f33cf9d983c4378f3b3032e7519228d3d
data/README.md CHANGED
@@ -21,7 +21,7 @@ Here's an example for adding the middleware to a Rails app in `config/initialize
21
21
 
22
22
  ```ruby
23
23
  Rails.application.config.middleware.use OmniAuth::Builder do
24
- provider :signnow, ENV['SIGNNOW_APP_KEY'], ENV['SIGNNOW_APP_SECRET']
24
+ provider :signnow, ENV['SIGNNOW_APP_ID'], ENV['SIGNNOW_APP_SECRET']
25
25
  end
26
26
  ```
27
27
 
@@ -53,11 +53,12 @@ module OmniAuth
53
53
  end
54
54
 
55
55
  def auth_options
56
- {
57
- :headers => {
58
- 'Authorization' => "Basic #{Base64.encode64(client.id+':'+client.secret).gsub(/[\n=]/,'')}"
59
- }
60
- }
56
+ { headers: { Authorization: "Basic #{encoded_credentials}" } }
57
+ end
58
+
59
+ def encoded_credentials
60
+ return unless client and client.id and client.secret
61
+ Base64.strict_encode64( client.id + ':' + client.secret)
61
62
  end
62
63
  end
63
64
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Signnow
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
@@ -101,7 +101,7 @@ describe OmniAuth::Strategies::Signnow do
101
101
 
102
102
  describe '#auth_options' do
103
103
  let(:base64_client_key) {
104
- Base64.encode64(subject.client.id + ':' + subject.client.secret).gsub(/[\n=]/,'')
104
+ Base64.strict_encode64(subject.client.id + ':' + subject.client.secret)
105
105
  }
106
106
  it 'is protected' do
107
107
  expect(subject.auth_options).to raise_error(NoMethodError)
@@ -109,9 +109,9 @@ describe OmniAuth::Strategies::Signnow do
109
109
  it 'returns a hash with the Autorization header' do
110
110
  expect(subject.send(:auth_options).class).to eql(Hash)
111
111
  expect(subject.send(:auth_options)).to include(:headers)
112
- expect(subject.send(:auth_options)[:headers]).to include('Authorization')
113
- expect(subject.send(:auth_options)[:headers]['Authorization']).to match(/Basic/)
114
- expect(subject.send(:auth_options)[:headers]['Authorization']).to match(/#{base64_client_key}/)
112
+ expect(subject.send(:auth_options)[:headers]).to include :Authorization
113
+ expect(subject.send(:auth_options)[:headers][:Authorization]).to match(/Basic/)
114
+ expect(subject.send(:auth_options)[:headers][:Authorization]).to match(/#{base64_client_key}/)
115
115
  end
116
116
  end
117
117
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-signnow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andres Bravo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-13 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth