omniauth-qiita-v2 1.3.0 → 1.5.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: e4b679036f385e173638ff9b2c05b906946cf0e79fcc5f3a232a085ff76a890c
4
- data.tar.gz: 5156daff4789f75345af5632eb5c85b1147d64239cec829706f7e2ae2c6bd640
3
+ metadata.gz: c253e29b58bb3a597346d4da851a821c71a1041173cdfbb96a0efce01751bcc0
4
+ data.tar.gz: 485521c8d1f867898debde9d721073e359a2eb9ee717df308314c7b144ff2f7b
5
5
  SHA512:
6
- metadata.gz: 7e5c405f33c342c64b33f9308f4877cac8bbf4326ae406d2882a9f3636667e95ac06da9f089e690220e6c8c36cbc3d81e4e54970a079ad82ac9780b81184e4dc
7
- data.tar.gz: a9707c87a683b4401775ee78392faf871f437f94775d091377e055af4cfb834d93ef6a3610f899841e22d61f8762f4dde88e1f1d516254d4bc412bb794534e53
6
+ metadata.gz: 5d2afac7e28f52e709e42fb0495980d090d457e2c9fbd71f9d872e581bd0811dc2fe0fc76c14f01f5e6599434bba64de0fa0b00e1b6c6debc8a6137ea12038cd
7
+ data.tar.gz: 32cbbda374538770de74d2397c773a474bc56a0a78c6a81d68d82832d024f267c2aa8e2d25e5ead37b902658215ac2f0814b1d1430d069f1e5a8f11f8514c197
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.5.0] - 2025-08-02
4
+
5
+ - Refactor: Refactor `OmniAuth::Strategies::QiitaV2#authorize_params`
6
+ - Test: Update test
7
+ - Other: Update .rubocop.yml
8
+
9
+ ## [1.4.0] - 2025-07-20
10
+
11
+ - New: Update auth hash
12
+ - Test: Update test
13
+ - Other: Update README.md
14
+
3
15
  ## [1.3.0] - 2025-07-17
4
16
 
5
17
  - New: Remove oauth2 dependency
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.3.0'
5
+ VERSION = '1.5.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
@@ -71,11 +67,11 @@ module OmniAuth
71
67
 
72
68
  def authorize_params
73
69
  super.tap do |params|
74
- ['scope', 'state'].each do |v|
75
- params[v.to_sym] = request.params[v] if request.params[v]
70
+ options[:authorize_options].each do |key|
71
+ params[key] = request.params[key.to_s] unless empty?(request.params[key.to_s])
76
72
  end
77
73
  params[:scope] ||= DEFAULT_SCOPE
78
- session['omniauth.state'] = params[:state] if params[:state]
74
+ session['omniauth.state'] = params[:state] unless empty?(params[:state])
79
75
  end
80
76
  end
81
77
 
@@ -90,10 +86,14 @@ module OmniAuth
90
86
  def prune!(hash)
91
87
  hash.delete_if do |_, value|
92
88
  prune!(value) if value.is_a?(Hash)
93
- value.nil? || (value.respond_to?(:empty?) && value.empty?)
89
+ empty?(value)
94
90
  end
95
91
  end
96
92
 
93
+ def empty?(value)
94
+ value.nil? || (value.respond_to?(:empty?) && value.empty?)
95
+ end
96
+
97
97
  def base_params
98
98
  {
99
99
  headers: {
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.3.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro
@@ -52,15 +52,15 @@ files:
52
52
  - lib/omniauth-qiita-v2.rb
53
53
  - lib/omniauth/qiita_v2/version.rb
54
54
  - lib/omniauth/strategies/qiita_v2.rb
55
- homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.3.0
55
+ homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.5.0
56
56
  licenses:
57
57
  - MIT
58
58
  metadata:
59
- homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.3.0
60
- source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.3.0
61
- changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.3.0/CHANGELOG.md
59
+ homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.5.0
60
+ source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.5.0
61
+ changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.5.0/CHANGELOG.md
62
62
  bug_tracker_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/issues
63
- documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.3.0
63
+ documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.5.0
64
64
  funding_uri: https://patreon.com/CadenzaTech
65
65
  rubygems_mfa_required: 'true'
66
66
  rdoc_options: []