authlete 1.16.0 → 1.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 172c177900d3821bc89e822e2c3d5318ad25b35e1a068485e05717c15e50b606
4
- data.tar.gz: 1177bc0a1270134b5e14f0bf109e7e3d42bc0c03152545bde26392d786387aaa
3
+ metadata.gz: e3ad118de0c0ce4b479b48a45943c2a4569ddeed53d039439e0994835ef3bf30
4
+ data.tar.gz: 9377805d49c43b0983c52bb2bc3f7cf4680b970f08312f8c549eae2149653393
5
5
  SHA512:
6
- metadata.gz: d86dbb06ee29f1d84de8d303db432f08c21ee5279465675a1f4c7ba3b3ba156a9bc4a3f645986af3f2b4bd252a463a1c62a5e3d31f845cbb1cbdb60fc0192b0a
7
- data.tar.gz: 52814554bf0020b1a24d2eac94b05db73045c01e160174b6f3047eb1ae432814d583160ede895135d7d2042317028ad970a07564d181e822a5f40dc77fac0591
6
+ metadata.gz: e766a877635b6623018a4320ec8d4e8b7bd6e12fb5b8839311169e2cfdc564d704a1c75413e2f67dc4a42e6da6098b67cb93affe39aa7db2e7c470aedee74d25
7
+ data.tar.gz: 5df307a8254999036ae0954c0a1f4d655bf64a99bbdffc2e7094b61481d780da00e87b74005f00b77f0e733de2ed102280957c3a40530e6c3596b84373e9a759
@@ -522,8 +522,49 @@ module Authlete
522
522
  attr_accessor :requestObjectAudienceChecked
523
523
  alias_method :request_object_audience_checked, :requestObjectAudienceChecked
524
524
  alias_method :request_object_audience_checked=, :requestObjectAudienceChecked=
525
- private
525
+
526
+ attr_accessor :accessTokenForExternalAttachmentEmbedded
527
+ alias_method :access_token_for_external_attachment_embedded, :accessTokenForExternalAttachmentEmbedded
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=
526
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 :clientRegistrationTypes
559
+ alias_method :client_registration_types, :clientRegistrationTypes
560
+ alias_method :client_registration_types=, :clientRegistrationTypes=
561
+
562
+ attr_accessor :trustAnchors
563
+ alias_method :trust_anchors, :trustAnchors
564
+ alias_method :trust_anchors=, :trustAnchors=
565
+
566
+ private
567
+
527
568
  def defaults
528
569
  {
529
570
  number: 0,
@@ -655,6 +696,16 @@ module Authlete
655
696
  supportedAttachments: nil,
656
697
  supportedDigestAlgorithms: nil,
657
698
  requestObjectAudienceChecked: false,
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
+ clientRegistrationTypes: nil,
708
+ trustAnchors: nil,
658
709
  }
659
710
  end
660
711
 
@@ -788,6 +839,17 @@ module Authlete
788
839
  @supportedAttachments = hash[:supportedAttachments]
789
840
  @supportedDigestAlgorithms = hash[:supportedDigestAlgorithms]
790
841
  @requestObjectAudienceChecked = hash[:requestObjectAudienceChecked]
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
+ @clientRegistrationTypes = hash[:clientRegistrationTypes]
851
+ @trustAnchors = get_parsed_array(hash[:trustAnchors]) { |e| Authlete::Model::TrustAnchor.parse(e) }
852
+
791
853
  end
792
854
 
793
855
  def to_hash_value(key, var)
@@ -795,7 +857,7 @@ module Authlete
795
857
 
796
858
  case key
797
859
  when :snsCredentials, :developerSnsCredentials, :supportedScopes,
798
- :metadata, :mtlsEndpointAliases, :attributes, :hsks
860
+ :metadata, :mtlsEndpointAliases, :attributes, :hsks, :trustAnchors
799
861
  raw_val&.map { |e| e.to_hash }
800
862
  else
801
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
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module Authlete
19
- VERSION = "1.16.0"
19
+ VERSION = "1.19.0"
20
20
  end
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'
@@ -171,6 +171,19 @@ class ServiceTest < Minitest::Test
171
171
  SUPPORTED_ATTACHMENTS = [ 'EMBEDDED', 'EXTERNAL']
172
172
  SUPPORTED_DIGEST_ALGORITHMS = ['<supported-digest-algorithms1>', '<supported-digest-algorithms1>']
173
173
  REQUEST_OBJECT_AUDIENCE_CHECKED = true
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
+ 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
+
174
187
 
175
188
  def generate_json
176
189
  return <<~JSON
@@ -303,9 +316,20 @@ class ServiceTest < Minitest::Test
303
316
  "supportedElectronicRecords": ["<supported-electronic-records1>", "<supported-electronic-records1>"],
304
317
  "supportedAttachments": [ "EMBEDDED", "EXTERNAL"],
305
318
  "supportedDigestAlgorithms": ["<supported-digest-algorithms1>", "<supported-digest-algorithms1>"],
306
- "requestObjectAudienceChecked": true
319
+ "requestObjectAudienceChecked": true,
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
+ "clientRegistrationTypes": [ "AUTOMATIC", "EXPLICIT"],
329
+ "trustAnchors": [{ "entityId": "<entity-id>", "jwks": "<jwks>" }]
307
330
  }
308
- JSON
331
+ JSON
332
+
309
333
  end
310
334
 
311
335
 
@@ -439,7 +463,17 @@ class ServiceTest < Minitest::Test
439
463
  supportedElectronicRecords: ['<supported-electronic-records1>', '<supported-electronic-records1>'],
440
464
  supportedAttachments: [ 'EMBEDDED', 'EXTERNAL'],
441
465
  supportedDigestAlgorithms: ['<supported-digest-algorithms1>', '<supported-digest-algorithms1>'],
442
- requestObjectAudienceChecked: true
466
+ requestObjectAudienceChecked: true,
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
+ clientRegistrationTypes: [ 'AUTOMATIC', 'EXPLICIT'],
476
+ trustAnchors: [{ entityId: "<entity-id>", jwks: "<jwks>" }],
443
477
  }
444
478
  end
445
479
 
@@ -574,6 +608,16 @@ class ServiceTest < Minitest::Test
574
608
  obj.supported_attachments = SUPPORTED_ATTACHMENTS
575
609
  obj.supported_digest_algorithms = SUPPORTED_DIGEST_ALGORITHMS
576
610
  obj.request_object_audience_checked = REQUEST_OBJECT_AUDIENCE_CHECKED
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.client_registration_types = CLIENT_REGISTRATION_TYPES
620
+ obj.trust_anchors = TRUST_ANCHORS
577
621
  end
578
622
 
579
623
 
@@ -721,6 +765,17 @@ class ServiceTest < Minitest::Test
721
765
  assert_equal SUPPORTED_ATTACHMENTS, obj.supported_attachments
722
766
  assert_equal SUPPORTED_DIGEST_ALGORITHMS, obj.supported_digest_algorithms
723
767
  assert_equal REQUEST_OBJECT_AUDIENCE_CHECKED, obj.request_object_audience_checked
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 CLIENT_REGISTRATION_TYPES, obj.client_registration_types
777
+ assert_equal TRUST_ANCHOR_ENTITY_ID, obj.trustAnchors[0].entityId
778
+ assert_equal TRUST_ANCHOR_JWKS, obj.trustAnchors[0].jwks
724
779
  end
725
780
 
726
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.16.0
4
+ version: 1.19.0
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-02-14 00:00:00.000000000 Z
12
+ date: 2022-06-17 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