line-bot-api 1.23.0 → 1.24.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: 17ed6a316ad332e424e59aa498c8e9ee3bc7062204f191ea3b78e44f74a623b0
4
- data.tar.gz: 3a9cc6bbf3cbf658685873f4ea92c501cda4d73d6b6f969ec1620af4d34322ba
3
+ metadata.gz: e6b6ba33d24c43ef8485e0b9de1a5a36b928ec5cc89a259cc813c0952ada238d
4
+ data.tar.gz: 2bc49b9ee22a628cc94abfe4193627fc44ca10b02acb03441febb41052d00597
5
5
  SHA512:
6
- metadata.gz: 264355c41cc59a4063284d83902639df915df5dfa82b9787d1a4a973dfe4af2d729c171428c12b013e9f87ca6b667e1f8f0c41de5b93843a37040cafb1ea7f54
7
- data.tar.gz: '08ef6e828069cf6a8d971450f054fc8c4a662b6244da697138cb33305b38e0a6711e0e75d82fccb9574f88b86e9f7bb8cf7cd13e247bab53c612c989572efc55'
6
+ metadata.gz: 29985c36fc9b6273acbaf53b78ace56a278f16db96c43696dbfb0163638f64c2c567693c127883d7e2bea31a9ea3576972d83c0a8252a0b474be2da50ffb69ef
7
+ data.tar.gz: 540067af91254691fe7affa878f5a6197aa33bb0ea1ece0ff11e70bd91c2ebf05c496f226454c304339292f9e1c91fcee34366fbbcb055ea00cbe7a133654937
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.23.0"
18
+ VERSION = "1.24.0"
19
19
  end
20
20
  end
21
21
  end
@@ -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.23.0
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-01-27 00:00:00.000000000 Z
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.1.6
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: []