authlete 1.38.0 → 1.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/authlete.gemspec +1 -2
- data/lib/authlete/model/service.rb +7 -1
- data/lib/authlete/version.rb +1 -1
- metadata +7 -170
- data/test/authlete/model/request/test_authentication-callback-request.rb +0 -100
- data/test/authlete/model/request/test_authorization-fail-request.rb +0 -67
- data/test/authlete/model/request/test_authorization-issue-request.rb +0 -94
- data/test/authlete/model/request/test_authorization-request.rb +0 -57
- data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +0 -102
- data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +0 -71
- data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +0 -57
- data/test/authlete/model/request/test_backchannel-authentication-request.rb +0 -75
- data/test/authlete/model/request/test_client-authorization-delete-request.rb +0 -57
- data/test/authlete/model/request/test_client-authorization-get-list-request.rb +0 -71
- data/test/authlete/model/request/test_client-authorization-update-request.rb +0 -63
- data/test/authlete/model/request/test_client-registration-request.rb +0 -68
- data/test/authlete/model/request/test_device-authorization-request.rb +0 -75
- data/test/authlete/model/request/test_device-complete-request.rb +0 -102
- data/test/authlete/model/request/test_device-verification-request.rb +0 -57
- data/test/authlete/model/request/test_granted-scopes-request.rb +0 -57
- data/test/authlete/model/request/test_introspection-request.rb +0 -79
- data/test/authlete/model/request/test_pushed-auth-req-request.rb +0 -75
- data/test/authlete/model/request/test_revocation-request.rb +0 -67
- data/test/authlete/model/request/test_standard-introspection-request.rb +0 -57
- data/test/authlete/model/request/test_token-create-request.rb +0 -110
- data/test/authlete/model/request/test_token-fail-request.rb +0 -63
- data/test/authlete/model/request/test_token-issue-request.rb +0 -70
- data/test/authlete/model/request/test_token-request.rb +0 -94
- data/test/authlete/model/request/test_token-revoke-request.rb +0 -71
- data/test/authlete/model/request/test_token-update-request.rb +0 -82
- data/test/authlete/model/request/test_user-info-issue-request.rb +0 -67
- data/test/authlete/model/request/test_user-info-request.rb +0 -75
- data/test/authlete/model/response/test_access-token.rb +0 -101
- data/test/authlete/model/response/test_authorization-fail-response.rb +0 -68
- data/test/authlete/model/response/test_authorization-issue-response.rb +0 -92
- data/test/authlete/model/response/test_authorization-response.rb +0 -145
- data/test/authlete/model/response/test_authorized-client-list-response.rb +0 -83
- data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +0 -132
- data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +0 -68
- data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +0 -80
- data/test/authlete/model/response/test_backchannel-authentication-response.rb +0 -156
- data/test/authlete/model/response/test_client-list-response.rb +0 -79
- data/test/authlete/model/response/test_client-secret-refresh-response.rb +0 -68
- data/test/authlete/model/response/test_client-secret-update-response.rb +0 -68
- data/test/authlete/model/response/test_device-authorization-response.rb +0 -140
- data/test/authlete/model/response/test_device-complete-response.rb +0 -64
- data/test/authlete/model/response/test_device-verification-response.rb +0 -112
- data/test/authlete/model/response/test_granted-scopes-get-response.rb +0 -84
- data/test/authlete/model/response/test_introspection-response.rb +0 -127
- data/test/authlete/model/response/test_pushed-auth-req-response.rb +0 -76
- data/test/authlete/model/response/test_revocation-response.rb +0 -68
- data/test/authlete/model/response/test_service-list-response.rb +0 -72
- data/test/authlete/model/response/test_standard-introspection-response.rb +0 -68
- data/test/authlete/model/response/test_token-create-response.rb +0 -107
- data/test/authlete/model/response/test_token-fail-response.rb +0 -68
- data/test/authlete/model/response/test_token-issue-response.rb +0 -127
- data/test/authlete/model/response/test_token-list-response.rb +0 -84
- data/test/authlete/model/response/test_token-response.rb +0 -147
- data/test/authlete/model/response/test_token-revoke-response.rb +0 -63
- data/test/authlete/model/response/test_token-update-response.rb +0 -87
- data/test/authlete/model/response/test_user-info-issue-response.rb +0 -68
- data/test/authlete/model/response/test_user-info-response.rb +0 -107
- data/test/authlete/model/test_client-extension.rb +0 -98
- data/test/authlete/model/test_client.rb +0 -604
- data/test/authlete/model/test_hsk.rb +0 -108
- data/test/authlete/model/test_named-uri.rb +0 -83
- data/test/authlete/model/test_pair.rb +0 -83
- data/test/authlete/model/test_property.rb +0 -88
- data/test/authlete/model/test_result.rb +0 -68
- data/test/authlete/model/test_scope.rb +0 -104
- data/test/authlete/model/test_service-owner.rb +0 -80
- data/test/authlete/model/test_service.rb +0 -896
- data/test/authlete/model/test_sns-credentials.rb +0 -88
- data/test/authlete/model/test_tagged-value.rb +0 -83
- data/test/authlete/model/test_trust-anchor.rb +0 -84
- data/test/authlete/test_exception.rb +0 -70
- data/test/authlete/types/test_application-type.rb +0 -44
- data/test/authlete/types/test_client-auth-method.rb +0 -64
- data/test/authlete/types/test_delivery-mode.rb +0 -48
- data/test/authlete/types/test_grant-type.rb +0 -72
- data/test/authlete/types/test_jwealg.rb +0 -104
- data/test/authlete/types/test_jweenc.rb +0 -60
- data/test/authlete/types/test_jwsalg.rb +0 -96
- data/test/authlete/types/test_response-type.rb +0 -68
- data/test/authlete/types/test_subject-type.rb +0 -44
@@ -1,98 +0,0 @@
|
|
1
|
-
# :nodoc:
|
2
|
-
#
|
3
|
-
# Copyright (C) 2014-2020 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 ClientExtensionTest < Minitest::Test
|
24
|
-
REQUESTABLE_SCOPES = %w(<requestable-scope0> <requestable-scope1>)
|
25
|
-
REQUESTABLE_SCOPES_ENABLED = true
|
26
|
-
ACCESS_TOKEN_DURATION = 10000
|
27
|
-
REFRESH_TOKEN_DURATION = 10000
|
28
|
-
TOKEN_EXCHANGE_PERMITTED = false
|
29
|
-
|
30
|
-
|
31
|
-
def generate_json
|
32
|
-
return <<~JSON
|
33
|
-
{
|
34
|
-
"requestableScopes": [ "<requestable-scope0>", "<requestable-scope1>" ],
|
35
|
-
"requestableScopesEnabled": true,
|
36
|
-
"accessTokenDuration": 10000,
|
37
|
-
"refreshTokenDuration": 10000,
|
38
|
-
"tokenExchangePermitted": false
|
39
|
-
}
|
40
|
-
JSON
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
def generate_hash
|
45
|
-
{
|
46
|
-
requestableScopes: %w(<requestable-scope0> <requestable-scope1>),
|
47
|
-
requestableScopesEnabled: true,
|
48
|
-
accessTokenDuration: 10000,
|
49
|
-
refreshTokenDuration: 10000,
|
50
|
-
tokenExchangePermitted: false
|
51
|
-
}
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
def set_params(obj)
|
56
|
-
obj.requestable_scopes = REQUESTABLE_SCOPES
|
57
|
-
obj.requestable_scopes_enabled = REQUESTABLE_SCOPES_ENABLED
|
58
|
-
obj.access_token_duration = ACCESS_TOKEN_DURATION
|
59
|
-
obj.refresh_token_duration = REFRESH_TOKEN_DURATION
|
60
|
-
obj.token_exchange_permitted = TOKEN_EXCHANGE_PERMITTED
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
def match(obj)
|
65
|
-
assert_equal REQUESTABLE_SCOPES, obj.requestableScopes
|
66
|
-
assert_equal REQUESTABLE_SCOPES_ENABLED, obj.requestableScopesEnabled
|
67
|
-
assert_equal ACCESS_TOKEN_DURATION, obj.accessTokenDuration
|
68
|
-
assert_equal REFRESH_TOKEN_DURATION, obj.refreshTokenDuration
|
69
|
-
assert_equal TOKEN_EXCHANGE_PERMITTED, obj.tokenExchangePermitted
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
def test_from_json
|
74
|
-
jsn = generate_json
|
75
|
-
hsh = JSON.parse(jsn)
|
76
|
-
actual = Authlete::Model::ClientExtension.new(hsh)
|
77
|
-
|
78
|
-
match(actual)
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
def test_setters
|
83
|
-
actual = Authlete::Model::ClientExtension.new
|
84
|
-
set_params(actual)
|
85
|
-
|
86
|
-
match(actual)
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
def test_to_hash
|
91
|
-
obj = Authlete::Model::ClientExtension.new
|
92
|
-
set_params(obj)
|
93
|
-
actual = obj.to_hash
|
94
|
-
expected = generate_hash
|
95
|
-
|
96
|
-
assert_equal expected, actual
|
97
|
-
end
|
98
|
-
end
|