omniauth-campus 7.5 → 7.6

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: 419ba5b08874ef9807c60e7a4b37de4aab56e758
4
- data.tar.gz: ef53b91460d166e9993fe5c03c022ef2f068742a
3
+ metadata.gz: a3334f2f47562a76b1cfd8e31082db11c348bef5
4
+ data.tar.gz: 9141bc4a5782fb41ff9c061c3e8c87a62f846fbb
5
5
  SHA512:
6
- metadata.gz: 273025b81987c8c04ced92971e160b00eca8a3f0e8f6c32e5b91a42befc4072bda829b67891ab7e8b3124639a753a058c1782d809e63d6e56734f5cb8335b4f9
7
- data.tar.gz: d590d8469587667d97d4cdaffcff51014c321b394ac28cb8c7e0fd6586dc6891b9fb450adc65f73deb4d5e45b789c8301c3b33dbc42b53998191d79571e96fc3
6
+ metadata.gz: c37783c0055e8b1a134008ed85498623dfe3d2558fcc7962a0243a2e608fcc5ecc88929a0a41e7ec395e8fcb885f8e1f4b1b428233df6ea39c03b2a75aaf9fb1
7
+ data.tar.gz: 982311cdf9e1665e240ed19a7002054ab93c1dee2e3aab2cee793a687a1c3100333e0545a4d6a53a3e7e80c0d9d01c4e4e362ba302ae8d660f8f063a4798bef5
Binary file
Binary file
@@ -1,92 +1,28 @@
1
1
  require 'omniauth-oauth'
2
2
  require 'multi_json'
3
- require 'openssl'
4
- #require 'omniauth/core'
5
- require 'uri'
6
- #require 'rack/utils'
7
3
 
8
4
  module OmniAuth
9
5
  module Strategies
10
- # Your code goes here...
11
- class Campus < OmniAuth::Strategies::OAuth
6
+ Class Campus < OmniAuth::Strategies::OAuth
7
+ option :name, :campus
12
8
 
9
+ option :client_options, {
10
+ :site => "http://dev-oauth-test.gotpantheon.com"
11
+ }
13
12
 
14
- #site: 'http://community3dev.devcloud.acquia-sites.com/api'
15
-
16
- args [:consumer_key, :consumer_secret]
17
- option :consumer_key, nil
18
- option :consumer_secret, nil
13
+ uid do
14
+ raw_info[0]['uid']
15
+ end
19
16
 
20
- option :client_options, {
21
- :site => "http://dev-oauth-test.gotpantheon.com",
22
- #:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil
23
- :request_token_path => '/oauth/request_token',
24
- :access_token_path => '/oauth/access_token',
25
- :authorize_path => '/oauth/authorize'
17
+ info do
18
+ {
19
+ :name => raw_info[0]['users_name'],
20
+ :email => raw_info[0]['users_mail']
26
21
  }
27
-
28
- option :name, "campus"
29
-
30
- attr_reader :access_token
31
- #option :client_options, {:authorize_path => '/oauth/authenticate'
32
- #:site => 'http://dev-oauth-test.gotpantheon.com/myawesomejson',
33
- #:proxy => ENV['http_proxy'] ? URI(ENV['http_proxy']) : nil}
34
-
35
-
36
- uid{raw_info[:uid]}
37
-
38
- info do {
39
- :name => raw_info['name'],
40
- :mail => raw_info['mail']
41
- }
42
- end
43
-
44
- extra do {
45
- 'raw_info' => raw_info
46
- }
47
- end
48
-
49
- def request_phase
50
- request_token = consumer.get_request_token(:oauth_callback => callback_url)
51
- session['oauth'] ||= {}
52
- session['oauth'][name.to_s] = {'callback_confirmed' => request_token.callback_confirmed?, 'request_token' => request_token.token, 'request_secret' => request_token.secret}
53
-
54
- if request_token.callback_confirmed?
55
- redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_consumer_key => consumer.key))
56
- else
57
- redirect request_token.authorize_url(options[:authorize_params].merge(:oauth_callback => callback_url, :oauth_consumer_key => consumer.key))
58
- end
59
-
60
- rescue ::Timeout::Error => e
61
- fail!(:timeout, e)
62
- rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
63
- fail!(:service_unavailable, e)
64
22
  end
65
23
 
66
- def raw_info
67
- #@raw_info ||= MultiJson.decode(access_token.get("#{options[:client_options][:site]}/myawesomejson/user/#{access_token.params[:uid]}?format=json").body)
68
- @raw_info ||= MultiJson.decode(access_token.get("http://dev-oauth-test.gotpantheon.com/myawesomejson/user?format=json").body)
69
- rescue ActiveSupport::JSON.parse_error
70
- Rails.logger.warn("Attempted to decode invalid JSON")
71
- rescue ::Errno::ETIMEDOUT
72
- raise ::Timeout::Error
73
- end
74
-
75
- #def request_phase
76
- # options[:authorize_params] = {:perms => options[:scope]} if options[:scope]
77
- # super
78
- #end
79
-
80
-
81
-
82
- #def auth_hash
83
- # OmniAuth::Utils.deep_merge(super(), {
84
- # 'uid' => @uid
85
- # })
86
- #end
87
-
88
-
24
+ def raw_info
25
+ @raw_info ||= MultiJson.decode(access_token.get("http://dev-oauth-test.gotpantheon.com/newauth/api/user_info.json").body)
26
+ end
89
27
  end
90
28
  end
91
- end
92
-
Binary file
@@ -1,6 +1,6 @@
1
1
  module Omniauth
2
2
  module Campus
3
- VERSION = "7.5"
3
+ VERSION = "7.6"
4
4
  end
5
5
  end
6
6
 
@@ -19,9 +19,12 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency 'rake', '~> 0'
23
- spec.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
24
- #spec.add_runtime_dependency 'oauth', '~> 0'
22
+ spec.add_development_dependency "rake"
23
+ #spec.add_runtime_dependency 'omniauth-oauth', '~> 1.0'
24
+ spec.add_runtime_dependency 'omniauth-oauth', '~> 1.1', '>= 1.1.1'
25
+ spec.add_runtime_dependency 'oauth'
26
+ #spec.add_dependency 'oauth2', '~> 0.8.0'
25
27
  spec.add_dependency 'faraday', ['>= 0.8', '<0.10']
26
28
  spec.add_dependency 'multi_json', '~> 1.3'
29
+ #spec.add_runtime_dependency 'zendesk_api', '> 0.2.2'
27
30
  end
metadata CHANGED
@@ -1,89 +1,109 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-campus
3
3
  version: !ruby/object:Gem::Version
4
- version: '7.5'
4
+ version: '7.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - johnvehr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-11 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: omniauth-oauth
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
47
+ version: '1.1'
48
+ - - '>='
49
+ - !ruby/object:Gem::Version
50
+ version: 1.1.1
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
- - - "~>"
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ version: '1.1'
58
+ - - '>='
53
59
  - !ruby/object:Gem::Version
54
- version: '1.0'
60
+ version: 1.1.1
61
+ - !ruby/object:Gem::Dependency
62
+ name: oauth
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - '>='
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: faraday
57
77
  requirement: !ruby/object:Gem::Requirement
58
78
  requirements:
59
- - - ">="
79
+ - - '>='
60
80
  - !ruby/object:Gem::Version
61
81
  version: '0.8'
62
- - - "<"
82
+ - - <
63
83
  - !ruby/object:Gem::Version
64
84
  version: '0.10'
65
85
  type: :runtime
66
86
  prerelease: false
67
87
  version_requirements: !ruby/object:Gem::Requirement
68
88
  requirements:
69
- - - ">="
89
+ - - '>='
70
90
  - !ruby/object:Gem::Version
71
91
  version: '0.8'
72
- - - "<"
92
+ - - <
73
93
  - !ruby/object:Gem::Version
74
94
  version: '0.10'
75
95
  - !ruby/object:Gem::Dependency
76
96
  name: multi_json
77
97
  requirement: !ruby/object:Gem::Requirement
78
98
  requirements:
79
- - - "~>"
99
+ - - ~>
80
100
  - !ruby/object:Gem::Version
81
101
  version: '1.3'
82
102
  type: :runtime
83
103
  prerelease: false
84
104
  version_requirements: !ruby/object:Gem::Requirement
85
105
  requirements:
86
- - - "~>"
106
+ - - ~>
87
107
  - !ruby/object:Gem::Version
88
108
  version: '1.3'
89
109
  description: Custom strategy gem for campus app
@@ -93,12 +113,12 @@ executables: []
93
113
  extensions: []
94
114
  extra_rdoc_files: []
95
115
  files:
96
- - ".Gemfile.swp"
97
- - ".LICENSE.txt.swp"
98
- - ".README.md.swp"
99
- - ".Rakefile.swp"
100
- - ".gitignore"
101
- - ".omniauth-campus.gemspec.swp"
116
+ - .Gemfile.swp
117
+ - .LICENSE.txt.swp
118
+ - .README.md.swp
119
+ - .Rakefile.swp
120
+ - .gitignore
121
+ - .omniauth-campus.gemspec.swp
102
122
  - Gemfile
103
123
  - LICENSE.txt
104
124
  - README.md
@@ -121,17 +141,17 @@ require_paths:
121
141
  - lib
122
142
  required_ruby_version: !ruby/object:Gem::Requirement
123
143
  requirements:
124
- - - ">="
144
+ - - '>='
125
145
  - !ruby/object:Gem::Version
126
146
  version: '0'
127
147
  required_rubygems_version: !ruby/object:Gem::Requirement
128
148
  requirements:
129
- - - ">="
149
+ - - '>='
130
150
  - !ruby/object:Gem::Version
131
151
  version: '0'
132
152
  requirements: []
133
153
  rubyforge_project:
134
- rubygems_version: 2.2.1
154
+ rubygems_version: 2.2.2
135
155
  signing_key:
136
156
  specification_version: 4
137
157
  summary: ''