authlete 1.17.0 → 1.19.1
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/model/service.rb +57 -1
- data/lib/authlete/model/trust-anchor.rb +44 -0
- data/lib/authlete/version.rb +1 -1
- data/lib/authlete.rb +1 -0
- data/test/authlete/model/test_service.rb +53 -3
- data/test/authlete/model/test_trust-anchor.rb +84 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10a130b0c41b85471359025c77abdab39a5256c6b187e49f9ee8c2d32a358659
|
4
|
+
data.tar.gz: 628dcd22d6383ea0434a428b0167454011b4762c9241ce03d8ae89d9206fc49d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8969642543bc8465eb5e4d6ad101c3035bd4983d6a6c6c8eb805a2744364a448450eab82ad53aa592616f5c2b3f36a321d22c66b30de3add84a6f3eb39659bf
|
7
|
+
data.tar.gz: c1fea81a6cd0ff775840842da6cd0446ba128eb0491965cbf812eba3e4b0ec592a5759b8df0166b3844d7626cfe36885ad1c4acdff200131bebd3b5181e5d164
|
@@ -526,6 +526,43 @@ module Authlete
|
|
526
526
|
attr_accessor :accessTokenForExternalAttachmentEmbedded
|
527
527
|
alias_method :access_token_for_external_attachment_embedded, :accessTokenForExternalAttachmentEmbedded
|
528
528
|
alias_method :access_token_for_external_attachment_embedded=, :accessTokenForExternalAttachmentEmbedded=
|
529
|
+
|
530
|
+
attr_accessor :refreshTokenIdempotent
|
531
|
+
alias_method :refresh_token_idempotent, :refreshTokenIdempotent
|
532
|
+
alias_method :refresh_token_idempotent=, :refreshTokenIdempotent=
|
533
|
+
|
534
|
+
attr_accessor :federationEnabled
|
535
|
+
alias_method :federation_enabled, :federationEnabled
|
536
|
+
alias_method :federation_enabled=, :federationEnabled=
|
537
|
+
|
538
|
+
attr_accessor :organizationName
|
539
|
+
alias_method :organization_name, :organizationName
|
540
|
+
alias_method :organization_name=, :organizationName=
|
541
|
+
|
542
|
+
attr_accessor :authorityHints
|
543
|
+
alias_method :authority_hints, :authorityHints
|
544
|
+
alias_method :authority_hints=, :authorityHints=
|
545
|
+
|
546
|
+
attr_accessor :federationJwks
|
547
|
+
alias_method :federation_jwks, :federationJwks
|
548
|
+
alias_method :federation_jwks=, :federationJwks=
|
549
|
+
|
550
|
+
attr_accessor :signedJwksUri
|
551
|
+
alias_method :signed_jwks_uri, :signedJwksUri
|
552
|
+
alias_method :signed_jwks_uri=, :signedJwksUri=
|
553
|
+
|
554
|
+
attr_accessor :federationRegistrationEndpoint
|
555
|
+
alias_method :federation_registration_endpoint, :federationRegistrationEndpoint
|
556
|
+
alias_method :federation_registration_endpoint=, :federationRegistrationEndpoint=
|
557
|
+
|
558
|
+
attr_accessor :supportedClientRegistrationTypes
|
559
|
+
alias_method :supported_client_registration_types, :supportedClientRegistrationTypes
|
560
|
+
alias_method :supported_client_registration_types=, :supportedClientRegistrationTypes=
|
561
|
+
|
562
|
+
attr_accessor :trustAnchors
|
563
|
+
alias_method :trust_anchors, :trustAnchors
|
564
|
+
alias_method :trust_anchors=, :trustAnchors=
|
565
|
+
|
529
566
|
private
|
530
567
|
|
531
568
|
def defaults
|
@@ -660,6 +697,15 @@ module Authlete
|
|
660
697
|
supportedDigestAlgorithms: nil,
|
661
698
|
requestObjectAudienceChecked: false,
|
662
699
|
accessTokenForExternalAttachmentEmbedded: false,
|
700
|
+
refreshTokenIdempotent: false,
|
701
|
+
federationEnabled: false,
|
702
|
+
organizationName: nil,
|
703
|
+
authorityHints: nil,
|
704
|
+
federationJwks: nil,
|
705
|
+
signedJwksUri: nil,
|
706
|
+
federationRegistrationEndpoint: nil,
|
707
|
+
supportedClientRegistrationTypes: nil,
|
708
|
+
trustAnchors: nil,
|
663
709
|
}
|
664
710
|
end
|
665
711
|
|
@@ -794,6 +840,16 @@ module Authlete
|
|
794
840
|
@supportedDigestAlgorithms = hash[:supportedDigestAlgorithms]
|
795
841
|
@requestObjectAudienceChecked = hash[:requestObjectAudienceChecked]
|
796
842
|
@accessTokenForExternalAttachmentEmbedded = hash[:accessTokenForExternalAttachmentEmbedded]
|
843
|
+
@refreshTokenIdempotent = hash[:refreshTokenIdempotent]
|
844
|
+
@federationEnabled = hash[:federationEnabled]
|
845
|
+
@organizationName = hash[:organizationName]
|
846
|
+
@authorityHints = hash[:authorityHints]
|
847
|
+
@federationJwks = hash[:federationJwks]
|
848
|
+
@signedJwksUri = hash[:signedJwksUri]
|
849
|
+
@federationRegistrationEndpoint = hash[:federationRegistrationEndpoint]
|
850
|
+
@supportedClientRegistrationTypes = hash[:supportedClientRegistrationTypes]
|
851
|
+
@trustAnchors = get_parsed_array(hash[:trustAnchors]) { |e| Authlete::Model::TrustAnchor.parse(e) }
|
852
|
+
|
797
853
|
end
|
798
854
|
|
799
855
|
def to_hash_value(key, var)
|
@@ -801,7 +857,7 @@ module Authlete
|
|
801
857
|
|
802
858
|
case key
|
803
859
|
when :snsCredentials, :developerSnsCredentials, :supportedScopes,
|
804
|
-
:metadata, :mtlsEndpointAliases, :attributes, :hsks
|
860
|
+
:metadata, :mtlsEndpointAliases, :attributes, :hsks, :trustAnchors
|
805
861
|
raw_val&.map { |e| e.to_hash }
|
806
862
|
else
|
807
863
|
raw_val
|
@@ -0,0 +1,44 @@
|
|
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
|
+
module Authlete
|
19
|
+
module Model
|
20
|
+
class TrustAnchor < Authlete::Model::Base
|
21
|
+
include Authlete::Model::Hashable
|
22
|
+
|
23
|
+
attr_accessor :entityId
|
24
|
+
alias_method :entity_id, :entityId
|
25
|
+
alias_method :entity_id=, :entityId=
|
26
|
+
|
27
|
+
attr_accessor :jwks
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def defaults
|
32
|
+
{
|
33
|
+
entityId: nil,
|
34
|
+
jwks: nil
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
def set_params(hash)
|
39
|
+
@entityId = hash[:entityId]
|
40
|
+
@jwks = hash[:jwks]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/authlete/version.rb
CHANGED
data/lib/authlete.rb
CHANGED
@@ -40,6 +40,7 @@ module Authlete
|
|
40
40
|
autoload :TaggedValue, 'authlete/model/tagged-value'
|
41
41
|
autoload :NamedUri, 'authlete/model/named-uri'
|
42
42
|
autoload :Hsk, 'authlete/model/hsk'
|
43
|
+
autoload :TrustAnchor, 'authlete/model/trust-anchor'
|
43
44
|
|
44
45
|
module Request
|
45
46
|
autoload :AuthenticationCallbackRequest, 'authlete/model/request/authentication-callback-request'
|
@@ -172,6 +172,18 @@ class ServiceTest < Minitest::Test
|
|
172
172
|
SUPPORTED_DIGEST_ALGORITHMS = ['<supported-digest-algorithms1>', '<supported-digest-algorithms1>']
|
173
173
|
REQUEST_OBJECT_AUDIENCE_CHECKED = true
|
174
174
|
ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED = false
|
175
|
+
REFRESH_TOKEN_IDEMPOTENT = false
|
176
|
+
FEDERATION_ENABLED = false
|
177
|
+
ORGANIZATION_NAME = '<organization-name>'
|
178
|
+
AUTHORITY_HINTS = [ '<authority>', '<hints>']
|
179
|
+
FEDERATION_JWKS = '<federation-jwks>'
|
180
|
+
SIGNED_JWKS_URI = '<signed-jwks-uri>'
|
181
|
+
FEDERATION_REGISTRATION_ENDPOINT = '<federation-registration-endpoint>'
|
182
|
+
SUPPORTED_CLIENT_REGISTRATION_TYPES = [ 'AUTOMATIC', 'EXPLICIT']
|
183
|
+
TRUST_ANCHOR_ENTITY_ID = '<entity-id>'
|
184
|
+
TRUST_ANCHOR_JWKS = '<jwks>'
|
185
|
+
TRUST_ANCHORS = [ Authlete::Model::TrustAnchor.new(entityId: TRUST_ANCHOR_ENTITY_ID, jwks: TRUST_ANCHOR_JWKS) ]
|
186
|
+
|
175
187
|
|
176
188
|
def generate_json
|
177
189
|
return <<~JSON
|
@@ -305,9 +317,19 @@ class ServiceTest < Minitest::Test
|
|
305
317
|
"supportedAttachments": [ "EMBEDDED", "EXTERNAL"],
|
306
318
|
"supportedDigestAlgorithms": ["<supported-digest-algorithms1>", "<supported-digest-algorithms1>"],
|
307
319
|
"requestObjectAudienceChecked": true,
|
308
|
-
"accessTokenForExternalAttachmentEmbedded": false
|
320
|
+
"accessTokenForExternalAttachmentEmbedded": false,
|
321
|
+
"refreshTokenIdempotent": false,
|
322
|
+
"federationEnabled": false,
|
323
|
+
"organizationName": "<organization-name>",
|
324
|
+
"authorityHints": [ "<authority>", "<hints>"],
|
325
|
+
"federationJwks": "<federation-jwks>",
|
326
|
+
"signedJwksUri": "<signed-jwks-uri>",
|
327
|
+
"federationRegistrationEndpoint": "<federation-registration-endpoint>",
|
328
|
+
"supportedClientRegistrationTypes": [ "AUTOMATIC", "EXPLICIT"],
|
329
|
+
"trustAnchors": [{ "entityId": "<entity-id>", "jwks": "<jwks>" }]
|
309
330
|
}
|
310
|
-
|
331
|
+
JSON
|
332
|
+
|
311
333
|
end
|
312
334
|
|
313
335
|
|
@@ -442,7 +464,16 @@ class ServiceTest < Minitest::Test
|
|
442
464
|
supportedAttachments: [ 'EMBEDDED', 'EXTERNAL'],
|
443
465
|
supportedDigestAlgorithms: ['<supported-digest-algorithms1>', '<supported-digest-algorithms1>'],
|
444
466
|
requestObjectAudienceChecked: true,
|
445
|
-
accessTokenForExternalAttachmentEmbedded: false
|
467
|
+
accessTokenForExternalAttachmentEmbedded: false,
|
468
|
+
refreshTokenIdempotent: false,
|
469
|
+
federationEnabled: false,
|
470
|
+
organizationName: '<organization-name>',
|
471
|
+
authorityHints: [ '<authority>', '<hints>'],
|
472
|
+
federationJwks: '<federation-jwks>',
|
473
|
+
signedJwksUri: '<signed-jwks-uri>',
|
474
|
+
federationRegistrationEndpoint: '<federation-registration-endpoint>',
|
475
|
+
supportedClientRegistrationTypes: [ 'AUTOMATIC', 'EXPLICIT'],
|
476
|
+
trustAnchors: [{ entityId: "<entity-id>", jwks: "<jwks>" }],
|
446
477
|
}
|
447
478
|
end
|
448
479
|
|
@@ -578,6 +609,15 @@ class ServiceTest < Minitest::Test
|
|
578
609
|
obj.supported_digest_algorithms = SUPPORTED_DIGEST_ALGORITHMS
|
579
610
|
obj.request_object_audience_checked = REQUEST_OBJECT_AUDIENCE_CHECKED
|
580
611
|
obj.access_token_for_external_attachment_embedded = ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED
|
612
|
+
obj.refresh_token_idempotent = REFRESH_TOKEN_IDEMPOTENT
|
613
|
+
obj.federation_enabled = FEDERATION_ENABLED
|
614
|
+
obj.organization_name = ORGANIZATION_NAME
|
615
|
+
obj.authority_hints = AUTHORITY_HINTS
|
616
|
+
obj.federation_jwks = FEDERATION_JWKS
|
617
|
+
obj.signed_jwks_uri = SIGNED_JWKS_URI
|
618
|
+
obj.federation_registration_endpoint = FEDERATION_REGISTRATION_ENDPOINT
|
619
|
+
obj.supported_client_registration_types = SUPPORTED_CLIENT_REGISTRATION_TYPES
|
620
|
+
obj.trust_anchors = TRUST_ANCHORS
|
581
621
|
end
|
582
622
|
|
583
623
|
|
@@ -726,6 +766,16 @@ class ServiceTest < Minitest::Test
|
|
726
766
|
assert_equal SUPPORTED_DIGEST_ALGORITHMS, obj.supported_digest_algorithms
|
727
767
|
assert_equal REQUEST_OBJECT_AUDIENCE_CHECKED, obj.request_object_audience_checked
|
728
768
|
assert_equal ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED, obj.access_token_for_external_attachment_embedded
|
769
|
+
assert_equal REFRESH_TOKEN_IDEMPOTENT, obj.refresh_token_idempotent
|
770
|
+
assert_equal FEDERATION_ENABLED, obj.federation_enabled
|
771
|
+
assert_equal ORGANIZATION_NAME, obj.organization_name
|
772
|
+
assert_equal AUTHORITY_HINTS, obj.authority_hints
|
773
|
+
assert_equal FEDERATION_JWKS, obj.federation_jwks
|
774
|
+
assert_equal SIGNED_JWKS_URI, obj.signed_jwks_uri
|
775
|
+
assert_equal FEDERATION_REGISTRATION_ENDPOINT, obj.federation_registration_endpoint
|
776
|
+
assert_equal SUPPORTED_CLIENT_REGISTRATION_TYPES, obj.supported_client_registration_types
|
777
|
+
assert_equal TRUST_ANCHOR_ENTITY_ID, obj.trustAnchors[0].entityId
|
778
|
+
assert_equal TRUST_ANCHOR_JWKS, obj.trustAnchors[0].jwks
|
729
779
|
end
|
730
780
|
|
731
781
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# :nodoc:
|
2
|
+
#
|
3
|
+
# Copyright (C) 2014-2021 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 TrustAnchorTest < Minitest::Test
|
24
|
+
ENTITY_ID = '<entity-id>'
|
25
|
+
JWKS = '<jwks>'
|
26
|
+
|
27
|
+
|
28
|
+
def generate_json
|
29
|
+
return <<~JSON
|
30
|
+
{
|
31
|
+
"entityId": "<entity-id>",
|
32
|
+
"jwks": "<jwks>"
|
33
|
+
}
|
34
|
+
JSON
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def generate_hash
|
39
|
+
{
|
40
|
+
entityId: '<entity-id>',
|
41
|
+
jwks: '<jwks>',
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
def set_params(obj)
|
47
|
+
obj.entity_id = ENTITY_ID
|
48
|
+
obj.jwks = JWKS
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
def match(obj)
|
53
|
+
assert_equal ENTITY_ID, obj.entityId
|
54
|
+
assert_equal JWKS, obj.jwks
|
55
|
+
end
|
56
|
+
|
57
|
+
|
58
|
+
def test_from_json
|
59
|
+
jsn = generate_json
|
60
|
+
hsh = JSON.parse(jsn)
|
61
|
+
|
62
|
+
actual = Authlete::Model::TrustAnchor.new(hsh)
|
63
|
+
|
64
|
+
match(actual)
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
def test_setters
|
69
|
+
actual = Authlete::Model::TrustAnchor.new
|
70
|
+
set_params(actual)
|
71
|
+
|
72
|
+
match(actual)
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
def test_to_hash
|
77
|
+
obj = Authlete::Model::TrustAnchor.new
|
78
|
+
set_params(obj)
|
79
|
+
actual = obj.to_hash
|
80
|
+
expected = generate_hash
|
81
|
+
|
82
|
+
assert_equal expected, actual
|
83
|
+
end
|
84
|
+
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.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiko Kawasaki
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/authlete/model/service.rb
|
149
149
|
- lib/authlete/model/sns-credentials.rb
|
150
150
|
- lib/authlete/model/tagged-value.rb
|
151
|
+
- lib/authlete/model/trust-anchor.rb
|
151
152
|
- lib/authlete/utility.rb
|
152
153
|
- lib/authlete/version.rb
|
153
154
|
- test/authlete/model/request/test_authentication-callback-request.rb
|
@@ -218,6 +219,7 @@ files:
|
|
218
219
|
- test/authlete/model/test_service.rb
|
219
220
|
- test/authlete/model/test_sns-credentials.rb
|
220
221
|
- test/authlete/model/test_tagged-value.rb
|
222
|
+
- test/authlete/model/test_trust-anchor.rb
|
221
223
|
- test/authlete/test_exception.rb
|
222
224
|
homepage: https://www.authlete.com/
|
223
225
|
licenses:
|
@@ -311,4 +313,5 @@ test_files:
|
|
311
313
|
- test/authlete/model/test_service.rb
|
312
314
|
- test/authlete/model/test_sns-credentials.rb
|
313
315
|
- test/authlete/model/test_tagged-value.rb
|
316
|
+
- test/authlete/model/test_trust-anchor.rb
|
314
317
|
- test/authlete/test_exception.rb
|