authlete 1.18.0 → 1.20.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: 0a6d6b54fff66206e4a72791605ec3f84cdc835365a4dce359c3acadda49c56d
4
- data.tar.gz: 5418a92d1c23f717ff8ac6e393961c0e5fef71b276ffb6c528bae32f3002ea03
3
+ metadata.gz: 0f0f975f450b062ce2e4c699ecf963ab67e0594b9912edda6e237aa34a5d232a
4
+ data.tar.gz: 5b65c27d14a277aa1a3118e3c0381c06426f43eb3a04e9a5cf5b1ddef87d80b9
5
5
  SHA512:
6
- metadata.gz: 53cacf0ae8c7f6edf51c9628598234297666a96aa877bf284fd6c41469c7ec74892d56912b240658ff7ed8c14e1f68a55504a615c89406cb0d6c4086792084d5
7
- data.tar.gz: fe43a9a51a6716e103bd57d9c9699870f637310c2c0b255a83d0d61b16453e5ffb75b5717da73711b66e051a29e917e642ea81b478d101246716f0df4b75a6c0
6
+ metadata.gz: 6259dfda0962dcc6da2c5fa2a2e316471c14b0c302019a5a1fd942a0ae705155bcccd7469576b64642962ea6b3cbfa994778e130044659c34c8d8a9d6cbffd53
7
+ data.tar.gz: 966937e26341c3b9ec375c1118f156519dda150cd8c20c18bb29fba411bd2594c9bcbb78220eabdf21b2bbcf633fd817ab679f1dbd4b26e995f30fb2ea9ec357
@@ -308,6 +308,10 @@ module Authlete
308
308
  attr_accessor :digestAlgorithm
309
309
  alias_method :digest_algorithm, :digestAlgorithm
310
310
  alias_method :digest_algorithm=, :digestAlgorithm=
311
+
312
+ attr_accessor :singleAccessTokenPerSubject
313
+ alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
314
+ alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
311
315
  private
312
316
 
313
317
  def defaults
@@ -387,7 +391,8 @@ module Authlete
387
391
  frontChannelRequestObjectEncryptionRequired: false,
388
392
  requestObjectEncryptionAlgMatchRequired: false,
389
393
  requestObjectEncryptionEncMatchRequired: false,
390
- digestAlgorithm: nil
394
+ digestAlgorithm: nil,
395
+ singleAccessTokenPerSubject: false
391
396
  }
392
397
  end
393
398
 
@@ -468,6 +473,7 @@ module Authlete
468
473
  @requestObjectEncryptionAlgMatchRequired = hash[:requestObjectEncryptionAlgMatchRequired]
469
474
  @requestObjectEncryptionEncMatchRequired = hash[:requestObjectEncryptionEncMatchRequired]
470
475
  @digestAlgorithm = hash[:digestAlgorithm]
476
+ @singleAccessTokenPerSubject = hash[:singleAccessTokenPerSubject]
471
477
  end
472
478
 
473
479
  def to_hash_value(key, var)
@@ -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 :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
+
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
+ supportedClientRegistrationTypes: 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
+ @supportedClientRegistrationTypes = hash[:supportedClientRegistrationTypes]
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.20.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'
@@ -120,6 +120,7 @@ class ClientTest < Minitest::Test
120
120
  REQUEST_OBJECT_ENCRYPTION_ALG_MATCH_REQUIRED = false
121
121
  REQUEST_OBJECT_ENCRYPTION_ENC_MATCH_REQUIRED = false
122
122
  DIGEST_ALGORITHM = '<digest-algorithm>'
123
+ SINGLE_ACCESS_TOKEN_PER_SUBJECT = false
123
124
 
124
125
  def generate_json
125
126
  return <<~JSON
@@ -204,7 +205,8 @@ class ClientTest < Minitest::Test
204
205
  "frontChannelRequestObjectEncryptionRequired": false,
205
206
  "requestObjectEncryptionAlgMatchRequired": false,
206
207
  "requestObjectEncryptionEncMatchRequired": false,
207
- "digestAlgorithm": "<digest-algorithm>"
208
+ "digestAlgorithm": "<digest-algorithm>",
209
+ "singleAccessTokenPerSubject": false
208
210
  }
209
211
  JSON
210
212
  end
@@ -292,7 +294,8 @@ class ClientTest < Minitest::Test
292
294
  frontChannelRequestObjectEncryptionRequired: false,
293
295
  requestObjectEncryptionAlgMatchRequired: false,
294
296
  requestObjectEncryptionEncMatchRequired: false,
295
- digestAlgorithm: '<digest-algorithm>'
297
+ digestAlgorithm: '<digest-algorithm>',
298
+ singleAccessTokenPerSubject: false
296
299
  }
297
300
  end
298
301
 
@@ -374,6 +377,7 @@ class ClientTest < Minitest::Test
374
377
  obj.requestObjectEncryptionAlgMatchRequired = REQUEST_OBJECT_ENCRYPTION_ALG_MATCH_REQUIRED
375
378
  obj.requestObjectEncryptionEncMatchRequired = REQUEST_OBJECT_ENCRYPTION_ENC_MATCH_REQUIRED
376
379
  obj.digestAlgorithm = DIGEST_ALGORITHM
380
+ obj.singleAccessTokenPerSubject = SINGLE_ACCESS_TOKEN_PER_SUBJECT
377
381
  end
378
382
 
379
383
 
@@ -462,6 +466,7 @@ class ClientTest < Minitest::Test
462
466
  assert_equal REQUEST_OBJECT_ENCRYPTION_ALG_MATCH_REQUIRED, obj.requestObjectEncryptionAlgMatchRequired
463
467
  assert_equal REQUEST_OBJECT_ENCRYPTION_ENC_MATCH_REQUIRED, obj.requestObjectEncryptionEncMatchRequired
464
468
  assert_equal DIGEST_ALGORITHM, obj.digestAlgorithm
469
+ assert_equal SINGLE_ACCESS_TOKEN_PER_SUBJECT, obj.singleAccessTokenPerSubject
465
470
  end
466
471
 
467
472
 
@@ -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
+ 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
+
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
+ "supportedClientRegistrationTypes": [ "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
+ supportedClientRegistrationTypes: [ '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.supported_client_registration_types = SUPPORTED_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 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
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.20.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-07-14 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