authlete 1.18.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a6d6b54fff66206e4a72791605ec3f84cdc835365a4dce359c3acadda49c56d
4
- data.tar.gz: 5418a92d1c23f717ff8ac6e393961c0e5fef71b276ffb6c528bae32f3002ea03
3
+ metadata.gz: e3ad118de0c0ce4b479b48a45943c2a4569ddeed53d039439e0994835ef3bf30
4
+ data.tar.gz: 9377805d49c43b0983c52bb2bc3f7cf4680b970f08312f8c549eae2149653393
5
5
  SHA512:
6
- metadata.gz: 53cacf0ae8c7f6edf51c9628598234297666a96aa877bf284fd6c41469c7ec74892d56912b240658ff7ed8c14e1f68a55504a615c89406cb0d6c4086792084d5
7
- data.tar.gz: fe43a9a51a6716e103bd57d9c9699870f637310c2c0b255a83d0d61b16453e5ffb75b5717da73711b66e051a29e917e642ea81b478d101246716f0df4b75a6c0
6
+ metadata.gz: e766a877635b6623018a4320ec8d4e8b7bd6e12fb5b8839311169e2cfdc564d704a1c75413e2f67dc4a42e6da6098b67cb93affe39aa7db2e7c470aedee74d25
7
+ data.tar.gz: 5df307a8254999036ae0954c0a1f4d655bf64a99bbdffc2e7094b61481d780da00e87b74005f00b77f0e733de2ed102280957c3a40530e6c3596b84373e9a759
@@ -530,6 +530,39 @@ module Authlete
530
530
  attr_accessor :refreshTokenIdempotent
531
531
  alias_method :refresh_token_idempotent, :refreshTokenIdempotent
532
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 :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
+
533
566
  private
534
567
 
535
568
  def defaults
@@ -665,6 +698,14 @@ module Authlete
665
698
  requestObjectAudienceChecked: false,
666
699
  accessTokenForExternalAttachmentEmbedded: false,
667
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,
668
709
  }
669
710
  end
670
711
 
@@ -800,6 +841,15 @@ module Authlete
800
841
  @requestObjectAudienceChecked = hash[:requestObjectAudienceChecked]
801
842
  @accessTokenForExternalAttachmentEmbedded = hash[:accessTokenForExternalAttachmentEmbedded]
802
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
+
803
853
  end
804
854
 
805
855
  def to_hash_value(key, var)
@@ -807,7 +857,7 @@ module Authlete
807
857
 
808
858
  case key
809
859
  when :snsCredentials, :developerSnsCredentials, :supportedScopes,
810
- :metadata, :mtlsEndpointAliases, :attributes, :hsks
860
+ :metadata, :mtlsEndpointAliases, :attributes, :hsks, :trustAnchors
811
861
  raw_val&.map { |e| e.to_hash }
812
862
  else
813
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.18.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'
@@ -173,6 +173,17 @@ class ServiceTest < Minitest::Test
173
173
  REQUEST_OBJECT_AUDIENCE_CHECKED = true
174
174
  ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED = false
175
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
+
176
187
 
177
188
  def generate_json
178
189
  return <<~JSON
@@ -307,9 +318,18 @@ class ServiceTest < Minitest::Test
307
318
  "supportedDigestAlgorithms": ["<supported-digest-algorithms1>", "<supported-digest-algorithms1>"],
308
319
  "requestObjectAudienceChecked": true,
309
320
  "accessTokenForExternalAttachmentEmbedded": false,
310
- "refreshTokenIdempotent": 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>" }]
311
330
  }
312
- JSON
331
+ JSON
332
+
313
333
  end
314
334
 
315
335
 
@@ -445,7 +465,15 @@ class ServiceTest < Minitest::Test
445
465
  supportedDigestAlgorithms: ['<supported-digest-algorithms1>', '<supported-digest-algorithms1>'],
446
466
  requestObjectAudienceChecked: true,
447
467
  accessTokenForExternalAttachmentEmbedded: false,
448
- refreshTokenIdempotent: 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>" }],
449
477
  }
450
478
  end
451
479
 
@@ -582,6 +610,14 @@ class ServiceTest < Minitest::Test
582
610
  obj.request_object_audience_checked = REQUEST_OBJECT_AUDIENCE_CHECKED
583
611
  obj.access_token_for_external_attachment_embedded = ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED
584
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
585
621
  end
586
622
 
587
623
 
@@ -731,6 +767,15 @@ class ServiceTest < Minitest::Test
731
767
  assert_equal REQUEST_OBJECT_AUDIENCE_CHECKED, obj.request_object_audience_checked
732
768
  assert_equal ACCESS_TOKEN_FOR_EXTERNAL_ATTACHMENT_EMBEDDED, obj.access_token_for_external_attachment_embedded
733
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
734
779
  end
735
780
 
736
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.18.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-06-10 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