authlete 1.2.0 → 1.3.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
  SHA1:
3
- metadata.gz: 65a17f6bf74d7d6f71ce4eb1a2fa3360e48c2c8a
4
- data.tar.gz: e025a237f9b8a2cb2ca5dfde11b98e1ad55672bc
3
+ metadata.gz: e0b0558488bf3a4a4265e05d2d1d015de18a1476
4
+ data.tar.gz: c6493cf2652ebaf784c3251940fc6ec8ed5812f5
5
5
  SHA512:
6
- metadata.gz: a4e6e76f6e2d1d5cb5cd158d51babea6e181e351bb876422ca3e8b9d7aac15ead501419a3e8ae661448768e77a951e933acc329ae225481c38523192da1214dc
7
- data.tar.gz: b5eb176613b0ee9eb3288a509b64d4240f4e96983b1548277a8481ba6031f29c9726c11bd00ddbc39a4a9915630c4df59e65835122b95a4afcacb62811264f3e
6
+ metadata.gz: 2c7efb96bedc54703dffda85a82ac39898a11c99d36adf0d4c62e008bd8d5f2c0c5bedcba65273c9aef9aafb524ca39d9d26d759c1e20043053fdad63327bd5c
7
+ data.tar.gz: a475cbdfd0f88572cd7b26d27c0728f2fc9e757930318151da7523974b3eb08959975b06857b209e64c29c909e443ca15452c731dc1d3639f175a8bc328695e0
@@ -287,6 +287,8 @@ module Authlete
287
287
  alias_method :request_object_required, :requestObjectRequired
288
288
  alias_method :request_object_required=, :requestObjectRequired=
289
289
 
290
+ attr_accessor :attributes
291
+
290
292
  private
291
293
 
292
294
  def defaults
@@ -360,7 +362,8 @@ module Authlete
360
362
  registrationAccessTokenHash: nil,
361
363
  authorizationDataTypes: nil,
362
364
  parRequired: false,
363
- requestObjectRequired: false
365
+ requestObjectRequired: false,
366
+ attributes: nil
364
367
  }
365
368
  end
366
369
 
@@ -435,13 +438,15 @@ module Authlete
435
438
  @authorizationDataTypes = hash[:authorizationDataTypes]
436
439
  @parRequired = hash[:parRequired]
437
440
  @requestObjectRequired = hash[:requestObjectRequired]
441
+ @attributes = get_parsed_array(hash[:attributes]) { |e| Authlete::Model::Pair.parse(e) }
438
442
  end
439
443
 
440
444
  def to_hash_value(key, var)
441
445
  raw_val = instance_variable_get(var)
442
446
 
443
447
  case key
444
- when :clientNames, :logoUris, :clientUris, :policyUris, :tosUris, :descriptions
448
+ when :clientNames, :logoUris, :clientUris, :policyUris, :tosUris,
449
+ :descriptions, :attributes
445
450
  raw_val&.map { |e| e.to_hash }
446
451
  when :extension
447
452
  raw_val&.to_hash
@@ -435,6 +435,8 @@ module Authlete
435
435
  alias_method :iss_suppressed, :issSuppressed
436
436
  alias_method :iss_suppressed=, :issSuppressed=
437
437
 
438
+ attr_accessor :attributes
439
+
438
440
  private
439
441
 
440
442
  def defaults
@@ -544,7 +546,8 @@ module Authlete
544
546
  claimShortcutRestrictive: false,
545
547
  scopeRequired: false,
546
548
  nbfOptional: false,
547
- issSuppressed: false
549
+ issSuppressed: false,
550
+ attributes: nil
548
551
  }
549
552
  end
550
553
 
@@ -655,13 +658,15 @@ module Authlete
655
658
  @scopeRequired = hash[:scopeRequired]
656
659
  @nbfOptional = hash[:nbfOptional]
657
660
  @issSuppressed = hash[:issSuppressed]
661
+ @attributes = get_parsed_array(hash[:attributes]) { |e| Authlete::Model::Pair.parse(e) }
658
662
  end
659
663
 
660
664
  def to_hash_value(key, var)
661
665
  raw_val = instance_variable_get(var)
662
666
 
663
667
  case key
664
- when :snsCredentials, :developerSnsCredentials, :supportedScopes, :metadata, :mtlsEndpointAliases
668
+ when :snsCredentials, :developerSnsCredentials, :supportedScopes,
669
+ :metadata, :mtlsEndpointAliases, :attributes
665
670
  raw_val&.map { |e| e.to_hash }
666
671
  else
667
672
  raw_val
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module Authlete
19
- VERSION = "1.2.0"
19
+ VERSION = "1.3.0"
20
20
  end
@@ -54,8 +54,6 @@ class ClientExtensionTest < Minitest::Test
54
54
  obj.requestable_scopes_enabled = REQUESTABLE_SCOPES_ENABLED
55
55
  obj.access_token_duration = ACCESS_TOKEN_DURATION
56
56
  obj.refresh_token_duration = REFRESH_TOKEN_DURATION
57
-
58
- obj
59
57
  end
60
58
 
61
59
 
@@ -112,6 +112,9 @@ class ClientTest < Minitest::Test
112
112
  AUTHORIZATION_DATA_TYPES = [ '<authorization-data-type0>', '<authorization-data-type1>' ]
113
113
  PAR_REQUIRED = false
114
114
  REQUEST_OBJECT_REQUIRED = true
115
+ ATTRIBUTE_KEY = '<attribute0-key>'
116
+ ATTRIBUTE_VALUE = '<attribute0-value>'
117
+ ATTRIBUTES = [ Authlete::Model::Pair.new(key: ATTRIBUTE_KEY, value: ATTRIBUTE_VALUE) ]
115
118
 
116
119
 
117
120
  def generate_json
@@ -191,7 +194,8 @@ class ClientTest < Minitest::Test
191
194
  "registrationAccessTokenHash": "<registration-access-token-hash>",
192
195
  "authorizationDataTypes": [ "<authorization-data-type0>", "<authorization-data-type1>" ],
193
196
  "parRequired": false,
194
- "requestObjectRequired": true
197
+ "requestObjectRequired": true,
198
+ "attributes": [{ "key": "<attribute0-key>", "value": "<attribute0-value>" }]
195
199
  }
196
200
  JSON
197
201
  end
@@ -273,7 +277,8 @@ class ClientTest < Minitest::Test
273
277
  registrationAccessTokenHash: '<registration-access-token-hash>',
274
278
  authorizationDataTypes: [ '<authorization-data-type0>', '<authorization-data-type1>' ],
275
279
  parRequired: false,
276
- requestObjectRequired: true
280
+ requestObjectRequired: true,
281
+ attributes: [{ key: '<attribute0-key>', value: '<attribute0-value>' }]
277
282
  }
278
283
  end
279
284
 
@@ -349,6 +354,7 @@ class ClientTest < Minitest::Test
349
354
  obj.authorization_data_types = AUTHORIZATION_DATA_TYPES
350
355
  obj.par_required = PAR_REQUIRED
351
356
  obj.request_object_required = REQUEST_OBJECT_REQUIRED
357
+ obj.attributes = ATTRIBUTES
352
358
  end
353
359
 
354
360
 
@@ -430,6 +436,8 @@ class ClientTest < Minitest::Test
430
436
  assert_equal AUTHORIZATION_DATA_TYPES, obj.authorizationDataTypes
431
437
  assert_equal PAR_REQUIRED, obj.parRequired
432
438
  assert_equal REQUEST_OBJECT_REQUIRED, obj.requestObjectRequired
439
+ assert_equal ATTRIBUTE_KEY, obj.attributes[0].key
440
+ assert_equal ATTRIBUTE_VALUE, obj.attributes[0].value
433
441
  end
434
442
 
435
443
 
@@ -46,8 +46,6 @@ class NamedUriTest < Minitest::Test
46
46
  def set_params(obj)
47
47
  obj.name = NAME
48
48
  obj.uri = URI
49
-
50
- obj
51
49
  end
52
50
 
53
51
 
@@ -46,8 +46,6 @@ class PairTest < Minitest::Test
46
46
  def set_params(obj)
47
47
  obj.key = KEY
48
48
  obj.value = VALUE
49
-
50
- obj
51
49
  end
52
50
 
53
51
 
@@ -50,8 +50,6 @@ class PropertyTest < Minitest::Test
50
50
  obj.key = KEY
51
51
  obj.value = VALUE
52
52
  obj.hidden = HIDDEN
53
-
54
- obj
55
53
  end
56
54
 
57
55
 
@@ -62,8 +62,6 @@ class ScopeTest < Minitest::Test
62
62
  obj.description = DESCRIPTION
63
63
  obj.descriptions = DESCRIPTIONS
64
64
  obj.attributes = ATTRIBUTES
65
-
66
- obj
67
65
  end
68
66
 
69
67
 
@@ -97,7 +95,7 @@ class ScopeTest < Minitest::Test
97
95
 
98
96
  def test_to_hash
99
97
  obj = Authlete::Model::Scope.new
100
- obj = set_params(obj)
98
+ set_params(obj)
101
99
  actual = obj.to_hash
102
100
  expected = generate_hash
103
101
 
@@ -139,6 +139,9 @@ class ServiceTest < Minitest::Test
139
139
  SCOPE_REQUIRED = true
140
140
  NBF_OPTIONAL = true
141
141
  ISS_SUPPRESSED = false
142
+ ATTRIBUTE_KEY = '<attribute0-key>'
143
+ ATTRIBUTE_VALUE = '<attribute0-value>'
144
+ ATTRIBUTES = [ Authlete::Model::Pair.new(key: ATTRIBUTE_KEY, value: ATTRIBUTE_VALUE) ]
142
145
 
143
146
 
144
147
  def generate_json
@@ -249,7 +252,8 @@ class ServiceTest < Minitest::Test
249
252
  "claimShortcutRestrictive": false,
250
253
  "scopeRequired": true,
251
254
  "nbfOptional": true,
252
- "issSuppressed": false
255
+ "issSuppressed": false,
256
+ "attributes": [{ "key": "<attribute0-key>", "value": "<attribute0-value>" }]
253
257
  }
254
258
  JSON
255
259
  end
@@ -362,7 +366,8 @@ class ServiceTest < Minitest::Test
362
366
  claimShortcutRestrictive: false,
363
367
  scopeRequired: true,
364
368
  nbfOptional: true,
365
- issSuppressed: false
369
+ issSuppressed: false,
370
+ attributes: [{ key: '<attribute0-key>', value: '<attribute0-value>' }]
366
371
  }
367
372
  end
368
373
 
@@ -474,8 +479,7 @@ class ServiceTest < Minitest::Test
474
479
  obj.scope_required = SCOPE_REQUIRED
475
480
  obj.nbf_optional = NBF_OPTIONAL
476
481
  obj.iss_suppressed = ISS_SUPPRESSED
477
-
478
- obj
482
+ obj.attributes = ATTRIBUTES
479
483
  end
480
484
 
481
485
 
@@ -593,6 +597,8 @@ class ServiceTest < Minitest::Test
593
597
  assert_equal SCOPE_REQUIRED, obj.scopeRequired
594
598
  assert_equal NBF_OPTIONAL, obj.nbfOptional
595
599
  assert_equal ISS_SUPPRESSED, obj.issSuppressed
600
+ assert_equal ATTRIBUTE_KEY, obj.attributes[0].key
601
+ assert_equal ATTRIBUTE_VALUE, obj.attributes[0].value
596
602
  end
597
603
 
598
604
 
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.2.0
4
+ version: 1.3.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: 2021-01-23 00:00:00.000000000 Z
12
+ date: 2021-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client