authlete 1.34.0 → 1.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/authlete/api.rb +6 -0
- data/lib/authlete/model/request/token-revoke-request.rb +57 -0
- data/lib/authlete/model/response/token-revoke-response.rb +41 -0
- data/lib/authlete/model/service.rb +1 -1
- data/lib/authlete/version.rb +2 -2
- data/lib/authlete.rb +2 -0
- data/test/authlete/model/request/test_token-revoke-request.rb +71 -0
- data/test/authlete/model/response/test_token-revoke-response.rb +63 -0
- metadata +13 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8d2d718ade1062d97b214ec5debb8123396f5c38
|
4
|
+
data.tar.gz: f75fc7fb060845b2b393b6a4138f399560d3036b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e75dede652c6cfc02c515c92cc967ff8dd0b7a48592d4d5cd60c279aae948490dafb1cd14da0489d7054093a5d3901fbe9ee651fde956a9c884bf225c1fcf97
|
7
|
+
data.tar.gz: 0d29883ffc6278a070d77c0ae86b8ed2c46c4c15be7640de9212805b71a5aa2636926c661e43b015ff55dbf3d02b6eed018e66487f8f9bbb82ab22877cac11e6
|
data/lib/authlete/api.rb
CHANGED
@@ -217,6 +217,12 @@ module Authlete
|
|
217
217
|
Authlete::Model::Response::TokenFailResponse.new(hash)
|
218
218
|
end
|
219
219
|
|
220
|
+
def token_revoke(request)
|
221
|
+
hash = call_api_json_service("/api/auth/token/revoke", to_hash(request))
|
222
|
+
|
223
|
+
Authlete::Model::Response::TokenRevokeResponse.new(hash)
|
224
|
+
end
|
225
|
+
|
220
226
|
def service_create(service)
|
221
227
|
hash = call_api_json_service_owner("/api/service/create", to_hash(service))
|
222
228
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2024 Authlete, Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
module Authlete
|
19
|
+
module Model
|
20
|
+
module Request
|
21
|
+
class TokenRevokeRequest < Authlete::Model::Request::Base
|
22
|
+
|
23
|
+
attr_accessor :accessTokenIdentifier
|
24
|
+
alias_method :access_token_identifier, :accessTokenIdentifier
|
25
|
+
alias_method :access_token_identifier=, :accessTokenIdentifier=
|
26
|
+
|
27
|
+
attr_accessor :clientIdentifier
|
28
|
+
alias_method :client_identifier, :clientIdentifier
|
29
|
+
alias_method :client_identifier=, :clientIdentifier=
|
30
|
+
|
31
|
+
attr_accessor :refreshTokenIdentifier
|
32
|
+
alias_method :refresh_token_identifier, :refreshTokenIdentifier
|
33
|
+
alias_method :refresh_token_identifier=, :refreshTokenIdentifier=
|
34
|
+
|
35
|
+
attr_accessor :subject
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def defaults
|
40
|
+
{
|
41
|
+
accessTokenIdentifier: nil,
|
42
|
+
clientIdentifier: nil,
|
43
|
+
refreshTokenIdentifier: nil,
|
44
|
+
subject: nil
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
def set_params(hash)
|
49
|
+
@accessTokenIdentifier = hash[:accessTokenIdentifier]
|
50
|
+
@clientIdentifier = hash[:clientIdentifier]
|
51
|
+
@refreshTokenIdentifier = hash[:refreshTokenIdentifier]
|
52
|
+
@subject = hash[:subject]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2024 Authlete, Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
module Authlete
|
19
|
+
module Model
|
20
|
+
module Response
|
21
|
+
class TokenRevokeResponse < Authlete::Model::Result
|
22
|
+
|
23
|
+
attr_accessor :count
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def defaults
|
28
|
+
super.merge(
|
29
|
+
count: nil
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_params(hash)
|
34
|
+
super(hash)
|
35
|
+
|
36
|
+
@count = hash[:count]
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/authlete/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# :nodoc:
|
2
2
|
#
|
3
|
-
# Copyright (C) 2014-
|
3
|
+
# Copyright (C) 2014-2024 Authlete, Inc.
|
4
4
|
#
|
5
5
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
6
|
# you may not use this file except in compliance with the License.
|
@@ -16,5 +16,5 @@
|
|
16
16
|
|
17
17
|
|
18
18
|
module Authlete
|
19
|
-
VERSION = "1.
|
19
|
+
VERSION = "1.36.0"
|
20
20
|
end
|
data/lib/authlete.rb
CHANGED
@@ -70,6 +70,7 @@ module Authlete
|
|
70
70
|
autoload :TokenFailRequest, 'authlete/model/request/token-fail-request'
|
71
71
|
autoload :TokenIssueRequest, 'authlete/model/request/token-issue-request'
|
72
72
|
autoload :TokenRequest, 'authlete/model/request/token-request'
|
73
|
+
autoload :TokenRevokeRequest, 'authlete/model/request/token-revoke-request'
|
73
74
|
autoload :TokenUpdateRequest, 'authlete/model/request/token-update-request'
|
74
75
|
autoload :UserInfoIssueRequest, 'authlete/model/request/user-info-issue-request'
|
75
76
|
autoload :UserInfoRequest, 'authlete/model/request/user-info-request'
|
@@ -106,6 +107,7 @@ module Authlete
|
|
106
107
|
autoload :TokenIssueResponse, 'authlete/model/response/token-issue-response'
|
107
108
|
autoload :TokenListResponse, 'authlete/model/response/token-list-response'
|
108
109
|
autoload :TokenResponse, 'authlete/model/response/token-response'
|
110
|
+
autoload :TokenRevokeResponse, 'authlete/model/response/token-revoke-response'
|
109
111
|
autoload :TokenUpdateResponse, 'authlete/model/response/token-update-response'
|
110
112
|
autoload :UserInfoIssueResponse, 'authlete/model/response/user-info-issue-response'
|
111
113
|
autoload :UserInfoResponse, 'authlete/model/response/user-info-response'
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2024 Authlete, Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
require 'authlete'
|
19
|
+
require 'minitest/autorun'
|
20
|
+
|
21
|
+
|
22
|
+
class TokenRevokeRequestTest < Minitest::Test
|
23
|
+
ACCESS_TOKEN_IDENTIFIER = '<access-token-identifier>'
|
24
|
+
CLIENT_IDENTIFIER = '<client-identifier>'
|
25
|
+
REFRESH_TOKEN_IDENTIFIER = '<refresh-token-identifier>'
|
26
|
+
SUBJECT = '<subject>'
|
27
|
+
|
28
|
+
|
29
|
+
def set_params(obj)
|
30
|
+
obj.access_token_identifier = ACCESS_TOKEN_IDENTIFIER
|
31
|
+
obj.client_identifier = CLIENT_IDENTIFIER
|
32
|
+
obj.refresh_token_identifier = REFRESH_TOKEN_IDENTIFIER
|
33
|
+
obj.subject = SUBJECT
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def match(obj)
|
38
|
+
assert_equal ACCESS_TOKEN_IDENTIFIER, obj.access_token_identifier
|
39
|
+
assert_equal CLIENT_IDENTIFIER, obj.client_identifier
|
40
|
+
assert_equal REFRESH_TOKEN_IDENTIFIER, obj.refresh_token_identifier
|
41
|
+
assert_equal SUBJECT, obj.subject
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
def generate_hash
|
46
|
+
{
|
47
|
+
accessTokenIdentifier: '<access-token-identifier>',
|
48
|
+
clientIdentifier: '<client-identifier>',
|
49
|
+
refreshTokenIentifier: '<refresh-token-identifier>',
|
50
|
+
subject: '<subject>'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def test_setters
|
56
|
+
actual = Authlete::Model::Request::TokenRevokeRequest.new
|
57
|
+
set_params(actual)
|
58
|
+
|
59
|
+
match(actual)
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
def test_to_hash
|
64
|
+
obj = Authlete::Model::Request::TokenRevokeRequest.new
|
65
|
+
set_params(obj)
|
66
|
+
actual = obj.to_hash
|
67
|
+
expected = generate_hash
|
68
|
+
|
69
|
+
assert_equal expected, actual
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2024 Authlete, Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
require 'authlete'
|
19
|
+
require 'json'
|
20
|
+
require 'minitest/autorun'
|
21
|
+
|
22
|
+
|
23
|
+
class TokenRevokeResponseTest < Minitest::Test
|
24
|
+
RESULT_CODE = '<result-code>'
|
25
|
+
RESULT_MESSAGE = '<result-message>'
|
26
|
+
COUNT = 1
|
27
|
+
|
28
|
+
def generate_json
|
29
|
+
return <<~JSON
|
30
|
+
{
|
31
|
+
"resultCode": "<result-code>",
|
32
|
+
"resultMessage": "<result-message>",
|
33
|
+
"count": 1
|
34
|
+
}
|
35
|
+
JSON
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
def match(obj)
|
40
|
+
assert_equal RESULT_CODE, obj.resultCode
|
41
|
+
assert_equal RESULT_MESSAGE, obj.resultMessage
|
42
|
+
assert_equal COUNT, obj.count
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def test_from_json
|
47
|
+
jsn = generate_json
|
48
|
+
hsh = JSON.parse(jsn)
|
49
|
+
actual = Authlete::Model::Response::TokenRevokeResponse.new(hsh)
|
50
|
+
|
51
|
+
match(actual)
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
def test_setters
|
56
|
+
actual = Authlete::Model::Response::TokenRevokeResponse.new
|
57
|
+
actual.result_code = RESULT_CODE
|
58
|
+
actual.result_message = RESULT_MESSAGE
|
59
|
+
actual.count = COUNT
|
60
|
+
|
61
|
+
match(actual)
|
62
|
+
end
|
63
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
8
8
|
- Hideki Ikeda
|
9
9
|
- Seth Wright
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -108,6 +108,7 @@ files:
|
|
108
108
|
- lib/authlete/model/request/token-fail-request.rb
|
109
109
|
- lib/authlete/model/request/token-issue-request.rb
|
110
110
|
- lib/authlete/model/request/token-request.rb
|
111
|
+
- lib/authlete/model/request/token-revoke-request.rb
|
111
112
|
- lib/authlete/model/request/token-update-request.rb
|
112
113
|
- lib/authlete/model/request/user-info-issue-request.rb
|
113
114
|
- lib/authlete/model/request/user-info-request.rb
|
@@ -140,6 +141,7 @@ files:
|
|
140
141
|
- lib/authlete/model/response/token-issue-response.rb
|
141
142
|
- lib/authlete/model/response/token-list-response.rb
|
142
143
|
- lib/authlete/model/response/token-response.rb
|
144
|
+
- lib/authlete/model/response/token-revoke-response.rb
|
143
145
|
- lib/authlete/model/response/token-update-response.rb
|
144
146
|
- lib/authlete/model/response/user-info-issue-response.rb
|
145
147
|
- lib/authlete/model/response/user-info-response.rb
|
@@ -186,6 +188,7 @@ files:
|
|
186
188
|
- test/authlete/model/request/test_token-fail-request.rb
|
187
189
|
- test/authlete/model/request/test_token-issue-request.rb
|
188
190
|
- test/authlete/model/request/test_token-request.rb
|
191
|
+
- test/authlete/model/request/test_token-revoke-request.rb
|
189
192
|
- test/authlete/model/request/test_token-update-request.rb
|
190
193
|
- test/authlete/model/request/test_user-info-issue-request.rb
|
191
194
|
- test/authlete/model/request/test_user-info-request.rb
|
@@ -215,6 +218,7 @@ files:
|
|
215
218
|
- test/authlete/model/response/test_token-issue-response.rb
|
216
219
|
- test/authlete/model/response/test_token-list-response.rb
|
217
220
|
- test/authlete/model/response/test_token-response.rb
|
221
|
+
- test/authlete/model/response/test_token-revoke-response.rb
|
218
222
|
- test/authlete/model/response/test_token-update-response.rb
|
219
223
|
- test/authlete/model/response/test_user-info-issue-response.rb
|
220
224
|
- test/authlete/model/response/test_user-info-response.rb
|
@@ -245,7 +249,7 @@ homepage: https://www.authlete.com/
|
|
245
249
|
licenses:
|
246
250
|
- Apache License, Version 2.0
|
247
251
|
metadata: {}
|
248
|
-
post_install_message:
|
252
|
+
post_install_message:
|
249
253
|
rdoc_options: []
|
250
254
|
require_paths:
|
251
255
|
- lib
|
@@ -260,8 +264,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
260
264
|
- !ruby/object:Gem::Version
|
261
265
|
version: '0'
|
262
266
|
requirements: []
|
263
|
-
|
264
|
-
|
267
|
+
rubyforge_project:
|
268
|
+
rubygems_version: 2.6.8
|
269
|
+
signing_key:
|
265
270
|
specification_version: 4
|
266
271
|
summary: A library for Authlete Web APIs
|
267
272
|
test_files:
|
@@ -289,6 +294,7 @@ test_files:
|
|
289
294
|
- test/authlete/model/request/test_token-fail-request.rb
|
290
295
|
- test/authlete/model/request/test_token-issue-request.rb
|
291
296
|
- test/authlete/model/request/test_token-request.rb
|
297
|
+
- test/authlete/model/request/test_token-revoke-request.rb
|
292
298
|
- test/authlete/model/request/test_token-update-request.rb
|
293
299
|
- test/authlete/model/request/test_user-info-issue-request.rb
|
294
300
|
- test/authlete/model/request/test_user-info-request.rb
|
@@ -318,6 +324,7 @@ test_files:
|
|
318
324
|
- test/authlete/model/response/test_token-issue-response.rb
|
319
325
|
- test/authlete/model/response/test_token-list-response.rb
|
320
326
|
- test/authlete/model/response/test_token-response.rb
|
327
|
+
- test/authlete/model/response/test_token-revoke-response.rb
|
321
328
|
- test/authlete/model/response/test_token-update-response.rb
|
322
329
|
- test/authlete/model/response/test_user-info-issue-response.rb
|
323
330
|
- test/authlete/model/response/test_user-info-response.rb
|