authlete 1.35.0 → 1.37.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/lib/authlete/api.rb +6 -0
- data/lib/authlete/model/client.rb +30 -1
- 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/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 +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: def1fd8a82bc7e26be3fc77869f7a7357dd4f0b7
|
4
|
+
data.tar.gz: db03af1401c26b3d45006d33fb65d44c34e4624d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bad4c25c7259b81e9ef737d07e525fba926950760e5faf284908e7211d7fa7ab76d90e45e83a47dc6c3f5580b8b5752bf1baa41176d7db3c1be5eaf080a6eba7
|
7
|
+
data.tar.gz: c435d8b3575a1c5efd20a0c5fb8b4e17b436ecc7d33ffa6fd705874a1885808e524d023dd93992914234978e3e361154617d14351b5a57074694fb4a3686af69
|
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
|
|
@@ -314,7 +314,7 @@ module Authlete
|
|
314
314
|
|
315
315
|
attr_accessor :singleAccessTokenPerSubject
|
316
316
|
alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
|
317
|
-
alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
|
317
|
+
alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
|
318
318
|
|
319
319
|
attr_accessor :pkceRequired
|
320
320
|
alias_method :pkce_required, :pkceRequired
|
@@ -336,6 +336,25 @@ module Authlete
|
|
336
336
|
alias_method :dpop_required, :dpopRequired
|
337
337
|
alias_method :dpop_required=, :dpopRequired=
|
338
338
|
|
339
|
+
attr_accessor :locked
|
340
|
+
|
341
|
+
# This is required for backward compatibility.
|
342
|
+
attr_accessor :sectorIdentifier
|
343
|
+
alias_method :sector_identifier, :sectorIdentifier
|
344
|
+
alias_method :sector_identifier=, :sectorIdentifier=
|
345
|
+
|
346
|
+
attr_accessor :rsRequestSigned
|
347
|
+
alias_method :rs_request_signed, :rsRequestSigned
|
348
|
+
alias_method :rs_request_signed=, :rsRequestSigned=
|
349
|
+
|
350
|
+
attr_accessor :trustChainExpiresAt
|
351
|
+
alias_method :trust_chain_expires_at, :trustChainExpiresAt
|
352
|
+
alias_method :trust_chain_expires_at=, :trustChainExpiresAt=
|
353
|
+
|
354
|
+
attr_accessor :trustChainUpdatedAt
|
355
|
+
alias_method :trust_chain_updated_at, :trustChainUpdatedAt
|
356
|
+
alias_method :trust_chain_updated_at=, :trustChainUpdatedAt=
|
357
|
+
|
339
358
|
private
|
340
359
|
|
341
360
|
def defaults
|
@@ -422,6 +441,11 @@ module Authlete
|
|
422
441
|
automaticallyRegistered: false,
|
423
442
|
explicitlyRegistered: false,
|
424
443
|
dpopRequired: false,
|
444
|
+
locked: false,
|
445
|
+
sectorIdentifier: nil,
|
446
|
+
rsRequestSigned: false,
|
447
|
+
trustChainExpiresAt: 0,
|
448
|
+
trustChainUpdatedAt: 0
|
425
449
|
}
|
426
450
|
end
|
427
451
|
|
@@ -508,6 +532,11 @@ module Authlete
|
|
508
532
|
@automaticallyRegistered = hash[:automaticallyRegistered]
|
509
533
|
@explicitlyRegistered = hash[:explicitlyRegistered]
|
510
534
|
@dpopRequired = hash[:dpopRequired]
|
535
|
+
@locked = hash[:locked]
|
536
|
+
@sectorIdentifier = hash[:sectorIdentifier]
|
537
|
+
@rsRequestSigned = hash[:rsRequestSigned]
|
538
|
+
@trustChainExpiresAt = hash[:trustChainExpiresAt]
|
539
|
+
@trustChainUpdatedAt = hash[:trustChainUpdatedAt]
|
511
540
|
end
|
512
541
|
|
513
542
|
def to_hash_value(key, var)
|
@@ -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.37.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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authlete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-01-30 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
|
@@ -290,6 +294,7 @@ test_files:
|
|
290
294
|
- test/authlete/model/request/test_token-fail-request.rb
|
291
295
|
- test/authlete/model/request/test_token-issue-request.rb
|
292
296
|
- test/authlete/model/request/test_token-request.rb
|
297
|
+
- test/authlete/model/request/test_token-revoke-request.rb
|
293
298
|
- test/authlete/model/request/test_token-update-request.rb
|
294
299
|
- test/authlete/model/request/test_user-info-issue-request.rb
|
295
300
|
- test/authlete/model/request/test_user-info-request.rb
|
@@ -319,6 +324,7 @@ test_files:
|
|
319
324
|
- test/authlete/model/response/test_token-issue-response.rb
|
320
325
|
- test/authlete/model/response/test_token-list-response.rb
|
321
326
|
- test/authlete/model/response/test_token-response.rb
|
327
|
+
- test/authlete/model/response/test_token-revoke-response.rb
|
322
328
|
- test/authlete/model/response/test_token-update-response.rb
|
323
329
|
- test/authlete/model/response/test_user-info-issue-response.rb
|
324
330
|
- test/authlete/model/response/test_user-info-response.rb
|