line-bot-api 1.23.0 → 1.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/line/bot/api/version.rb +1 -1
- data/lib/line/bot/client.rb +47 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6b6ba33d24c43ef8485e0b9de1a5a36b928ec5cc89a259cc813c0952ada238d
|
4
|
+
data.tar.gz: 2bc49b9ee22a628cc94abfe4193627fc44ca10b02acb03441febb41052d00597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29985c36fc9b6273acbaf53b78ace56a278f16db96c43696dbfb0163638f64c2c567693c127883d7e2bea31a9ea3576972d83c0a8252a0b474be2da50ffb69ef
|
7
|
+
data.tar.gz: 540067af91254691fe7affa878f5a6197aa33bb0ea1ece0ff11e70bd91c2ebf05c496f226454c304339292f9e1c91fcee34366fbbcb055ea00cbe7a133654937
|
data/lib/line/bot/api/version.rb
CHANGED
data/lib/line/bot/client.rb
CHANGED
@@ -145,6 +145,40 @@ module Line
|
|
145
145
|
post(oauth_endpoint, endpoint_path, payload, headers)
|
146
146
|
end
|
147
147
|
|
148
|
+
# Verify ID token
|
149
|
+
#
|
150
|
+
# @param id_token [String] ID token
|
151
|
+
# @param nonce [String] Expected nonce value. Use the nonce value provided in the authorization request. Omit if the nonce value was not specified in the authorization request.
|
152
|
+
# @param user_id [String] Expected user ID.
|
153
|
+
#
|
154
|
+
# @return [Net::HTTPResponse]
|
155
|
+
def verify_id_token(id_token, nonce: nil, user_id: nil)
|
156
|
+
channel_id_required
|
157
|
+
|
158
|
+
endpoint_path = '/oauth2/v2.1/verify'
|
159
|
+
payload = URI.encode_www_form({
|
160
|
+
client_id: channel_id,
|
161
|
+
id_token: id_token,
|
162
|
+
nonce: nonce,
|
163
|
+
user_id: user_id
|
164
|
+
}.compact)
|
165
|
+
headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
|
166
|
+
post(oauth_endpoint, endpoint_path, payload, headers)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Verify access token v2.1
|
170
|
+
#
|
171
|
+
# @param access_token [String] access token
|
172
|
+
#
|
173
|
+
# @return [Net::HTTPResponse]
|
174
|
+
def verify_access_token(access_token)
|
175
|
+
payload = URI.encode_www_form(
|
176
|
+
access_token: access_token
|
177
|
+
)
|
178
|
+
endpoint_path = "/oauth2/v2.1/verify?#{payload}"
|
179
|
+
get(oauth_endpoint, endpoint_path)
|
180
|
+
end
|
181
|
+
|
148
182
|
# Get all valid channel access token key IDs v2.1
|
149
183
|
#
|
150
184
|
# @param jwt [String]
|
@@ -161,6 +195,19 @@ module Line
|
|
161
195
|
get(oauth_endpoint, endpoint_path, headers)
|
162
196
|
end
|
163
197
|
|
198
|
+
# Get user profile by access token
|
199
|
+
#
|
200
|
+
# @param access_token [String] access token
|
201
|
+
#
|
202
|
+
# @return [Net::HTTPResponse]
|
203
|
+
def get_profile_by_access_token(access_token)
|
204
|
+
headers = {
|
205
|
+
"Authorization" => "Bearer #{access_token}",
|
206
|
+
}
|
207
|
+
endpoint_path = "/v2/profile"
|
208
|
+
get(oauth_endpoint, endpoint_path, headers)
|
209
|
+
end
|
210
|
+
|
164
211
|
# Push messages to a user using user_id.
|
165
212
|
#
|
166
213
|
# @param user_id [String] User Id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-bot-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.24.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LINE Corporation
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -106,7 +106,7 @@ homepage: https://github.com/line/line-bot-sdk-ruby
|
|
106
106
|
licenses:
|
107
107
|
- Apache-2.0
|
108
108
|
metadata: {}
|
109
|
-
post_install_message:
|
109
|
+
post_install_message:
|
110
110
|
rdoc_options: []
|
111
111
|
require_paths:
|
112
112
|
- lib
|
@@ -121,8 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
125
|
-
signing_key:
|
124
|
+
rubygems_version: 3.3.3
|
125
|
+
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: SDK of the LINE Messaging API
|
128
128
|
test_files: []
|