omniauth-geekpark 0.2.0 → 0.2.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: b3e056f9fad34b96205bc0db48dbebbc38859207
4
- data.tar.gz: c55a0157df2f979353b6c9c2631b2b216b401bf7
3
+ metadata.gz: a7243dc2c492c7a98d0950cc0900cfc2793a10de
4
+ data.tar.gz: 36a747bece1db45a3babea4d55dea936f17803b9
5
5
  SHA512:
6
- metadata.gz: 196d15878dbf0c0aea49cd3c6c11e2c3487ca477d415e09744f915287c964ac32498566c0a7ae29e7736eecd40a9be02e98a14fa764d6cb8e928204813773ea9
7
- data.tar.gz: 5ea857a323b3248af357fcc94a9420ea373c7025197e4bc8c78960e990a53291205f63d4e70dce2945092c3bb94258b9c672443a08fa0982e7b85c061fbe3c21
6
+ metadata.gz: cecd4f0962dd5b233ae1278bf77e9199fd585d2f2c80e0bb49d4e88c3eb2845d9cf5ae5f13effdc039e3681f3d7083e96a27a8991dc04573982d93946a048eda
7
+ data.tar.gz: a8df5babd21c547f65a1617b877cb86f4d56955cf1f249021a54bfab7be7d833822e12d75a0ee4c85cac1ce54cd2b355f5cc1fcb7b5b540a7e978245871b4bd6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-geekpark (0.2.0)
4
+ omniauth-geekpark (0.2.1)
5
5
  omniauth (~> 1.0)
6
6
  omniauth-oauth2 (= 1.3.1)
7
7
 
@@ -35,7 +35,7 @@ GEM
35
35
  guard-compat (~> 1.1)
36
36
  rspec (>= 2.99.0, < 4.0)
37
37
  hashdiff (0.3.0)
38
- hashie (3.4.3)
38
+ hashie (3.4.4)
39
39
  json (1.8.3)
40
40
  jwt (1.5.1)
41
41
  listen (3.0.6)
@@ -43,7 +43,7 @@ GEM
43
43
  rb-inotify (>= 0.9.7)
44
44
  lumberjack (1.0.10)
45
45
  method_source (0.8.2)
46
- multi_json (1.11.2)
46
+ multi_json (1.12.0)
47
47
  multi_xml (0.5.5)
48
48
  multipart-post (2.0.0)
49
49
  nenv (0.3.0)
@@ -111,4 +111,4 @@ DEPENDENCIES
111
111
  webmock (~> 1.24, >= 1.24.2)
112
112
 
113
113
  BUNDLED WITH
114
- 1.11.2
114
+ 1.12.3
@@ -0,0 +1,36 @@
1
+ module OmniAuth
2
+ module Strategies
3
+ class Weibo < OmniAuth::Strategies::OAuth2
4
+ option :client_options, {
5
+ site: "https://api.weibo.com",
6
+ authorize_url: "/oauth2/authorize",
7
+ token_url: "/oauth2/access_token",
8
+ }
9
+
10
+ option :token_params, parse: :json
11
+
12
+ uid { raw_info['id'] }
13
+
14
+ info do
15
+ {
16
+ nickname: raw_info['screen_name'],
17
+ avatar: raw_info['avatar_large'],
18
+ bio: raw_info['description']
19
+ }
20
+ end
21
+
22
+ extra do { raw_info: raw_info } end
23
+
24
+ def raw_info
25
+ @uid ||= begin
26
+ access_token.options[:mode] = :query
27
+ access_token.get('/2/account/get_uid.json').parsed["uid"]
28
+ end
29
+
30
+ @raw_info ||= access_token.get('/2/users/show.json', params: {uid: @uid}).parsed
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ OmniAuth.config.add_camelization "weibo", "Weibo"
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module GeekPark
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -3,3 +3,4 @@ require 'omniauth-oauth2'
3
3
  require 'patch/omniauth-oauth2'
4
4
  require 'omniauth/strategies/geekpark'
5
5
  require 'omniauth/strategies/wechat'
6
+ require 'omniauth/strategies/weibo'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-geekpark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - HaoYunfei
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-04-13 00:00:00.000000000 Z
12
+ date: 2016-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
@@ -120,6 +120,7 @@ files:
120
120
  - lib/omniauth-geekpark/version.rb
121
121
  - lib/omniauth/strategies/geekpark.rb
122
122
  - lib/omniauth/strategies/wechat.rb
123
+ - lib/omniauth/strategies/weibo.rb
123
124
  - lib/patch/omniauth-oauth2.rb
124
125
  - omniauth-geekpark.gemspec
125
126
  homepage: https://github.com/GeekPark/omniauth-geekpark
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  version: '0'
143
144
  requirements: []
144
145
  rubyforge_project:
145
- rubygems_version: 2.6.3
146
+ rubygems_version: 2.5.1
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: OmniAuth strategies for GeekPark. Includes geekpark, weibo and wechat.