omniauth-draugiem 1.0.1 → 1.1.0

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: be3b7eb114c496930595e2fb4840a13633fde8b3
4
- data.tar.gz: 1cf0b1bedfccec6c192e77d8e61cab3edf10ed3f
3
+ metadata.gz: 9d02ed02020c52e2ea3b3c72d4da019fb376e80c
4
+ data.tar.gz: e1cd42b6b53304e7f1bef69868e36271d16ef85f
5
5
  SHA512:
6
- metadata.gz: 0c4e85ad7699f5ae228a282fc79799d138fba55175060c5f0a80d0910c95887a6007f4aaeb1e93f02dcff32e823d487e8a12fdd0d99f9c1b394617f8926b317f
7
- data.tar.gz: 49438ac6f4d96de1be1df729a8fd39c1be5a4d97e9388cb4bb11d86e9c3a189a2dafa2b8118ad0fb0cc94031156849d7aa44d226441584354508363eb1d5c65c
6
+ metadata.gz: cd4dece0b7d1639a749038b7ee97268483ceba61ce7bfce56c6270d23c027e571fc11c35cc98c3b9a5b43415089a4e395a43d67efc3f8004bd222c8b35ae2d8f
7
+ data.tar.gz: 7a3a07f2e66543e63df8c7af00ea0cf9bae66a55d33066208b6d67d3925be9c54c5dfb05c2ce07ccb596586fcb1236fff28c7337fca3c96c4a39f02d8efeb08f
@@ -1,5 +1,11 @@
1
+ sudo: false
2
+ language: ruby
3
+ cache: bundler
4
+
1
5
  rvm:
2
- - 2.0.0
3
6
  - 2.1.0
4
- - rbx
7
+ - 2.2.4
8
+ - 2.3.3
5
9
  - ruby-head
10
+
11
+ before_install: gem install bundler -v 1.14.6
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Omniauth::Draugiem
1
+ # OmniAuth Draugiem
2
2
 
3
- [![Continuous Integration status](https://secure.travis-ci.org/mak-it/omniauth-draugiem.png)](http://travis-ci.org/mak-it/omniauth-draugiem)
3
+ [![Continuous Integration status](https://secure.travis-ci.org/mak-it/omniauth-draugiem.svg)](http://travis-ci.org/mak-it/omniauth-draugiem)
4
4
 
5
5
  OmniAuth strategy for authenticating to draugiem.lv
6
6
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Draugiem
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -35,12 +35,12 @@ module OmniAuth
35
35
  :hash => Digest::MD5.hexdigest("#{options.api_key}#{callback_url}")
36
36
  }
37
37
  query_string = params.collect{ |key,value| "#{key}=#{Rack::Utils.escape(value)}" }.join('&')
38
- redirect "http://api.draugiem.lv/authorize/?#{query_string}"
38
+ redirect "https://api.draugiem.lv/authorize/?#{query_string}"
39
39
  end
40
40
 
41
41
  def callback_phase
42
42
  if request.params['dr_auth_status'] == 'ok' && request.params['dr_auth_code']
43
- response = RestClient.get('http://api.draugiem.lv/json/', { :params => draugiem_authorize_params(request.params['dr_auth_code']) })
43
+ response = RestClient.get('https://api.draugiem.lv/json/', { :params => draugiem_authorize_params(request.params['dr_auth_code']) })
44
44
  auth = MultiJson.decode(response.to_s)
45
45
  unless auth['error']
46
46
  @auth_data = auth
@@ -20,10 +20,11 @@ Gem::Specification.new do |s|
20
20
 
21
21
  s.add_runtime_dependency "omniauth", "~> 1.0"
22
22
  s.add_runtime_dependency "rest-client", "~> 1.6"
23
+ s.add_runtime_dependency "multi_json", "~> 1.0"
23
24
 
24
25
  s.add_development_dependency "bundler", "~> 1.5"
25
26
  s.add_development_dependency "rake"
26
- s.add_development_dependency "rspec"
27
+ s.add_development_dependency "rspec", "~> 3.0"
27
28
  s.add_development_dependency "simplecov"
28
29
  s.add_development_dependency "rack-test"
29
30
  s.add_development_dependency 'webmock'
@@ -9,19 +9,19 @@ describe 'OmniAuth::Strategies::Draugiem', :type => :strategy do
9
9
  end
10
10
 
11
11
  it 'should initialize with api key and app id' do
12
- lambda{OmniAuth::Strategies::Draugiem.new({},'123','abc')}.should_not raise_error
12
+ expect { OmniAuth::Strategies::Draugiem.new({},'123','abc') }.to_not raise_error
13
13
  end
14
14
 
15
15
  describe '/auth/draugiem' do
16
16
 
17
17
  it 'should redirect to api.draugiem.lv' do
18
18
  get '/auth/draugiem'
19
- last_response.should be_redirect
20
- last_response.headers['Location'].should match %r{http://api\.draugiem\.lv/authorize/}
19
+ expect(last_response).to be_redirect
20
+ expect(last_response.headers['Location']).to match %r{https://api\.draugiem\.lv/authorize/}
21
21
  end
22
22
 
23
23
  it 'should gather user data after success authorization' do
24
- stub_request(:get, "http://api.draugiem.lv/json/?action=authorize&app=abc&code=123456").
24
+ stub_request(:get, "https://api.draugiem.lv/json/?action=authorize&app=abc&code=123456").
25
25
  to_return(:body => MultiJson.encode({
26
26
  'apikey'=>"123456789",
27
27
  'uid'=>"100",
@@ -35,17 +35,17 @@ describe 'OmniAuth::Strategies::Draugiem', :type => :strategy do
35
35
  'place'=>"Durbe",
36
36
  'age'=>"false",
37
37
  'adult'=>"1",
38
- 'img'=>"http://4.bp.blogspot.com/_ZmXOoYjxXog/Sg2jby1RFSI/AAAAAAAAE_Q/1LpfjimAz50/s400/JohnnyBravo3.gif",
38
+ 'img'=>"https://4.bp.blogspot.com/_ZmXOoYjxXog/Sg2jby1RFSI/AAAAAAAAE_Q/1LpfjimAz50/s400/JohnnyBravo3.gif",
39
39
  'sex'=>"M"
40
40
  }
41
41
  }
42
42
  }))
43
43
  get '/auth/draugiem/callback?dr_auth_status=ok&dr_auth_code=123456'
44
44
 
45
- last_request.env['omniauth.auth']['credentials']['apikey'].should == "123456789"
46
- last_request.env['omniauth.auth']['info']['location'].should == "Durbe"
47
- last_request.env['omniauth.auth']['info']['age'].should be_nil
48
- last_request.env['omniauth.auth']['info']['adult'].should be_true
45
+ expect(last_request.env['omniauth.auth']['credentials']['apikey']).to eq "123456789"
46
+ expect(last_request.env['omniauth.auth']['info']['location']).to eq "Durbe"
47
+ expect(last_request.env['omniauth.auth']['info']['age']).to be nil
48
+ expect(last_request.env['omniauth.auth']['info']['adult']).to be true
49
49
  end
50
50
  end
51
51
  end
@@ -1,5 +1,8 @@
1
1
  require 'simplecov'
2
- SimpleCov.start
2
+ SimpleCov.start do
3
+ add_filter '/vendor/bundle/'
4
+ end
5
+
3
6
  require 'rspec'
4
7
  require 'rack/test'
5
8
  require 'webmock/rspec'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-draugiem
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgars Beigarts
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-11 00:00:00.000000000 Z
12
+ date: 2017-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -39,6 +39,20 @@ dependencies:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.6'
42
+ - !ruby/object:Gem::Dependency
43
+ name: multi_json
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '1.0'
42
56
  - !ruby/object:Gem::Dependency
43
57
  name: bundler
44
58
  requirement: !ruby/object:Gem::Requirement
@@ -71,16 +85,16 @@ dependencies:
71
85
  name: rspec
72
86
  requirement: !ruby/object:Gem::Requirement
73
87
  requirements:
74
- - - ">="
88
+ - - "~>"
75
89
  - !ruby/object:Gem::Version
76
- version: '0'
90
+ version: '3.0'
77
91
  type: :development
78
92
  prerelease: false
79
93
  version_requirements: !ruby/object:Gem::Requirement
80
94
  requirements:
81
- - - ">="
95
+ - - "~>"
82
96
  - !ruby/object:Gem::Version
83
- version: '0'
97
+ version: '3.0'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: simplecov
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
177
  version: '0'
164
178
  requirements: []
165
179
  rubyforge_project:
166
- rubygems_version: 2.2.0.rc.1
180
+ rubygems_version: 2.6.8
167
181
  signing_key:
168
182
  specification_version: 4
169
183
  summary: Draugiem.lv authentication strategy for OmniAuth