omniauth-qiita-v2 0.0.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +2 -0
- data/lib/omniauth/qiita_v2/version.rb +1 -1
- data/lib/omniauth/strategies/qiita_v2.rb +21 -7
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 424b52c57a9f6b4c14c26c7a79ed09d330c051c17886e8d74da66b16b6c2ff42
|
4
|
+
data.tar.gz: 4de61e6df80dc4eb7f8fb0c68874334103edcc3bc89374e29649a50724d9fb60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e03046a56547011c65d3dd0e63158e0a5ac8ad41102bb8f5375fe58f60593640f625b252921ba5a07d16788f707f289e3216880417a69602e21d9238df6869ce
|
7
|
+
data.tar.gz: '04533491a11893817248515f945e15df810dba5bf6cdb76b41322a8cbdce801d2d2d128318f5d2a70c04f395584033c59b212e8fed8391e4bf24d9812f990ce6'
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.1.0] - 2025-07-15
|
4
|
+
|
5
|
+
- New: Add `permanent_id` and `organization` to auth hash
|
6
|
+
- Test: Update test
|
7
|
+
- Other: Update README.md
|
8
|
+
|
9
|
+
## [1.0.0] - 2025-07-15
|
10
|
+
|
11
|
+
- New: Use pessimistic versioning and add oauth2 dependency
|
12
|
+
- Fix: Fix `OmniAuth::Strategies::QiitaV2#build_access_token`
|
13
|
+
- Test: Update test
|
14
|
+
|
3
15
|
## [0.0.0] - 2025-07-13
|
4
16
|
|
5
17
|
- Initial release
|
data/README.md
CHANGED
@@ -92,9 +92,11 @@ After successful authentication, the auth hash will be available in `request.env
|
|
92
92
|
info: {
|
93
93
|
name: 'John Doe',
|
94
94
|
nickname: 'example_qiita_user_john_doe',
|
95
|
+
permanent_id: 1234567890,
|
95
96
|
image: 'https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/...',
|
96
97
|
description: 'Software Developer',
|
97
98
|
location: 'Tokyo, Japan',
|
99
|
+
organization: 'Example Inc.',
|
98
100
|
followees_count: 50,
|
99
101
|
followers_count: 100,
|
100
102
|
items_count: 30,
|
@@ -28,10 +28,12 @@ module OmniAuth
|
|
28
28
|
prune!({
|
29
29
|
name: raw_info['name'],
|
30
30
|
nickname: raw_info['id'],
|
31
|
+
permanent_id: raw_info['permanent_id'],
|
31
32
|
email: nil, # Qiita API v2 does not provide email
|
32
33
|
description: raw_info['description'],
|
33
34
|
image: raw_info['profile_image_url'],
|
34
35
|
location: raw_info['location'],
|
36
|
+
organization: raw_info['organization'],
|
35
37
|
followees_count: raw_info['followees_count'],
|
36
38
|
followers_count: raw_info['followers_count'],
|
37
39
|
items_count: raw_info['items_count'],
|
@@ -110,13 +112,7 @@ module OmniAuth
|
|
110
112
|
end
|
111
113
|
|
112
114
|
def build_access_token
|
113
|
-
|
114
|
-
token_params = {
|
115
|
-
redirect_uri: callback_url,
|
116
|
-
client_id: options.client_id,
|
117
|
-
client_secret: options.client_secret
|
118
|
-
}.merge(token_params_from_options)
|
119
|
-
client.auth_code.get_token(verifier, token_params, deep_symbolize(options.auth_token_params))
|
115
|
+
client.get_token(access_token_params)
|
120
116
|
rescue ::OAuth2::Error => e
|
121
117
|
log :error, "Failed to build access token: #{e.message}"
|
122
118
|
fail!(:invalid_credentials, e)
|
@@ -125,6 +121,24 @@ module OmniAuth
|
|
125
121
|
fail!(:timeout, e)
|
126
122
|
end
|
127
123
|
|
124
|
+
def access_token_params
|
125
|
+
base_params
|
126
|
+
.merge(token_params_from_options)
|
127
|
+
.merge(deep_symbolize(options.auth_token_params))
|
128
|
+
end
|
129
|
+
|
130
|
+
def base_params
|
131
|
+
{
|
132
|
+
headers: {
|
133
|
+
'Content-Type' => 'application/json'
|
134
|
+
},
|
135
|
+
redirect_uri: callback_url,
|
136
|
+
client_id: options.client_id,
|
137
|
+
client_secret: options.client_secret,
|
138
|
+
code: request.params['code']
|
139
|
+
}
|
140
|
+
end
|
141
|
+
|
128
142
|
def token_params_from_options
|
129
143
|
return {} unless options.token_params
|
130
144
|
|
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:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro
|
@@ -9,32 +9,46 @@ 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'
|
12
26
|
- !ruby/object:Gem::Dependency
|
13
27
|
name: omniauth
|
14
28
|
requirement: !ruby/object:Gem::Requirement
|
15
29
|
requirements:
|
16
|
-
- - "
|
30
|
+
- - "~>"
|
17
31
|
- !ruby/object:Gem::Version
|
18
32
|
version: '2.0'
|
19
33
|
type: :runtime
|
20
34
|
prerelease: false
|
21
35
|
version_requirements: !ruby/object:Gem::Requirement
|
22
36
|
requirements:
|
23
|
-
- - "
|
37
|
+
- - "~>"
|
24
38
|
- !ruby/object:Gem::Version
|
25
39
|
version: '2.0'
|
26
40
|
- !ruby/object:Gem::Dependency
|
27
41
|
name: omniauth-oauth2
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|
29
43
|
requirements:
|
30
|
-
- - "
|
44
|
+
- - "~>"
|
31
45
|
- !ruby/object:Gem::Version
|
32
46
|
version: '1.8'
|
33
47
|
type: :runtime
|
34
48
|
prerelease: false
|
35
49
|
version_requirements: !ruby/object:Gem::Requirement
|
36
50
|
requirements:
|
37
|
-
- - "
|
51
|
+
- - "~>"
|
38
52
|
- !ruby/object:Gem::Version
|
39
53
|
version: '1.8'
|
40
54
|
description: Qiita strategy for OmniAuth
|
@@ -52,15 +66,15 @@ files:
|
|
52
66
|
- lib/omniauth-qiita-v2.rb
|
53
67
|
- lib/omniauth/qiita_v2/version.rb
|
54
68
|
- lib/omniauth/strategies/qiita_v2.rb
|
55
|
-
homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/
|
69
|
+
homepage: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
|
56
70
|
licenses:
|
57
71
|
- MIT
|
58
72
|
metadata:
|
59
|
-
homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/
|
60
|
-
source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/
|
61
|
-
changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/
|
73
|
+
homepage_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
|
74
|
+
source_code_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/tree/v1.1.0
|
75
|
+
changelog_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/blob/v1.1.0/CHANGELOG.md
|
62
76
|
bug_tracker_uri: https://github.com/cadenza-tech/omniauth-qiita-v2/issues
|
63
|
-
documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/
|
77
|
+
documentation_uri: https://rubydoc.info/gems/omniauth-qiita-v2/1.1.0
|
64
78
|
funding_uri: https://patreon.com/CadenzaTech
|
65
79
|
rubygems_mfa_required: 'true'
|
66
80
|
rdoc_options: []
|