authlete 1.26.1 → 1.28.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/authlete.gemspec +1 -1
- data/lib/authlete/model/client.rb +131 -1
- data/lib/authlete/model/service.rb +7 -1
- data/lib/authlete/types/application-type.rb +27 -0
- data/lib/authlete/types/client-auth-method.rb +32 -0
- data/lib/authlete/types/constant-utility.rb +34 -0
- data/lib/authlete/types/delivery-mode.rb +28 -0
- data/lib/authlete/types/grant-type.rb +34 -0
- data/lib/authlete/types/jwealg.rb +42 -0
- data/lib/authlete/types/jweenc.rb +31 -0
- data/lib/authlete/types/jwsalg.rb +40 -0
- data/lib/authlete/types/response-type.rb +33 -0
- data/lib/authlete/types/subject-type.rb +27 -0
- data/lib/authlete/version.rb +2 -2
- data/lib/authlete.rb +14 -1
- data/test/authlete/model/test_client.rb +94 -7
- data/test/authlete/model/test_service.rb +8 -3
- data/test/authlete/types/test_application-type.rb +44 -0
- data/test/authlete/types/test_client-auth-method.rb +64 -0
- data/test/authlete/types/test_delivery-mode.rb +48 -0
- data/test/authlete/types/test_grant-type.rb +72 -0
- data/test/authlete/types/test_jwealg.rb +104 -0
- data/test/authlete/types/test_jweenc.rb +60 -0
- data/test/authlete/types/test_jwsalg.rb +96 -0
- data/test/authlete/types/test_response-type.rb +68 -0
- data/test/authlete/types/test_subject-type.rb +44 -0
- metadata +31 -2
@@ -0,0 +1,96 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2022 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 JWSAlgTest < Minitest::Test
|
23
|
+
def do_test(input, expected)
|
24
|
+
output = Authlete::Types::JWSAlg::constant_get(input)
|
25
|
+
|
26
|
+
if expected.nil?
|
27
|
+
assert_nil output
|
28
|
+
else
|
29
|
+
assert_equal expected, output
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_unknown
|
34
|
+
do_test('UNKNOWN', nil)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_none
|
38
|
+
do_test('NONE', 'none')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_hs256
|
42
|
+
do_test('HS256', 'HS256')
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_hs384
|
46
|
+
do_test('HS384', 'HS384')
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_hs512
|
50
|
+
do_test('HS512', 'HS512')
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_rs256
|
54
|
+
do_test('RS256', 'RS256')
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_rs384
|
58
|
+
do_test('RS384', 'RS384')
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_rs512
|
62
|
+
do_test('RS512', 'RS512')
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_es256
|
66
|
+
do_test('ES256', 'ES256')
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_es384
|
70
|
+
do_test('ES384', 'ES384')
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_es512
|
74
|
+
do_test('ES512', 'ES512')
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_ps256
|
78
|
+
do_test('PS256', 'PS256')
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_ps384
|
82
|
+
do_test('PS384', 'PS384')
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_ps512
|
86
|
+
do_test('PS512', 'PS512')
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_es256k
|
90
|
+
do_test('ES256K', 'ES256K')
|
91
|
+
end
|
92
|
+
|
93
|
+
def test_eddsa
|
94
|
+
do_test('EdDSA', 'EdDSA')
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2022 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 ResponseTypeTest < Minitest::Test
|
23
|
+
def do_test(input, expected)
|
24
|
+
output = Authlete::Types::ResponseType::constant_get(input)
|
25
|
+
|
26
|
+
if expected.nil?
|
27
|
+
assert_nil output
|
28
|
+
else
|
29
|
+
assert_equal expected, output
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_unknown
|
34
|
+
do_test('UNKNOWN', nil)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_none
|
38
|
+
do_test('NONE', 'none')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_code
|
42
|
+
do_test('CODE', 'code')
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_token
|
46
|
+
do_test('TOKEN', 'token')
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_id_token
|
50
|
+
do_test('ID_TOKEN', 'id_token')
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_code_token
|
54
|
+
do_test('CODE_TOKEN', 'code token')
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_code_id_token
|
58
|
+
do_test('CODE_ID_TOKEN', 'code id_token')
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_id_token_token
|
62
|
+
do_test('ID_TOKEN_TOKEN', 'id_token token')
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_code_id_token_token
|
66
|
+
do_test('CODE_ID_TOKEN_TOKEN', 'code id_token token')
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2022 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 SubjectTypeTest < Minitest::Test
|
23
|
+
def do_test(input, expected)
|
24
|
+
output = Authlete::Types::SubjectType::constant_get(input)
|
25
|
+
|
26
|
+
if expected.nil?
|
27
|
+
assert_nil output
|
28
|
+
else
|
29
|
+
assert_equal expected, output
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_unknown
|
34
|
+
do_test('UNKNOWN', nil)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_public
|
38
|
+
do_test('PUBLIC', 'public')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_pairwise
|
42
|
+
do_test('PAIRWISE', 'pairwise')
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,15 +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.28.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
8
8
|
- Hideki Ikeda
|
9
|
+
- Seth Wright
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2022-
|
13
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: rest-client
|
@@ -149,6 +150,16 @@ files:
|
|
149
150
|
- lib/authlete/model/sns-credentials.rb
|
150
151
|
- lib/authlete/model/tagged-value.rb
|
151
152
|
- lib/authlete/model/trust-anchor.rb
|
153
|
+
- lib/authlete/types/application-type.rb
|
154
|
+
- lib/authlete/types/client-auth-method.rb
|
155
|
+
- lib/authlete/types/constant-utility.rb
|
156
|
+
- lib/authlete/types/delivery-mode.rb
|
157
|
+
- lib/authlete/types/grant-type.rb
|
158
|
+
- lib/authlete/types/jwealg.rb
|
159
|
+
- lib/authlete/types/jweenc.rb
|
160
|
+
- lib/authlete/types/jwsalg.rb
|
161
|
+
- lib/authlete/types/response-type.rb
|
162
|
+
- lib/authlete/types/subject-type.rb
|
152
163
|
- lib/authlete/utility.rb
|
153
164
|
- lib/authlete/version.rb
|
154
165
|
- test/authlete/model/request/test_authentication-callback-request.rb
|
@@ -221,6 +232,15 @@ files:
|
|
221
232
|
- test/authlete/model/test_tagged-value.rb
|
222
233
|
- test/authlete/model/test_trust-anchor.rb
|
223
234
|
- test/authlete/test_exception.rb
|
235
|
+
- test/authlete/types/test_application-type.rb
|
236
|
+
- test/authlete/types/test_client-auth-method.rb
|
237
|
+
- test/authlete/types/test_delivery-mode.rb
|
238
|
+
- test/authlete/types/test_grant-type.rb
|
239
|
+
- test/authlete/types/test_jwealg.rb
|
240
|
+
- test/authlete/types/test_jweenc.rb
|
241
|
+
- test/authlete/types/test_jwsalg.rb
|
242
|
+
- test/authlete/types/test_response-type.rb
|
243
|
+
- test/authlete/types/test_subject-type.rb
|
224
244
|
homepage: https://www.authlete.com/
|
225
245
|
licenses:
|
226
246
|
- Apache License, Version 2.0
|
@@ -315,3 +335,12 @@ test_files:
|
|
315
335
|
- test/authlete/model/test_tagged-value.rb
|
316
336
|
- test/authlete/model/test_trust-anchor.rb
|
317
337
|
- test/authlete/test_exception.rb
|
338
|
+
- test/authlete/types/test_application-type.rb
|
339
|
+
- test/authlete/types/test_client-auth-method.rb
|
340
|
+
- test/authlete/types/test_delivery-mode.rb
|
341
|
+
- test/authlete/types/test_grant-type.rb
|
342
|
+
- test/authlete/types/test_jwealg.rb
|
343
|
+
- test/authlete/types/test_jweenc.rb
|
344
|
+
- test/authlete/types/test_jwsalg.rb
|
345
|
+
- test/authlete/types/test_response-type.rb
|
346
|
+
- test/authlete/types/test_subject-type.rb
|