omniauth-qiita-v2 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 723fdf502a13203f171cbaf1d228a9e0774d2cb157af55113f6b5c768a3e03b5
4
- data.tar.gz: 0422fb4583d5e2a5e05cedd0bf89c707e2e4534492df962a9c2db01b7441542f
3
+ metadata.gz: 156f9db42cf98499927fb2937b60c5c78e95b4dd11a9ecee5ff256feb3d4458a
4
+ data.tar.gz: 9a1dfa80180f02ba9269c614ca0d68f2625a24e7daf3856cc73e4669cbb1f00b
5
5
  SHA512:
6
- metadata.gz: a8f5231dec93c33da16d4a561f4009ad7a6ee71e9dddf1723930dbb844d6981299b0e58c764454f8cf4c3d406669520bab1ad607d54e5f0d43d67bcdb1607b75
7
- data.tar.gz: d45af3b090a655e8de37e8099a983a72c243a4198de6cdd753013e274189f0f400a1a3ee8d3174163bd249225609e3fd1792c8fdd647f460775b04b1d7d2c53f
6
+ metadata.gz: 39c180fa2fe009f29eed214a0cd4fd0ff5e2e54ba6ff3c8dbc6d00e1f7065e74ecfe36d1786e408c1b53f0dc9d493dad793cb543441e45ebd427ce0bd764d9ca
7
+ data.tar.gz: 0e03a55f4e588a4ea3414026f254a3a081d6dd6a65658825602c6ee2d18fddc0eab91847fa04509b5e6d2d152127c88d365fa188e3e791c795e092d6b2b2050e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.0] - 2025-07-20
4
+
5
+ - New: Update auth hash
6
+ - Test: Update test
7
+ - Other: Update README.md
8
+
9
+ ## [1.3.0] - 2025-07-17
10
+
11
+ - New: Remove oauth2 dependency
12
+ - Refactor: Refactoring
13
+ - Test: Update test
14
+
3
15
  ## [1.2.0] - 2025-07-16
4
16
 
5
17
  - Refactor: Refactoring
data/README.md CHANGED
@@ -88,24 +88,20 @@ After successful authentication, the auth hash will be available in `request.env
88
88
  ```ruby
89
89
  {
90
90
  provider: 'qiita_v2',
91
- uid: 'example_qiita_user_john_doe',
91
+ uid: 'qiita',
92
92
  info: {
93
- name: 'John Doe',
94
- nickname: 'example_qiita_user_john_doe',
95
- permanent_id: 1234567890,
96
- image: 'https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/...',
97
- description: 'Software Developer',
93
+ name: 'Qiita キータ',
94
+ nickname: 'qiita',
95
+ image: 'https://s3-ap-northeast-1.amazonaws.com/qiita-image-store/0/88/ccf90b557a406157dbb9d2d7e543dae384dbb561/large.png?1575443439',
96
+ description: 'Hello, world.',
98
97
  location: 'Tokyo, Japan',
99
- organization: 'Example Inc.',
100
- followees_count: 50,
101
- followers_count: 100,
102
- items_count: 30,
103
98
  urls: {
104
- website: 'https://example.com',
105
- twitter: 'https://x.com/...',
106
- facebook: 'https://facebook.com/...',
107
- linkedin: 'https://www.linkedin.com/in/...',
108
- github: 'https://github.com/...'
99
+ website: 'https://qiita.com',
100
+ x: 'https://x.com/qiita',
101
+ twitter: 'https://twitter.com/qiita',
102
+ facebook: 'https://facebook.com/qiita',
103
+ linkedin: 'https://www.linkedin.com/in/qiita',
104
+ github: 'https://github.com/qiitan'
109
105
  }
110
106
  },
111
107
  credentials: {
@@ -114,7 +110,24 @@ After successful authentication, the auth hash will be available in `request.env
114
110
  },
115
111
  extra: {
116
112
  raw_info: {
117
- # Complete user information from Qiita API
113
+ 'description' => 'Hello, world.',
114
+ 'facebook_id' => 'qiita',
115
+ 'followees_count' => 100,
116
+ 'followers_count' => 200,
117
+ 'github_login_name' => 'qiitan',
118
+ 'id' => 'qiita',
119
+ 'items_count' => 300,
120
+ 'linkedin_id' => 'qiita',
121
+ 'location' => 'Tokyo, Japan',
122
+ 'name' => 'Qiita キータ',
123
+ 'organization' => 'Qiita Inc.',
124
+ 'permanent_id' => 1,
125
+ 'profile_image_url' => 'https://s3-ap-northeast-1.amazonaws.com/qiita-image-store/0/88/ccf90b557a406157dbb9d2d7e543dae384dbb561/large.png?1575443439',
126
+ 'team_only' => false,
127
+ 'twitter_screen_name' => 'qiita',
128
+ 'website_url' => 'https://qiita.com',
129
+ 'image_monthly_upload_limit' => 1048576,
130
+ 'image_monthly_upload_remaining' => 524288
118
131
  }
119
132
  }
120
133
  }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAuth
4
4
  module QiitaV2
5
- VERSION = '1.2.0'
5
+ VERSION = '1.4.0'
6
6
  end
7
7
  end
@@ -28,18 +28,14 @@ module OmniAuth
28
28
  prune!({
29
29
  name: raw_info['name'],
30
30
  nickname: raw_info['id'],
31
- permanent_id: raw_info['permanent_id'],
32
31
  email: nil, # Qiita API v2 does not provide email
33
32
  description: raw_info['description'],
34
33
  image: raw_info['profile_image_url'],
35
34
  location: raw_info['location'],
36
- organization: raw_info['organization'],
37
- followees_count: raw_info['followees_count'],
38
- followers_count: raw_info['followers_count'],
39
- items_count: raw_info['items_count'],
40
35
  urls: {
41
36
  website: raw_info['website_url'],
42
- twitter: raw_info['twitter_screen_name'] ? "https://x.com/#{raw_info['twitter_screen_name']}" : nil,
37
+ x: raw_info['twitter_screen_name'] ? "https://x.com/#{raw_info['twitter_screen_name']}" : nil,
38
+ twitter: raw_info['twitter_screen_name'] ? "https://twitter.com/#{raw_info['twitter_screen_name']}" : nil,
43
39
  facebook: raw_info['facebook_id'] ? "https://facebook.com/#{raw_info['facebook_id']}" : nil,
44
40
  linkedin: raw_info['linkedin_id'] ? "https://www.linkedin.com/in/#{raw_info['linkedin_id']}" : nil,
45
41
  github: raw_info['github_login_name'] ? "https://github.com/#{raw_info['github_login_name']}" : nil
@@ -61,31 +57,8 @@ module OmniAuth
61
57
  hash
62
58
  end
63
59
 
64
- def raw_info # rubocop:disable Metrics/AbcSize
65
- @raw_info ||= begin
66
- access_token.get(USER_INFO_URL).parsed || {}
67
- rescue ::OAuth2::Error => e
68
- case e.response.status
69
- when 401
70
- log :error, '401 Unauthorized - Invalid access token'
71
- raise ::OmniAuth::NoSessionError.new('Invalid access token')
72
- when 403
73
- log :error, '403 Forbidden - Insufficient permissions'
74
- raise ::OmniAuth::NoSessionError.new('Insufficient permissions')
75
- when 404
76
- log :error, '404 Not Found - User not found'
77
- raise ::OmniAuth::NoSessionError.new('User not found')
78
- else
79
- log :error, "API Error: #{e.response.status} - #{e.message}"
80
- raise e
81
- end
82
- rescue ::Errno::ETIMEDOUT
83
- log :error, 'Connection timed out'
84
- raise ::OmniAuth::NoSessionError.new('Connection timed out')
85
- rescue ::SocketError => e
86
- log :error, "Network error: #{e.message}"
87
- raise ::OmniAuth::NoSessionError.new('Network error')
88
- end
60
+ def raw_info
61
+ @raw_info ||= access_token.get(USER_INFO_URL).parsed
89
62
  end
90
63
 
91
64
  def callback_url
@@ -105,7 +78,7 @@ module OmniAuth
105
78
  protected
106
79
 
107
80
  def build_access_token
108
- client.get_token(base_params.merge(token_params_from_options).merge(deep_symbolize(options.auth_token_params)))
81
+ client.get_token(base_params.merge(token_params.to_hash(symbolize_keys: true)).merge(deep_symbolize(options.auth_token_params)))
109
82
  end
110
83
 
111
84
  private
@@ -128,17 +101,6 @@ module OmniAuth
128
101
  code: request.params['code']
129
102
  }
130
103
  end
131
-
132
- def token_params_from_options
133
- return {} unless options.token_params
134
-
135
- if options.token_params.is_a?(Hash)
136
- params = options.token_params
137
- else
138
- params = options.token_params.to_hash
139
- end
140
- params.transform_keys(&:to_sym)
141
- end
142
104
  end
143
105
  end
144
106
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-qiita-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro
@@ -9,20 +9,6 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: oauth2
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: '2.0'
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - "~>"
24
- - !ruby/object:Gem::Version
25
- version: '2.0'
26
12
  - !ruby/object:Gem::Dependency
27
13
  name: omniauth
28
14
  requirement: !ruby/object:Gem::Requirement
@@ -66,15 +52,15 @@ files:
66
52
  - lib/omniauth-qiita-v2.rb
67
53
  - lib/omniauth/qiita_v2/version.rb
68
54
  - lib/omniauth/strategies/qiita_v2.rb
69
- homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
55
+ homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.4.0
70
56
  licenses:
71
57
  - MIT
72
58
  metadata:
73
- homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
74
- source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.2.0
75
- changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.2.0/CHANGELOG.md
59
+ homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.4.0
60
+ source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.4.0
61
+ changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.4.0/CHANGELOG.md
76
62
  bug_tracker_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/issues
77
- documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.2.0
63
+ documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.4.0
78
64
  funding_uri: https://patreon.com/CadenzaTech
79
65
  rubygems_mfa_required: 'true'
80
66
  rdoc_options: []