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 +4 -4
- data/README.md +1 -1
- data/lib/omniauth/strategies/signnow.rb +6 -5
- data/lib/omniauth-signnow/version.rb +1 -1
- data/spec/omniauth/strategies/signnow_spec.rb +4 -4
- 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: cfd9d3db9153ba00398c8a80601f13c659da3bd5
|
4
|
+
data.tar.gz: fd3b9c1cc04098707a6652c7e53eb7a2a0c15cb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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['
|
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
|
-
|
58
|
-
|
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
|
@@ -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.
|
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
|
113
|
-
expect(subject.send(:auth_options)[:headers][
|
114
|
-
expect(subject.send(:auth_options)[: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}/)
|
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.
|
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-
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|