authlete 1.0.22 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -1
  3. data/Makefile +40 -0
  4. data/Rakefile +5 -0
  5. data/authlete.gemspec +2 -2
  6. data/lib/authlete.rb +28 -9
  7. data/lib/authlete/api.rb +153 -322
  8. data/lib/authlete/authentication-server.rb +2 -2
  9. data/lib/authlete/exception.rb +14 -15
  10. data/lib/authlete/model/base.rb +30 -0
  11. data/lib/authlete/model/client-extension.rb +17 -119
  12. data/lib/authlete/model/client.rb +205 -342
  13. data/lib/authlete/model/hashable.rb +13 -33
  14. data/lib/authlete/model/named-uri.rb +13 -74
  15. data/lib/authlete/model/pair.rb +13 -74
  16. data/lib/authlete/model/param-initializer.rb +45 -0
  17. data/lib/authlete/model/property.rb +15 -85
  18. data/lib/authlete/model/request/authentication-callback-request.rb +63 -55
  19. data/lib/authlete/model/request/authorization-fail-request.rb +14 -75
  20. data/lib/authlete/model/request/authorization-issue-request.rb +38 -119
  21. data/lib/authlete/model/request/authorization-request.rb +8 -73
  22. data/lib/authlete/model/request/backchannel-authentication-complete-request.rb +97 -0
  23. data/lib/authlete/model/request/backchannel-authentication-fail-request.rb +55 -0
  24. data/lib/authlete/model/request/backchannel-authentication-issue-request.rb +37 -0
  25. data/lib/authlete/model/request/backchannel-authentication-request.rb +63 -0
  26. data/lib/authlete/model/request/base.rb +26 -0
  27. data/lib/authlete/model/request/client-authorization-delete-request.rb +7 -93
  28. data/lib/authlete/model/request/client-authorization-get-list-request.rb +17 -89
  29. data/lib/authlete/model/request/client-authorization-update-request.rb +11 -86
  30. data/lib/authlete/model/request/client-registration-request.rb +49 -0
  31. data/lib/authlete/model/request/client-secret-update-request.rb +7 -89
  32. data/lib/authlete/model/request/developer-authentication-callback-request.rb +40 -43
  33. data/lib/authlete/model/request/device-authorization-request.rb +63 -0
  34. data/lib/authlete/model/request/device-complete-request.rb +99 -0
  35. data/lib/authlete/model/request/device-verification-request.rb +40 -0
  36. data/lib/authlete/model/request/granted-scopes-request.rb +8 -74
  37. data/lib/authlete/model/request/introspection-request.rb +24 -83
  38. data/lib/authlete/model/request/pushed-auth-req-request.rb +64 -0
  39. data/lib/authlete/model/request/revocation-request.rb +14 -88
  40. data/lib/authlete/model/request/standard-introspection-request.rb +8 -73
  41. data/lib/authlete/model/request/token-create-request.rb +52 -183
  42. data/lib/authlete/model/request/token-fail-request.rb +12 -74
  43. data/lib/authlete/model/request/token-issue-request.rb +22 -80
  44. data/lib/authlete/model/request/token-request.rb +44 -81
  45. data/lib/authlete/model/request/token-update-request.rb +35 -121
  46. data/lib/authlete/model/request/user-info-issue-request.rb +14 -80
  47. data/lib/authlete/model/request/user-info-request.rb +25 -70
  48. data/lib/authlete/model/response/access-token.rb +96 -0
  49. data/lib/authlete/model/response/authentication-callback-response.rb +24 -19
  50. data/lib/authlete/model/response/authorization-fail-response.rb +13 -15
  51. data/lib/authlete/model/response/authorization-issue-response.rb +29 -32
  52. data/lib/authlete/model/response/authorization-response.rb +97 -123
  53. data/lib/authlete/model/response/authorized-client-list-response.rb +37 -0
  54. data/lib/authlete/model/response/backchannel-authentication-complete-response.rb +143 -0
  55. data/lib/authlete/model/response/backchannel-authentication-fail-response.rb +47 -0
  56. data/lib/authlete/model/response/backchannel-authentication-issue-response.rb +63 -0
  57. data/lib/authlete/model/response/backchannel-authentication-response.rb +160 -0
  58. data/lib/authlete/model/response/client-list-response.rb +58 -0
  59. data/lib/authlete/model/response/client-registration-response.rb +50 -0
  60. data/lib/authlete/model/response/client-secret-refresh-response.rb +12 -12
  61. data/lib/authlete/model/response/client-secret-update-response.rb +12 -12
  62. data/lib/authlete/model/response/developer-authentication-callback-response.rb +24 -19
  63. data/lib/authlete/model/response/device-authorization-response.rb +134 -0
  64. data/lib/authlete/model/response/device-complete-response.rb +39 -0
  65. data/lib/authlete/model/response/device-verification-response.rb +96 -0
  66. data/lib/authlete/model/response/granted-scopes-get-response.rb +27 -19
  67. data/lib/authlete/model/response/introspection-response.rb +64 -58
  68. data/lib/authlete/model/response/pushed-auth-req-response.rb +59 -0
  69. data/lib/authlete/model/response/revocation-response.rb +12 -15
  70. data/lib/authlete/model/response/service-list-response.rb +54 -0
  71. data/lib/authlete/model/response/standard-introspection-response.rb +13 -15
  72. data/lib/authlete/model/response/token-create-response.rb +50 -55
  73. data/lib/authlete/model/response/token-fail-response.rb +14 -17
  74. data/lib/authlete/model/response/token-issue-response.rb +49 -62
  75. data/lib/authlete/model/response/token-list-response.rb +64 -0
  76. data/lib/authlete/model/response/token-response.rb +59 -79
  77. data/lib/authlete/model/response/token-update-response.rb +28 -23
  78. data/lib/authlete/model/response/user-info-issue-response.rb +16 -16
  79. data/lib/authlete/model/response/user-info-response.rb +48 -42
  80. data/lib/authlete/model/result.rb +14 -13
  81. data/lib/authlete/model/scope.rb +29 -119
  82. data/lib/authlete/model/service-owner.rb +32 -116
  83. data/lib/authlete/model/service.rb +491 -666
  84. data/lib/authlete/model/sns-credentials.rb +18 -91
  85. data/lib/authlete/model/tagged-value.rb +14 -69
  86. data/lib/authlete/utility.rb +3 -32
  87. data/lib/authlete/version.rb +3 -3
  88. data/test/authlete/model/request/test_authentication-callback-request.rb +100 -0
  89. data/test/authlete/model/request/test_authorization-fail-request.rb +67 -0
  90. data/test/authlete/model/request/test_authorization-issue-request.rb +94 -0
  91. data/test/authlete/model/request/test_authorization-request.rb +57 -0
  92. data/test/authlete/model/request/test_backchannel-authentication-complete-request.rb +102 -0
  93. data/test/authlete/model/request/test_backchannel-authentication-fail-request.rb +71 -0
  94. data/test/authlete/model/request/test_backchannel-authentication-issue-request.rb +57 -0
  95. data/test/authlete/model/request/test_backchannel-authentication-request.rb +75 -0
  96. data/test/authlete/model/request/test_client-authorization-delete-request.rb +57 -0
  97. data/test/authlete/model/request/test_client-authorization-get-list-request.rb +71 -0
  98. data/test/authlete/model/request/test_client-authorization-update-request.rb +63 -0
  99. data/test/authlete/model/request/test_client-registration-request.rb +68 -0
  100. data/test/authlete/model/request/test_device-authorization-request.rb +75 -0
  101. data/test/authlete/model/request/test_device-complete-request.rb +102 -0
  102. data/test/authlete/model/request/test_device-verification-request.rb +57 -0
  103. data/test/authlete/model/request/test_granted-scopes-request.rb +57 -0
  104. data/test/authlete/model/request/test_introspection-request.rb +79 -0
  105. data/test/authlete/model/request/test_pushed-auth-req-request.rb +75 -0
  106. data/test/authlete/model/request/test_revocation-request.rb +67 -0
  107. data/test/authlete/model/request/test_standard-introspection-request.rb +57 -0
  108. data/test/authlete/model/request/test_token-create-request.rb +110 -0
  109. data/test/authlete/model/request/test_token-fail-request.rb +63 -0
  110. data/test/authlete/model/request/test_token-issue-request.rb +70 -0
  111. data/test/authlete/model/request/test_token-request.rb +94 -0
  112. data/test/authlete/model/request/test_token-update-request.rb +82 -0
  113. data/test/authlete/model/request/test_user-info-issue-request.rb +67 -0
  114. data/test/authlete/model/request/test_user-info-request.rb +75 -0
  115. data/test/authlete/model/response/test_access-token.rb +101 -0
  116. data/test/authlete/model/response/test_authorization-fail-response.rb +68 -0
  117. data/test/authlete/model/response/test_authorization-issue-response.rb +92 -0
  118. data/test/authlete/model/response/test_authorization-response.rb +145 -0
  119. data/test/authlete/model/response/test_authorized-client-list-response.rb +83 -0
  120. data/test/authlete/model/response/test_backchannel-authentication-complete-response.rb +132 -0
  121. data/test/authlete/model/response/test_backchannel-authentication-fail-response.rb +68 -0
  122. data/test/authlete/model/response/test_backchannel-authentication-issue-response.rb +80 -0
  123. data/test/authlete/model/response/test_backchannel-authentication-response.rb +156 -0
  124. data/test/authlete/model/response/test_client-list-response.rb +79 -0
  125. data/test/authlete/model/response/test_client-secret-refresh-response.rb +68 -0
  126. data/test/authlete/model/response/test_client-secret-update-response.rb +68 -0
  127. data/test/authlete/model/response/test_device-authorization-response.rb +140 -0
  128. data/test/authlete/model/response/test_device-complete-response.rb +64 -0
  129. data/test/authlete/model/response/test_device-verification-response.rb +112 -0
  130. data/test/authlete/model/response/test_granted-scopes-get-response.rb +84 -0
  131. data/test/authlete/model/response/test_introspection-response.rb +127 -0
  132. data/test/authlete/model/response/test_pushed-auth-req-response.rb +76 -0
  133. data/test/authlete/model/response/test_revocation-response.rb +68 -0
  134. data/test/authlete/model/response/test_service-list-response.rb +72 -0
  135. data/test/authlete/model/response/test_standard-introspection-response.rb +68 -0
  136. data/test/authlete/model/response/test_token-create-response.rb +107 -0
  137. data/test/authlete/model/response/test_token-fail-response.rb +68 -0
  138. data/test/authlete/model/response/test_token-issue-response.rb +127 -0
  139. data/test/authlete/model/response/test_token-list-response.rb +84 -0
  140. data/test/authlete/model/response/test_token-response.rb +147 -0
  141. data/test/authlete/model/response/test_token-update-response.rb +87 -0
  142. data/test/authlete/model/response/test_user-info-issue-response.rb +68 -0
  143. data/test/authlete/model/response/test_user-info-response.rb +107 -0
  144. data/test/authlete/model/test_client-extension.rb +93 -0
  145. data/test/authlete/model/test_client.rb +469 -0
  146. data/test/authlete/model/test_named-uri.rb +83 -0
  147. data/test/authlete/model/test_pair.rb +83 -0
  148. data/test/authlete/model/test_property.rb +88 -0
  149. data/test/authlete/model/test_result.rb +68 -0
  150. data/test/authlete/model/test_scope.rb +104 -0
  151. data/test/authlete/model/test_service-owner.rb +80 -0
  152. data/test/authlete/model/test_service.rb +630 -0
  153. data/test/authlete/model/test_sns-credentials.rb +88 -0
  154. data/test/authlete/model/test_tagged-value.rb +83 -0
  155. data/test/authlete/test_exception.rb +70 -0
  156. metadata +173 -12
  157. data/lib/authlete/model/client-list.rb +0 -129
  158. data/lib/authlete/model/response/client-authorization-get-list-response.rb +0 -60
  159. data/lib/authlete/model/response/service-creatable-response.rb +0 -51
  160. data/lib/authlete/model/service-list.rb +0 -128
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -17,29 +17,30 @@
17
17
 
18
18
  module Authlete
19
19
  module Model
20
- # == Authlete::Model::Result
21
- #
22
- # The base class of responses from Authlete Web APIs.
23
- class Result
20
+ class Result < Authlete::Model::Base
24
21
  include Authlete::Utility
25
- # The code assigned to the result of the API call.
26
- # (String)
22
+
27
23
  attr_accessor :resultCode
28
24
  alias_method :result_code, :resultCode
29
25
  alias_method :result_code=, :resultCode=
30
26
 
31
- # The message about the result of the API call.
32
- # (String)
33
27
  attr_accessor :resultMessage
34
28
  alias_method :result_message, :resultMessage
35
29
  alias_method :result_message=, :resultMessage=
36
30
 
37
31
  private
38
32
 
39
- def initialize(hash = {})
40
- @resultCode = extract_value(hash, :resultCode)
41
- @resultMessage = extract_value(hash, :resultMessage)
33
+ def defaults
34
+ {
35
+ resultCode: nil,
36
+ resultMessage: nil
37
+ }
38
+ end
39
+
40
+ def set_params(hash)
41
+ @resultCode = hash[:resultCode]
42
+ @resultMessage = hash[:resultMessage]
42
43
  end
43
44
  end
44
45
  end
45
- end
46
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,144 +15,54 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class Scope < Authlete::Model::Hashable
20
+ class Scope < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
24
22
  include Authlete::Utility
25
- # The attributes of this scopes. (Pair array)
26
- attr_accessor :attributes
27
-
28
- # The description about this scope. (String)
29
- attr_accessor :description
30
23
 
31
- # The descriptions about this scope with language tags.
32
- # (TaggedValue array)
33
- attr_accessor :descriptions
34
-
35
- # The name of this scope. (String)
36
24
  attr_accessor :name
37
25
 
38
- # The flag to indicate whether this scope is included in the
39
- # default scope set. (Boolean)
40
26
  attr_accessor :defaultEntry
41
27
  alias_method :default_entry, :defaultEntry
42
28
  alias_method :default_entry=, :defaultEntry=
43
29
 
44
- private
45
-
46
- # Boolean attributes.
47
- BOOLEAN_ATTRIBUTES = ::Set.new([ :defaultEntry ])
48
-
49
- # String attributes.
50
- STRING_ATTRIBUTES = ::Set.new([ :description, :name ])
51
-
52
- # Tagged value array attributes.
53
- TAGGED_VALUE_ARRAY_ATTRIBUTES = ::Set.new([ :descriptions ])
54
-
55
- # Mapping from snake cases to camel cases.
56
- SNAKE_TO_CAMEL = { :default_entry => :defaultEntry }
57
-
58
- # The constructor
59
- def initialize(hash = nil)
60
- # Set default values to boolean attributes.
61
- BOOLEAN_ATTRIBUTES.each do |attr|
62
- send("#{attr}=", false)
63
- end
64
-
65
- # Set default values to string attributes.
66
- STRING_ATTRIBUTES.each do |attr|
67
- send("#{attr}=", nil)
68
- end
69
-
70
- # Set default values to tagged value array attributes.
71
- TAGGED_VALUE_ARRAY_ATTRIBUTES.each do |attr|
72
- send("#{attr}=", nil)
73
- end
74
-
75
- # Set attribute values using the given hash.
76
- authlete_model_update(hash)
77
- end
78
-
79
- def authlete_model_convert_key(key)
80
- key = key.to_sym
81
-
82
- # Convert snakecase to camelcase, if necessary.
83
- if SNAKE_TO_CAMEL.has_key?(key)
84
- key = SNAKE_TO_CAMEL[key]
85
- end
86
-
87
- key
88
- end
89
-
90
- def authlete_model_simple_attribute?(key)
91
- BOOLEAN_ATTRIBUTES.include?(key) or
92
- STRING_ATTRIBUTES.include?(key)
93
- end
94
-
95
- def authlete_model_update(hash)
96
- return if hash.nil?
97
-
98
- hash.each do |key, value|
99
- key = authlete_model_convert_key(key)
100
-
101
- if authlete_model_simple_attribute?(key)
102
- send("#{key}=", value)
103
- elsif TAGGED_VALUE_ARRAY_ATTRIBUTES.include?(key)
104
- # Get an array consisting of "TaggedValue" objects.
105
- parsed = get_parsed_array(value) do |element|
106
- Authlete::Model::TaggedValue.parse(element)
107
- end
108
-
109
- send("#{key}=", parsed)
110
- elsif key == :attributes
111
- @attributes = get_parsed_array(value) do |element|
112
- Authlete::Model::Pair.parse(element)
113
- end
114
- end
115
- end
30
+ attr_accessor :description
116
31
 
117
- self
118
- end
32
+ attr_accessor :descriptions
119
33
 
120
- public
34
+ attr_accessor :attributes
121
35
 
122
- # Construct an instance from the given hash.
123
- #
124
- # If the given argument is nil or is not a Hash, nil is returned.
125
- # Otherwise, Scope.new(hash) is returned.
126
- def self.parse(hash)
127
- if hash.nil? or (hash.kind_of?(Hash) == false)
128
- return nil
129
- end
36
+ private
130
37
 
131
- Authlete::Model::Scope.new(hash)
38
+ def defaults
39
+ {
40
+ name: nil,
41
+ defaultEntry: false,
42
+ description: nil,
43
+ descriptions: nil,
44
+ attributes: nil
45
+ }
132
46
  end
133
47
 
134
- # Set attribute values using the given hash.
135
- def update(hash)
136
- authlete_model_update(hash)
48
+ def set_params(hash)
49
+ @name = hash[:name]
50
+ @defaultEntry = hash[:defaultEntry]
51
+ @description = hash[:description]
52
+ @descriptions = get_parsed_array(hash[:descriptions]) { |e| Authlete::Model::TaggedValue.parse(e) }
53
+ @attributes = get_parsed_array(hash[:attributes]) { |e| Authlete::Model::Pair.parse(e) }
137
54
  end
138
55
 
139
- # Convert this object into a hash.
140
- def to_hash
141
- hash = {}
56
+ def to_hash_value(key, var)
57
+ raw_val = instance_variable_get(var)
142
58
 
143
- instance_variables.each do |var|
144
- key = var.to_s.delete("@").to_sym
145
- val = instance_variable_get(var)
146
-
147
- if authlete_model_simple_attribute?(key) or val.nil?
148
- hash[key] = val
149
- elsif key == :attributes or key == :descriptions
150
- hash[key] = val.map { |element| element.to_hash }
151
- end
59
+ case key
60
+ when :descriptions, :attributes
61
+ raw_val&.map { |e| e.to_hash }
62
+ else
63
+ raw_val
152
64
  end
153
-
154
- hash
155
65
  end
156
66
  end
157
67
  end
158
- end
68
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2018 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,139 +15,55 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class ServiceOwner < Authlete::Model::Hashable
24
- # The API key of the service owner. (Long)
25
- attr_accessor :apiKey
26
- alias_method :api_key, :apiKey
27
- alias_method :api_key=, :apiKey=
20
+ class ServiceOwner < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
22
+ include Authlete::Utility
28
23
 
29
- # The API secret of the service owner. (String)
30
- attr_accessor :apiSecret
31
- alias_method :api_secret, :apiSecret
32
- alias_method :api_secret=, :apiSecret=
24
+ attr_accessor :number
25
+
26
+ attr_accessor :name
33
27
 
34
- # The email address of the service owner. (String)
35
28
  attr_accessor :email
36
29
 
37
- # The login ID of the service owner. (String)
38
30
  attr_accessor :loginId
39
31
  alias_method :login_id, :loginId
40
32
  alias_method :login_id=, :loginId=
41
33
 
42
- # The service owner name. (String)
43
- attr_accessor :name
34
+ attr_accessor :apiKey
35
+ alias_method :api_key, :apiKey
36
+ alias_method :api_key=, :apiKey=
44
37
 
45
- # The service owner number. (Integer)
46
- attr_accessor :number
38
+ attr_accessor :apiSecret
39
+ alias_method :api_secret, :apiSecret
40
+ alias_method :api_secret=, :apiSecret=
47
41
 
48
- # The plan. (String)
49
42
  attr_accessor :plan
50
43
 
51
44
  private
52
45
 
53
- # Integer attributes.
54
- INTEGER_ATTRIBUTES = ::Set.new([
55
- :apiKey, :number
56
- ])
57
-
58
-
59
- # String attributes.
60
- STRING_ATTRIBUTES = ::Set.new([
61
- :apiSecret, :email, :loginId, :name, :plan
62
- ])
63
-
64
- # Mapping from snake cases to camel cases.
65
- SNAKE_TO_CAMEL = {
66
- :api_key => :apiKey,
67
- :api_secret => :apiSecret,
68
- :login_id => :loginId
69
- }
70
-
71
- # The constructor
72
- def initialize(hash = nil)
73
- # Set default values to integer attributes.
74
- INTEGER_ATTRIBUTES.each do |attr|
75
- send("#{attr}=", 0)
76
- end
77
-
78
- # Set default values to string attributes.
79
- STRING_ATTRIBUTES.each do |attr|
80
- send("#{attr}=", nil)
81
- end
82
-
83
- # Set attribute values using the given hash.
84
- authlete_model_update(hash)
85
- end
86
-
87
- def authlete_model_convert_key(key)
88
- key = key.to_sym
89
-
90
- # Convert snakecase to camelcase, if necessary.
91
- if SNAKE_TO_CAMEL.has_key?(key)
92
- key = SNAKE_TO_CAMEL[key]
93
- end
94
-
95
- return key
96
- end
97
-
98
- def authlete_model_simple_attribute?(key)
99
- INTEGER_ATTRIBUTES.include?(key) or
100
- STRING_ATTRIBUTES.include?(key)
101
- end
102
-
103
- def authlete_model_update(hash)
104
- return if hash.nil?
105
-
106
- hash.each do |key, value|
107
- key = authlete_model_convert_key(key)
108
-
109
- if authlete_model_simple_attribute?(key)
110
- send("#{key}=", value)
111
- end
112
- end
113
-
114
- self
115
- end
116
-
117
- public
118
-
119
- # Construct an instance from the given hash.
120
- #
121
- # If the given argument is nil or is not a Hash, nil is returned.
122
- # Otherwise, ServiceOwner.new(hash) is returned.
123
- def self.parse(hash)
124
- if hash.nil? or (hash.kind_of?(Hash) == false)
125
- return nil
126
- end
127
-
128
- ServiceOwner.new(hash)
46
+ def defaults
47
+ {
48
+ number: 0,
49
+ name: nil,
50
+ email: nil,
51
+ loginId: nil,
52
+ apiKey: nil,
53
+ apiSecret: nil,
54
+ plan: nil
55
+ }
129
56
  end
130
57
 
131
- # Set attribute values using the given hash.
132
- def update(hash)
133
- authlete_model_update(hash)
134
- end
135
-
136
- # Convert this object into a hash.
137
- def to_hash
138
- hash = {}
139
-
140
- instance_variables.each do |var|
141
- key = var.to_s.delete("@").to_sym
142
- val = instance_variable_get(var)
143
-
144
- if authlete_model_simple_attribute?(key) or val.nil?
145
- hash[key] = val
146
- end
147
- end
148
-
149
- hash
58
+ def set_params(hash)
59
+ @number = hash[:number]
60
+ @name = hash[:name]
61
+ @email = hash[:email]
62
+ @loginId = hash[:loginId]
63
+ @apiKey = hash[:apiKey]
64
+ @apiSecret = hash[:apiSecret]
65
+ @plan = hash[:plan]
150
66
  end
151
67
  end
152
68
  end
153
- end
69
+ end
@@ -1,6 +1,6 @@
1
1
  # :nodoc:
2
2
  #
3
- # Copyright (C) 2014-2019 Authlete, Inc.
3
+ # Copyright (C) 2014-2020 Authlete, Inc.
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -15,838 +15,663 @@
15
15
  # limitations under the License.
16
16
 
17
17
 
18
- require 'set'
19
-
20
-
21
18
  module Authlete
22
19
  module Model
23
- class Service < Authlete::Model::Hashable
20
+ class Service < Authlete::Model::Base
21
+ include Authlete::Model::Hashable
24
22
  include Authlete::Utility
25
- # The duration of access tokens in seconds. (Integer)
26
- attr_accessor :accessTokenDuration
27
- alias_method :access_token_duration, :accessTokenDuration
28
- alias_method :access_token_duration=, :accessTokenDuration=
29
-
30
- # The signature algorithm for access tokens. (String)
31
- attr_accessor :accessTokenSignAlg
32
- alias_method :access_token_sign_alg, :accessTokenSignAlg
33
- alias_method :access_token_sign_alg=, :accessTokenSignAlg=
34
23
 
35
- # The key ID to identify a JWK used for signing access tokens. (String)
36
- attr_accessor :accessTokenSignatureKeyId
37
- alias_method :access_token_signature_key_id, :accessTokenSignatureKeyId
38
- alias_method :access_token_signature_key_id=, :accessTokenSignatureKeyId=
24
+ attr_accessor :number
39
25
 
40
- # The access token type. (String)
41
- attr_accessor :accessTokenType
42
- alias_method :access_token_type, :accessTokenType
43
- alias_method :access_token_type=, :accessTokenType=
26
+ attr_accessor :serviceOwnerNumber
27
+ alias_method :service_owner_number, :serviceOwnerNumber
28
+ alias_method :service_owner_number=, :serviceOwnerNumber=
44
29
 
45
- # The allowable clock skew between the server and clients in seconds.
46
- # The clock skew is taken into consideration when time-related claims
47
- # in a JWT (e.g. +exp+, +iat+, +nbf+) are verified. (Integer)
48
- attr_accessor :allowableClockSkew
49
- alias_method :allowable_clock_skew, :allowableClockSkew
50
- alias_method :allowable_clock_skew=, :allowableClockSkew=
30
+ attr_accessor :serviceName
31
+ alias_method :service_name, :serviceName
32
+ alias_method :service_name=, :serviceName=
51
33
 
52
- # The API key. (Integer)
53
34
  attr_accessor :apiKey
54
35
  alias_method :api_key, :apiKey
55
36
  alias_method :api_key=, :apiKey=
56
37
 
57
- # The API secret. (String)
58
38
  attr_accessor :apiSecret
59
39
  alias_method :api_secret, :apiSecret
60
40
  alias_method :api_secret=, :apiSecret=
61
41
 
62
- # The API key to access the authentication callback endpoint. (String)
63
- attr_accessor :authenticationCallbackApiKey
64
- alias_method :authentication_callback_api_key, :authenticationCallbackApiKey
65
- alias_method :authentication_callback_api_key=, :authenticationCallbackApiKey=
66
-
67
- # The API secret to access the authentication callback endpoint. (String)
68
- attr_accessor :authenticationCallbackApiSecret
69
- alias_method :authentication_callback_api_secret, :authenticationCallbackApiSecret
70
- alias_method :authentication_callback_api_secret=, :authenticationCallbackApiSecret=
71
-
72
- # The URI of the authentication callback endpoint. (String)
73
- attr_accessor :authenticationCallbackEndpoint
74
- alias_method :authentication_callback_endpoint, :authenticationCallbackEndpoint
75
- alias_method :authentication_callback_endpoint=, :authenticationCallbackEndpoint=
42
+ attr_accessor :issuer
76
43
 
77
- # The URI of the authorization endpoint. (String)
78
44
  attr_accessor :authorizationEndpoint
79
45
  alias_method :authorization_endpoint, :authorizationEndpoint
80
46
  alias_method :authorization_endpoint=, :authorizationEndpoint=
81
47
 
82
- # The duration of access tokens in seconds; the value of +expires_in+
83
- # in access token responses. (Integer)
84
- attr_accessor :authorizationResponseDuration
85
- alias_method :authorization_response_duration, :authorizationResponseDuration
86
- alias_method :authorization_response_duration=, :authorizationResponseDuration=
48
+ attr_accessor :tokenEndpoint
49
+ alias_method :token_endpoint, :tokenEndpoint
50
+ alias_method :token_endpoint=, :tokenEndpoint=
87
51
 
88
- # The key ID to identify a JWK used for signing authorization responses
89
- # using an asymmetric key. (String)
90
- attr_accessor :authorizationSignatureKeyId
91
- alias_method :authorization_signature_key_id, :authorizationSignatureKeyId
92
- alias_method :authorization_signature_key_id=, :authorizationSignatureKeyId=
52
+ attr_accessor :revocationEndpoint
53
+ alias_method :revocation_endpoint, :revocationEndpoint
54
+ alias_method :revocation_endpoint=, :revocationEndpoint=
93
55
 
94
- # The URI of the backchannel authentication endpoint. (String)
95
- attr_accessor :backchannelAuthenticationEndpoint
96
- alias_method :backchannel_authentication_endpoint, :backchannelAuthenticationEndpoint
97
- alias_method :backchannel_authentication_endpoint=, :backchannelAuthenticationEndpoint=
56
+ attr_accessor :supportedRevocationAuthMethods
57
+ alias_method :supported_revocation_auth_methods, :supportedRevocationAuthMethods
58
+ alias_method :supported_revocation_auth_methods=, :supportedRevocationAuthMethods=
98
59
 
99
- # The duration of backchannel authentication request IDs in seconds.
100
- # (Integer)
101
- attr_accessor :backchannelAuthReqIdDuration
102
- alias_method :backchannel_auth_req_id_duration, :backchannelAuthReqIdDuration
103
- alias_method :backchannel_auth_req_id_duration=, :backchannelAuthReqIdDuration=
60
+ attr_accessor :userInfoEndpoint
61
+ alias_method :user_info_endpoint, :userInfoEndpoint
62
+ alias_method :user_info_endpoint=, :userInfoEndpoint=
104
63
 
105
- # The flag indicating whether the +binding_message+ request parameter
106
- # is always required whenever a backchannel authentication request is
107
- # judged as a request for Financial-grade API. (Boolean)
108
- attr_accessor :backchannelBindingMessageRequiredInFapi
109
- alias_method :backchannel_binding_message_required_in_fapi, :backchannelBindingMessageRequiredInFapi
110
- alias_method :backchannel_binding_message_required_in_fapi=, :backchannelBindingMessageRequiredInFapi=
64
+ attr_accessor :jwksUri
65
+ alias_method :jwks_uri, :jwksUri
66
+ alias_method :jwks_uri=, :jwksUri=
111
67
 
112
- # The minimum interval between polling requests in seconds. (Integer)
113
- attr_accessor :backchannelPollingInterval
114
- alias_method :backchannel_polling_interval, :backchannelPollingInterval
115
- alias_method :backchannel_polling_interval=, :backchannelPollingInterval=
68
+ attr_accessor :jwks
116
69
 
117
- # The flag which indicates whether the +user_code+ request parameter
118
- # is supported at the backchannel authentication endpoint. (Boolean)
119
- attr_accessor :backchannelUserCodeParameterSupported
120
- alias_method :backchannel_user_code_parameter_supported, :backchannelUserCodeParameterSupported
121
- alias_method :backchannel_user_code_parameter_supported=, :backchannelUserCodeParameterSupported=
70
+ attr_accessor :registrationEndpoint
71
+ alias_method :registration_endpoint, :registrationEndpoint
72
+ alias_method :registration_endpoint=, :registrationEndpoint=
122
73
 
123
- # The flag which indicates whether the 'Client ID Alias' feature
124
- # is enabled or not. (Boolean)
125
- attr_accessor :clientIdAliasEnabled
126
- alias_method :client_id_alias_enabled, :clientIdAliasEnabled
127
- alias_method :client_id_alias_enabled=, :clientIdAliasEnabled=
74
+ attr_accessor :registrationManagementEndpoint
75
+ alias_method :registration_management_endpoint, :registrationManagementEndpoint
76
+ alias_method :registration_management_endpoint=, :registrationManagementEndpoint=
128
77
 
129
- # The number of client applications that one developer can create.
130
- # 0 means no limit. (Integer)
131
- attr_accessor :clientsPerDeveloper
132
- alias_method :clients_per_developer, :clientsPerDeveloper
133
- alias_method :clients_per_developer=, :clientsPerDeveloper=
78
+ attr_accessor :supportedScopes
79
+ alias_method :supported_scopes, :supportedScopes
80
+ alias_method :supported_scopes=, :supportedScopes=
81
+
82
+ attr_accessor :supportedResponseTypes
83
+ alias_method :supported_response_types, :supportedResponseTypes
84
+ alias_method :supported_response_types=, :supportedResponseTypes=
85
+
86
+ attr_accessor :supportedGrantTypes
87
+ alias_method :supported_grant_types, :supportedGrantTypes
88
+ alias_method :supported_grant_types=, :supportedGrantTypes=
89
+
90
+ attr_accessor :supportedAcrs
91
+ alias_method :supported_acrs, :supportedAcrs
92
+ alias_method :supported_acrs=, :supportedAcrs=
93
+
94
+ attr_accessor :supportedTokenAuthMethods
95
+ alias_method :supported_token_auth_methods, :supportedTokenAuthMethods
96
+ alias_method :supported_token_auth_methods=, :supportedTokenAuthMethods=
97
+
98
+ attr_accessor :supportedDisplays
99
+ alias_method :supported_displays, :supportedDisplays
100
+ alias_method :supported_displays=, :supportedDisplays=
101
+
102
+ attr_accessor :supportedClaimTypes
103
+ alias_method :supported_claim_types, :supportedClaimTypes
104
+ alias_method :supported_claim_types=, :supportedClaimTypes=
105
+
106
+ attr_accessor :supportedClaims
107
+ alias_method :supported_claims, :supportedClaims
108
+ alias_method :supported_claims=, :supportedClaims=
109
+
110
+ attr_accessor :serviceDocumentation
111
+ alias_method :service_documentation, :serviceDocumentation
112
+ alias_method :service_documentation=, :serviceDocumentation=
113
+
114
+ attr_accessor :supportedClaimLocales
115
+ alias_method :supported_claim_locales, :supportedClaimLocales
116
+ alias_method :supported_claim_locales=, :supportedClaimLocales=
117
+
118
+ attr_accessor :supportedUiLocales
119
+ alias_method :supported_ui_locales, :supportedUiLocales
120
+ alias_method :supported_ui_locales=, :supportedUiLocales=
121
+
122
+ attr_accessor :policyUri
123
+ alias_method :policy_uri, :policyUri
124
+ alias_method :policy_uri=, :policyUri=
125
+
126
+ attr_accessor :tosUri
127
+ alias_method :tos_uri, :tosUri
128
+ alias_method :tos_uri=, :tosUri=
129
+
130
+ attr_accessor :authenticationCallbackEndpoint
131
+ alias_method :authentication_callback_endpoint, :authenticationCallbackEndpoint
132
+ alias_method :authentication_callback_endpoint=, :authenticationCallbackEndpoint=
133
+
134
+ attr_accessor :authenticationCallbackApiKey
135
+ alias_method :authentication_callback_api_key, :authenticationCallbackApiKey
136
+ alias_method :authentication_callback_api_key=, :authenticationCallbackApiKey=
137
+
138
+ attr_accessor :authenticationCallbackApiSecret
139
+ alias_method :authentication_callback_api_secret, :authenticationCallbackApiSecret
140
+ alias_method :authentication_callback_api_secret=, :authenticationCallbackApiSecret=
141
+
142
+ attr_accessor :supportedSnses
143
+ alias_method :supported_snses, :supportedSnses
144
+ alias_method :supported_snses=, :supportedSnses=
145
+
146
+ attr_accessor :snsCredentials
147
+ alias_method :sns_credentials, :snsCredentials
148
+ alias_method :sns_credentials=, :snsCredentials=
134
149
 
135
- # The timestamp at which the service was created. (Integer)
136
150
  attr_accessor :createdAt
137
151
  alias_method :created_at, :createdAt
138
152
  alias_method :created_at=, :createdAt=
139
153
 
140
- # The description of this service. (String)
141
- attr_accessor :description
154
+ attr_accessor :modifiedAt
155
+ alias_method :modified_at, :modifiedAt
156
+ alias_method :modified_at=, :modifiedAt=
157
+
158
+ attr_accessor :developerAuthenticationCallbackEndpoint
159
+ alias_method :developer_authentication_callback_endpoint, :developerAuthenticationCallbackEndpoint
160
+ alias_method :developer_authentication_callback_endpoint=, :developerAuthenticationCallbackEndpoint=
142
161
 
143
- # The API key to access the developer authentication callback endpoint. (String)
144
162
  attr_accessor :developerAuthenticationCallbackApiKey
145
163
  alias_method :developer_authentication_callback_api_key, :developerAuthenticationCallbackApiKey
146
164
  alias_method :developer_authentication_callback_api_key=, :developerAuthenticationCallbackApiKey=
147
165
 
148
- # The API secret to access the developer authentication callback endpoint. (String)
149
166
  attr_accessor :developerAuthenticationCallbackApiSecret
150
167
  alias_method :developer_authentication_callback_api_secret, :developerAuthenticationCallbackApiSecret
151
168
  alias_method :developer_authentication_callback_api_secret=, :developerAuthenticationCallbackApiSecret=
152
169
 
153
- # The URI of the developer authentication callback endpoint. (String)
154
- attr_accessor :developerAuthenticationCallbackEndpoint
155
- alias_method :developer_authentication_callback_endpoint, :developerAuthenticationCallbackEndpoint
156
- alias_method :developer_authentication_callback_endpoint=, :developerAuthenticationCallbackEndpoint=
170
+ attr_accessor :supportedDeveloperSnses
171
+ alias_method :supported_developer_snses, :supportedDeveloperSnses
172
+ alias_method :supported_developer_snses=, :supportedDeveloperSnses=
157
173
 
158
- # The list of SNS credentials for developer login. (SnsCredentials array)
159
174
  attr_accessor :developerSnsCredentials
160
175
  alias_method :developer_sns_credentials, :developerSnsCredentials
161
176
  alias_method :developer_sns_credentials=, :developerSnsCredentials=
162
177
 
163
- # The URI of the device authorization endpoint. (String)
164
- attr_accessor :deviceAuthorizationEndpoint
165
- alias_method :device_authorization_endpoint, :deviceAuthorizationEndpoint
166
- alias_method :device_authorization_endpoint=, :deviceAuthorizationEndpoint=
167
-
168
- # The duration of device verification codes (device_code) and
169
- # end-user verification codes (user_code) in seconds. (Integer)
170
- attr_accessor :deviceFlowCodeDuration
171
- alias_method :device_flow_code_duration, :deviceFlowCodeDuration
172
- alias_method :device_flow_code_duration=, :deviceFlowCodeDuration=
173
-
174
- # The minimum interval between polling requests in Device Flow in seconds. (Integer)
175
- attr_accessor :deviceFlowPollingInterval
176
- alias_method :device_flow_polling_interval, :deviceFlowPollingInterval
177
- alias_method :device_flow_polling_interval=, :deviceFlowPollingInterval=
178
-
179
- # The verification URI for Device Flow. (String)
180
- attr_accessor :deviceVerificationUri
181
- alias_method :device_verification_uri, :deviceVerificationUri
182
- alias_method :device_verification_uri=, :deviceVerificationUri=
183
-
184
- # The verification URI for Device Flow with a placeholder for a user code. (String)
185
- attr_accessor :deviceVerificationUriComplete
186
- alias_method :device_verification_uri_complete, :deviceVerificationUriComplete
187
- alias_method :device_verification_uri_complete=, :deviceVerificationUriComplete=
178
+ attr_accessor :clientsPerDeveloper
179
+ alias_method :clients_per_developer, :clientsPerDeveloper
180
+ alias_method :clients_per_developer=, :clientsPerDeveloper=
188
181
 
189
- # The flag to indicate whether the direct authorization endpoint
190
- # is enabled or not. The path of the endpoint is
191
- # <code>/api/auth/authorization/direct/{serviceApiKey}</code>.
192
- # (Boolean)
193
182
  attr_accessor :directAuthorizationEndpointEnabled
194
183
  alias_method :direct_authorization_endpoint_enabled, :directAuthorizationEndpointEnabled
195
184
  alias_method :direct_authorization_endpoint_enabled=, :directAuthorizationEndpointEnabled=
196
185
 
197
- # The flag to indicate whether the direct introspection endpoint
198
- # is enabled or not. The path of the endpoint is
199
- # <code>/api/auth/introspection/direct/{serviceApiKey}</code>.
200
- # (Boolean)
201
- attr_accessor :directIntrospectionEndpointEnabled
202
- alias_method :direct_introspection_endpoint_enabled, :directIntrospectionEndpointEnabled
203
- alias_method :direct_introspection_endpoint_enabled=, :directIntrospectionEndpointEnabled=
204
-
205
- # The flag to indicate whether the direct jwks endpoint
206
- # is enabled or not. The path of the endpoint is
207
- # <code>/api/service/jwks/get/direct/{serviceApiKey}</code>.
208
- # (Boolean)
209
- attr_accessor :directJwksEndpointEnabled
210
- alias_method :direct_jwks_endpoint_enabled, :directJwksEndpointEnabled
211
- alias_method :direct_jwks_endpoint_enabled=, :directJwksEndpointEnabled=
186
+ attr_accessor :directTokenEndpointEnabled
187
+ alias_method :direct_token_endpoint_enabled, :directTokenEndpointEnabled
188
+ alias_method :direct_token_endpoint_enabled=, :directTokenEndpointEnabled=
212
189
 
213
- # The flag to indicate whether the direct revocation endpoint
214
- # is enabled or not. The path of the endpoint is
215
- # <code>/api/auth/revocation/direct/{serviceApiKey}</code>.
216
- # (Boolean)
217
190
  attr_accessor :directRevocationEndpointEnabled
218
191
  alias_method :direct_revocation_endpoint_enabled, :directRevocationEndpointEnabled
219
192
  alias_method :direct_revocation_endpoint_enabled=, :directRevocationEndpointEnabled=
220
193
 
221
- # The flag to indicate whether the direct token endpoint
222
- # is enabled or not. The path of the endpoint is
223
- # <code>/api/auth/token/direct/{serviceApiKey}</code>.
224
- # (Boolean)
225
- attr_accessor :directTokenEndpointEnabled
226
- alias_method :direct_token_endpoint_enabled, :directTokenEndpointEnabled
227
- alias_method :direct_token_endpoint_enabled=, :directTokenEndpointEnabled=
228
-
229
- # The flag to indicate whether the direct user info endpoint
230
- # is enabled or not. The path of the endpoint is
231
- # <code>/api/auth/userinfo/direct/{serviceApiKey}</code>.
232
- # (Boolean)
233
194
  attr_accessor :directUserInfoEndpointEnabled
234
195
  alias_method :direct_user_info_endpoint_enabled, :directUserInfoEndpointEnabled
235
196
  alias_method :direct_user_info_endpoint_enabled=, :directUserInfoEndpointEnabled=
236
197
 
237
- # The flag to indicate whether the <code>error_description</code>
238
- # response parameter is omitted. (Boolean)
198
+ attr_accessor :directJwksEndpointEnabled
199
+ alias_method :direct_jwks_endpoint_enabled, :directJwksEndpointEnabled
200
+ alias_method :direct_jwks_endpoint_enabled=, :directJwksEndpointEnabled=
201
+
202
+ attr_accessor :directIntrospectionEndpointEnabled
203
+ alias_method :direct_introspection_endpoint_enabled, :directIntrospectionEndpointEnabled
204
+ alias_method :direct_introspection_endpoint_enabled=, :directIntrospectionEndpointEnabled=
205
+
206
+ attr_accessor :singleAccessTokenPerSubject
207
+ alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
208
+ alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
209
+
210
+ attr_accessor :pkceRequired
211
+ alias_method :pkce_required, :pkceRequired
212
+ alias_method :pkce_required=, :pkceRequired=
213
+
214
+ attr_accessor :pkceS256Required
215
+ alias_method :pkce_s256_required, :pkceS256Required
216
+ alias_method :pkce_s256_required=, :pkceS256Required=
217
+
218
+ attr_accessor :refreshTokenKept
219
+ alias_method :refresh_token_kept, :refreshTokenKept
220
+ alias_method :refresh_token_kept=, :refreshTokenKept=
221
+
222
+ attr_accessor :refreshTokenDurationKept
223
+ alias_method :refresh_token_duration_kept, :refreshTokenDurationKept
224
+ alias_method :refresh_token_duration_kept=, :refreshTokenDurationKept=
225
+
239
226
  attr_accessor :errorDescriptionOmitted
240
227
  alias_method :error_description_omitted, :errorDescriptionOmitted
241
228
  alias_method :error_description_omitted=, :errorDescriptionOmitted=
242
229
 
243
- # The flag to indicate whether the <code>error_uri</code>
244
- # response parameter is omitted. (Boolean)
245
230
  attr_accessor :errorUriOmitted
246
231
  alias_method :error_uri_omitted, :errorUriOmitted
247
232
  alias_method :error_uri_omitted=, :errorUriOmitted=
248
233
 
249
- # The duration of ID tokens in seconds. (Integer)
250
- attr_accessor :idTokenDuration
251
- alias_method :id_token_duration, :idTokenDuration
252
- alias_method :id_token_duration=, :idTokenDuration=
234
+ attr_accessor :clientIdAliasEnabled
235
+ alias_method :client_id_alias_enabled, :clientIdAliasEnabled
236
+ alias_method :client_id_alias_enabled=, :clientIdAliasEnabled=
253
237
 
254
- # The key ID to identify a JWK used for ID token signature using an
255
- # asymmetric key. (String)
256
- attr_accessor :idTokenSignatureKeyId
257
- alias_method :id_token_signature_key_id, :idTokenSignatureKeyId
258
- alias_method :id_token_signature_key_id=, :idTokenSignatureKeyId=
238
+ attr_accessor :supportedServiceProfiles
239
+ alias_method :supported_service_profiles, :supportedServiceProfiles
240
+ alias_method :supported_service_profiles=, :supportedServiceProfiles=
241
+
242
+ attr_accessor :tlsClientCertificateBoundAccessTokens
243
+ alias_method :tls_client_certificate_bound_access_tokens, :tlsClientCertificateBoundAccessTokens
244
+ alias_method :tls_client_certificate_bound_access_tokens=, :tlsClientCertificateBoundAccessTokens=
259
245
 
260
- # The URI of the introspection endpoint. (String)
261
246
  attr_accessor :introspectionEndpoint
262
247
  alias_method :introspection_endpoint, :introspectionEndpoint
263
248
  alias_method :introspection_endpoint=, :introspectionEndpoint=
264
249
 
265
- # The issuer identifier of this OpenID Provider. (String)
266
- attr_accessor :issuer
267
-
268
- # The JSON Web Key Set of this service. (String)
269
- attr_accessor :jwks
270
-
271
- # The URI of the service's JSON Web Key Set. (String)
272
- attr_accessor :jwksUri
273
- alias_method :jwks_uri, :jwksUri
274
- alias_method :jwks_uri=, :jwksUri=
275
-
276
- # The metadata of the service. (Pair Array)
277
- attr_accessor :metadata
250
+ attr_accessor :supportedIntrospectionAuthMethods
251
+ alias_method :supported_introspection_auth_methods, :supportedIntrospectionAuthMethods
252
+ alias_method :supported_introspection_auth_methods=, :supportedIntrospectionAuthMethods=
278
253
 
279
- # The timestamp at which the service was modified. (Integer)
280
- attr_accessor :modifiedAt
281
- alias_method :modified_at, :modifiedAt
282
- alias_method :modified_at=, :modifiedAt=
283
-
284
- # The flag that indicates whether the service will validate the PKI certificate chain
285
- # for MTLS based authentication. (Boolean)
286
254
  attr_accessor :mutualTlsValidatePkiCertChain
287
255
  alias_method :mutual_tls_validate_pki_cert_chain, :mutualTlsValidatePkiCertChain
288
256
  alias_method :mutual_tls_validate_pki_cert_chain=, :mutualTlsValidatePkiCertChain=
289
257
 
290
- # The service number. (Integer)
291
- attr_accessor :number
292
-
293
- # The flag to indicate whether the use of Proof Key for Code
294
- # Exchange (PKCE) is always required for authorization requests
295
- # Authorization Code Flow.
296
- # (Boolean)
297
- attr_accessor :pkceRequired
298
- alias_method :pkce_required, :pkceRequired
299
- alias_method :pkce_required=, :pkceRequired=
300
-
301
- # The flag indicating whether S256 is required as the code challenge
302
- # method whenever PKCE is used. (Boolean)
303
- attr_accessor :pkceS256Required
304
- alias_method :pkce_s256_required, :pkceS256Required
305
- alias_method :pkce_s256_required=, :pkceS256Required=
306
-
307
- # The URI of the service's policy page. (String)
308
- attr_accessor :policyUri
309
- alias_method :policy_uri, :policyUri
310
- alias_method :policy_uri=, :policyUri=
258
+ attr_accessor :trustedRootCertificates
259
+ alias_method :trusted_root_certificates, :trustedRootCertificates
260
+ alias_method :trusted_root_certificates=, :trustedRootCertificates=
311
261
 
312
- # The duration of refresh tokens in seconds. (Integer)
313
- attr_accessor :refreshTokenDuration
314
- alias_method :refresh_token_duration, :refreshTokenDuration
315
- alias_method :refresh_token_duration=, :refreshTokenDuration=
262
+ attr_accessor :dynamicRegistrationSupported
263
+ alias_method :dynamic_registration_supported, :dynamicRegistrationSupported
264
+ alias_method :dynamic_registration_supported=, :dynamicRegistrationSupported=
316
265
 
317
- # The flag to indicate whether a refresh token remains unchanged
318
- # or gets renewed after its use.
319
- # (Boolean)
320
- attr_accessor :refreshTokenKept
321
- alias_method :refresh_token_kept, :refreshTokenKept
322
- alias_method :refresh_token_kept=, :refreshTokenKept=
266
+ attr_accessor :endSessionEndpoint
267
+ alias_method :end_session_endpoint, :endSessionEndpoint
268
+ alias_method :end_session_endpoint=, :endSessionEndpoint=
323
269
 
324
- # The URI of the registration endpoint. (String)
325
- attr_accessor :registrationEndpoint
326
- alias_method :registration_endpoint, :registrationEndpoint
327
- alias_method :registration_endpoint=, :registrationEndpoint=
270
+ attr_accessor :description
328
271
 
329
- # The URI of the token revocation endpoint. (String)
330
- attr_accessor :revocationEndpoint
331
- alias_method :revocation_endpoint, :revocationEndpoint
332
- alias_method :revocation_endpoint=, :revocationEndpoint=
272
+ attr_accessor :accessTokenType
273
+ alias_method :access_token_type, :accessTokenType
274
+ alias_method :access_token_type=, :accessTokenType=
333
275
 
334
- # The URI of the service's documentation. (String)
335
- attr_accessor :serviceDocumentation
336
- alias_method :service_documentation, :serviceDocumentation
337
- alias_method :service_documentation=, :serviceDocumentation=
276
+ attr_accessor :accessTokenSignAlg
277
+ alias_method :access_token_sign_alg, :accessTokenSignAlg
278
+ alias_method :access_token_sign_alg=, :accessTokenSignAlg=
338
279
 
339
- # The service name. (String)
340
- attr_accessor :serviceName
341
- alias_method :service_name, :serviceName
342
- alias_method :service_name=, :serviceName=
280
+ attr_accessor :accessTokenDuration
281
+ alias_method :access_token_duration, :accessTokenDuration
282
+ alias_method :access_token_duration=, :accessTokenDuration=
343
283
 
344
- # The service owner number. (Integer)
345
- attr_accessor :serviceOwnerNumber
346
- alias_method :service_owner_number, :serviceOwnerNumber
347
- alias_method :service_owner_number=, :serviceOwnerNumber=
284
+ attr_accessor :refreshTokenDuration
285
+ alias_method :refresh_token_duration, :refreshTokenDuration
286
+ alias_method :refresh_token_duration=, :refreshTokenDuration=
348
287
 
349
- # The flag to indicate whether the number of access tokens
350
- # per subject (and per client) is at most one or can be more. (Boolean)
351
- attr_accessor :singleAccessTokenPerSubject
352
- alias_method :single_access_token_per_subject, :singleAccessTokenPerSubject
353
- alias_method :single_access_token_per_subject=, :singleAccessTokenPerSubject=
288
+ attr_accessor :idTokenDuration
289
+ alias_method :id_token_duration, :idTokenDuration
290
+ alias_method :id_token_duration=, :idTokenDuration=
354
291
 
355
- # The list of SNS credentials. (SnsCredentials array)
356
- attr_accessor :snsCredentials
357
- alias_method :sns_credentials, :snsCredentials
358
- alias_method :sns_credentials=, :snsCredentials=
292
+ attr_accessor :authorizationResponseDuration
293
+ alias_method :authorization_response_duration, :authorizationResponseDuration
294
+ alias_method :authorization_response_duration=, :authorizationResponseDuration=
359
295
 
360
- # The list of supported ACRs. (String array)
361
- attr_accessor :supportedAcrs
362
- alias_method :supported_acrs, :supportedAcrs
363
- alias_method :supported_acrs=, :supportedAcrs=
296
+ attr_accessor :pushedAuthReqDuration
297
+ alias_method :pushed_auth_req_duration, :pushedAuthReqDuration
298
+ alias_method :pushed_auth_req_duration=, :pushedAuthReqDuration=
364
299
 
365
- # The list of supported claim locales. (String array)
366
- attr_accessor :supportedClaimLocales
367
- alias_method :supported_claim_locales, :supportedClaimLocales
368
- alias_method :supported_claim_locales=, :supportedClaimLocales=
300
+ attr_accessor :metadata
369
301
 
370
- # The list of supported claims. (String array)
371
- attr_accessor :supportedClaims
372
- alias_method :supported_claims, :supportedClaims
373
- alias_method :supported_claims=, :supportedClaims=
302
+ attr_accessor :accessTokenSignatureKeyId
303
+ alias_method :access_token_signature_key_id, :accessTokenSignatureKeyId
304
+ alias_method :access_token_signature_key_id=, :accessTokenSignatureKeyId=
374
305
 
375
- # The list of supported claim types. (String array)
376
- #
377
- # Valid values are "NORMAL", "AGGREGATED" and "DISTRIBUTED".
378
- attr_accessor :supportedClaimTypes
379
- alias_method :supported_claim_types, :supportedClaimTypes
380
- alias_method :supported_claim_types=, :supportedClaimTypes=
306
+ attr_accessor :authorizationSignatureKeyId
307
+ alias_method :authorization_signature_key_id, :authorizationSignatureKeyId
308
+ alias_method :authorization_signature_key_id=, :authorizationSignatureKeyId=
381
309
 
382
- # The list of supported SNSes for developer login. (Sns array)
383
- attr_accessor :supportedDeveloperSnses
384
- alias_method :supported_developer_snses, :supportedDeveloperSnses
385
- alias_method :supported_developer_snses=, :supportedDeveloperSnses=
310
+ attr_accessor :idTokenSignatureKeyId
311
+ alias_method :id_token_signature_key_id, :idTokenSignatureKeyId
312
+ alias_method :id_token_signature_key_id=, :idTokenSignatureKeyId=
386
313
 
387
- # The list of supported values of +display+ parameter. (String array)
388
- #
389
- # Valid values are "PAGE", "POPUP", "TOUCH" and "WAP".
390
- attr_accessor :supportedDisplays
391
- alias_method :supported_displays, :supportedDisplays
392
- alias_method :supported_displays=, :supportedDisplays=
314
+ attr_accessor :userInfoSignatureKeyId
315
+ alias_method :user_info_signature_key_id, :userInfoSignatureKeyId
316
+ alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId=
393
317
 
394
- # The list of supported grant types. (String array)
395
- #
396
- # Valid values are "AUTHORIZATION_CODE", "IMPLICIT", "PASSWORD",
397
- # "CLIENT_CREDENTIALS" and "REFRESH_TOKEN".
398
- attr_accessor :supportedGrantTypes
399
- alias_method :supported_grant_types, :supportedGrantTypes
400
- alias_method :supported_grant_types=, :supportedGrantTypes=
318
+ attr_accessor :supportedBackchannelTokenDeliveryModes
319
+ alias_method :supported_backchannel_token_delivery_modes, :supportedBackchannelTokenDeliveryModes
320
+ alias_method :supported_backchannel_token_delivery_modes=, :supportedBackchannelTokenDeliveryModes=
401
321
 
402
- # The list of supported response types. (String array)
403
- #
404
- # Valid values are "NONE", "CODE", "TOKEN", "ID_TOKEN",
405
- # "CODE_TOKEN", "CODE_ID_TOKEN", "ID_TOKEN_TOKEN" and
406
- # "CODE_ID_TOKEN_TOKEN".
407
- attr_accessor :supportedResponseTypes
408
- alias_method :supported_response_types, :supportedResponseTypes
409
- alias_method :supported_response_types=, :supportedResponseTypes=
322
+ attr_accessor :backchannelAuthenticationEndpoint
323
+ alias_method :backchannel_authentication_endpoint, :backchannelAuthenticationEndpoint
324
+ alias_method :backchannel_authentication_endpoint=, :backchannelAuthenticationEndpoint=
410
325
 
411
- # The list of supported scopes. (Scope array)
412
- attr_accessor :supportedScopes
413
- alias_method :supported_scopes, :supportedScopes
414
- alias_method :supported_scopes=, :supportedScopes=
326
+ attr_accessor :backchannelUserCodeParameterSupported
327
+ alias_method :backchannel_user_code_parameter_supported, :backchannelUserCodeParameterSupported
328
+ alias_method :backchannel_user_code_parameter_supported=, :backchannelUserCodeParameterSupported=
415
329
 
416
- # The list of supported service profiles. (String array)
417
- attr_accessor :supportedServiceProfiles
418
- alias_method :supported_service_profiles, :supportedServiceProfiles
419
- alias_method :supported_service_profiles=, :supportedServiceProfiles=
330
+ attr_accessor :backchannelAuthReqIdDuration
331
+ alias_method :backchannel_auth_req_id_duration, :backchannelAuthReqIdDuration
332
+ alias_method :backchannel_auth_req_id_duration=, :backchannelAuthReqIdDuration=
420
333
 
421
- # The list of supported SNSes. (Sns array)
422
- attr_accessor :supportedSnses
423
- alias_method :supported_snses, :supportedSnses
424
- alias_method :supported_snses=, :supportedSnses=
334
+ attr_accessor :backchannelPollingInterval
335
+ alias_method :backchannel_polling_interval, :backchannelPollingInterval
336
+ alias_method :backchannel_polling_interval=, :backchannelPollingInterval=
425
337
 
426
- # The list of supported client authentication methods at the token endpoint. (String array)
427
- #
428
- # Valid values are "NONE", "CLIENT_SECRET_BASIC", "CLIENT_SECRET_POST",
429
- # "CLIENT_SECRET_JWT" and "PRIVATE_KEY_JWT".
430
- attr_accessor :supportedTokenAuthMethods
431
- alias_method :supported_token_auth_methods, :supportedTokenAuthMethods
432
- alias_method :supported_token_auth_methods=, :supportedTokenAuthMethods=
338
+ attr_accessor :backchannelBindingMessageRequiredInFapi
339
+ alias_method :backchannel_binding_message_required_in_fapi, :backchannelBindingMessageRequiredInFapi
340
+ alias_method :backchannel_binding_message_required_in_fapi=, :backchannelBindingMessageRequiredInFapi=
433
341
 
434
- # The list of supported backchannel token delivery modes. (String array)
435
- # Valid values are "POLL", "PING" and "PUSH".
436
- attr_accessor :supportedBackchannelTokenDeliveryModes
437
- alias_method :supported_backchannel_token_delivery_modes, :supportedBackchannelTokenDeliveryModes
438
- alias_method :supported_backchannel_token_delivery_modes=, :supportedBackchannelTokenDeliveryModes=
342
+ attr_accessor :allowableClockSkew
343
+ alias_method :allowable_clock_skew, :allowableClockSkew
344
+ alias_method :allowable_clock_skew=, :allowableClockSkew=
439
345
 
440
- # The list of supported UI locales. (String array)
441
- attr_accessor :supportedUiLocales
442
- alias_method :supported_ui_locales, :supportedUiLocales
443
- alias_method :supported_ui_locales=, :supportedUiLocales=
346
+ attr_accessor :deviceAuthorizationEndpoint
347
+ alias_method :device_authorization_endpoint, :deviceAuthorizationEndpoint
348
+ alias_method :device_authorization_endpoint=, :deviceAuthorizationEndpoint=
444
349
 
445
- # The flag that indicates whether the service offers TLS client certificate
446
- # bound access tokens (Boolean)
447
- attr_accessor :tlsClientCertificateBoundAccessTokens
448
- alias_method :tls_client_certificate_bound_access_tokens, :tlsClientCertificateBoundAccessTokens
449
- alias_method :tls_client_certificate_bound_access_tokens=, :tlsClientCertificateBoundAccessTokens=
350
+ attr_accessor :deviceVerificationUri
351
+ alias_method :device_verification_uri, :deviceVerificationUri
352
+ alias_method :device_verification_uri=, :deviceVerificationUri=
450
353
 
451
- # The URI of the token endpoint. (String)
452
- attr_accessor :tokenEndpoint
453
- alias_method :token_endpoint, :tokenEndpoint
454
- alias_method :token_endpoint=, :tokenEndpoint=
354
+ attr_accessor :deviceVerificationUriComplete
355
+ alias_method :device_verification_uri_complete, :deviceVerificationUriComplete
356
+ alias_method :device_verification_uri_complete=, :deviceVerificationUriComplete=
455
357
 
456
- # The URI of the service's "Terms Of Service" page. (String)
457
- attr_accessor :tosUri
458
- alias_method :tos_uri, :tosUri
459
- alias_method :tos_uri=, :tosUri=
358
+ attr_accessor :deviceFlowCodeDuration
359
+ alias_method :device_flow_code_duration, :deviceFlowCodeDuration
360
+ alias_method :device_flow_code_duration=, :deviceFlowCodeDuration=
460
361
 
461
- # The list of trusted root certificates, used when the service validates client
462
- # certificate paths. (String array)
463
- attr_accessor :trustedRootCertificates
464
- alias_method :trusted_root_certificates, :trustedRootCertificates
465
- alias_method :trusted_root_certificates=, :trustedRootCertificates=
362
+ attr_accessor :deviceFlowPollingInterval
363
+ alias_method :device_flow_polling_interval, :deviceFlowPollingInterval
364
+ alias_method :device_flow_polling_interval=, :deviceFlowPollingInterval=
466
365
 
467
- # The character set for user codes. (String)
468
366
  attr_accessor :userCodeCharset
469
367
  alias_method :user_code_charset, :userCodeCharset
470
368
  alias_method :user_code_charset=, :userCodeCharset=
471
369
 
472
- # The length of user codes. (Integer)
473
370
  attr_accessor :userCodeLength
474
371
  alias_method :user_code_length, :userCodeLength
475
372
  alias_method :user_code_length=, :userCodeLength=
476
373
 
477
- # The URI of user info endpoint. (String)
478
- attr_accessor :userInfoEndpoint
479
- alias_method :user_info_endpoint, :userInfoEndpoint
480
- alias_method :user_info_endpoint=, :userInfoEndpoint=
481
-
482
- # The key ID to identify a JWK used for user info signature using an
483
- # asymmetric key. (String)
484
- attr_accessor :userInfoSignatureKeyId
485
- alias_method :user_info_signature_key_id, :userInfoSignatureKeyId
486
- alias_method :user_info_signature_key_id=, :userInfoSignatureKeyId=
487
-
488
- # Flag of whether this service supports dynamic client registration.
489
- # (Boolean)
490
- attr_accessor :dynamicRegistrationSupported
491
- alias_method :dynamic_registration_supported, :dynamicRegistrationSupported
492
- alias_method :dynamic_registration_supported=, :dynamicRegistrationSupported=
493
-
494
- # The base URI of the service's "Dynamic Client Registration Management"
495
- # endpoint. Client management URIs will be based on this by adding the
496
- # client ID as a path component. (String)
497
- attr_accessor :registrationManagementEndpoint
498
- alias_method :registration_management_endpoint, :registrationManagementEndpoint
499
- alias_method :registration_management_endpoint=, :registrationManagementEndpoint=
500
-
501
- # The URI of request object endpoint. (String)
502
- attr_accessor :requestObjectEndpoint
503
- alias_method :request_object_endpoint, :requestObjectEndpoint
504
- alias_method :request_object_endpoint=, :requestObjectEndpoint=
505
-
506
- # MTLS endpoint aliases. (NamedUri array)
507
- attr_accessor :mtlsEndpointAliases
508
- alias_method :mtls_endpoint_aliases, :mtlsEndpointAliases
509
- alias_method :mtls_endpoint_aliases=, :mtlsEndpointAliases=
510
-
511
- # The URI of pushed authorization request endpoint. (String)
512
374
  attr_accessor :pushedAuthReqEndpoint
513
375
  alias_method :pushed_auth_req_endpoint, :pushedAuthReqEndpoint
514
376
  alias_method :pushed_auth_req_endpoint=, :pushedAuthReqEndpoint=
515
377
 
516
- # Duration of pushed authorization requests. (Integer)
517
- attr_accessor :pushedAuthReqDuration
518
- alias_method :pushed_auth_req_duration, :pushedAuthReqDuration
519
- alias_method :pushed_auth_req_duration=, :pushedAuthReqDuration=
378
+ attr_accessor :mtlsEndpointAliases
379
+ alias_method :mtls_endpoint_aliases, :mtlsEndpointAliases
380
+ alias_method :mtls_endpoint_aliases=, :mtlsEndpointAliases=
520
381
 
521
- # Supported data types for +authorization_details+. (String array)
522
382
  attr_accessor :supportedAuthorizationDataTypes
523
383
  alias_method :supported_authorization_data_types, :supportedAuthorizationDataTypes
524
384
  alias_method :supported_authorization_data_types=, :supportedAuthorizationDataTypes=
525
385
 
526
- # Trust frameworks supported by this service. (String array)
527
- # This corresponds to the +trust_frameworks_supported+ in OpenID Connect
528
- # for Identity Assurance 1.0.
529
386
  attr_accessor :supportedTrustFrameworks
530
387
  alias_method :supported_trust_frameworks, :supportedTrustFrameworks
531
388
  alias_method :supported_trust_frameworks=, :supportedTrustFrameworks=
532
389
 
533
- # Evidence supported by this service. (String array)
534
- # This corresponds to the +evidence_supported+ in OpenID Connect for
535
- # Identity Assurance 1.0.
536
390
  attr_accessor :supportedEvidence
537
391
  alias_method :supported_evidence, :supportedEvidence
538
392
  alias_method :supported_evidence=, :supportedEvidence=
539
393
 
540
- # Identity documents supported by this service. (String array)
541
- # This corresponds to the +id_documents_supported+ in OpenID Connect
542
- # for Identity Assurance 1.0.
543
394
  attr_accessor :supportedIdentityDocuments
544
395
  alias_method :supported_identity_documents, :supportedIdentityDocuments
545
396
  alias_method :supported_identity_documents=, :supportedIdentityDocuments=
546
397
 
547
- # Verification methods supported by this service. (String array)
548
- # This corresponds to the +id_documents_verification_methods_supported+ in
549
- # OpenID Connect for Identity Assurance 1.0.
550
398
  attr_accessor :supportedVerificationMethods
551
399
  alias_method :supported_verification_methods, :supportedVerificationMethods
552
400
  alias_method :supported_verification_methods=, :supportedVerificationMethods=
553
401
 
554
- # Verified claims supported by this service. (String array)
555
- # This corresponds to the +claims_in_verified_claims_supported+ in
556
- # OpenID Connect for Identity Assurance 1.0.
557
402
  attr_accessor :supportedVerifiedClaims
558
403
  alias_method :supported_verified_claims, :supportedVerifiedClaims
559
404
  alias_method :supported_verified_claims=, :supportedVerifiedClaims=
560
405
 
561
- # Flag of whether this service allows token requests without client ID
562
- # from public clients or not. (Boolean)
563
406
  attr_accessor :missingClientIdAllowed
564
407
  alias_method :missing_client_id_allowed, :missingClientIdAllowed
565
408
  alias_method :missing_client_id_allowed=, :missingClientIdAllowed=
566
409
 
567
- # Flag of whether the remaining duration of the used refresh token is
568
- # taken over to the newly issued refresh token. (Boolean)
569
- attr_accessor :refreshTokenDurationKept
570
- alias_method :refresh_token_duration_kept, :refreshTokenDurationKept
571
- alias_method :refresh_token_duration_kept=, :refreshTokenDurationKept=
572
-
573
- # Flag of whether this service requires that clients use the pushed
574
- # authorization request endpoint. (Boolean)
575
410
  attr_accessor :parRequired
576
411
  alias_method :par_required, :parRequired
577
412
  alias_method :par_required=, :parRequired=
578
413
 
579
- private
580
-
581
- # Integer attributes.
582
- INTEGER_ATTRIBUTES = ::Set.new([
583
- :accessTokenDuration, :allowableClockSkew, :apiKey, :authorizationResponseDuration,
584
- :backchannelAuthReqIdDuration, :backchannelPollingInterval, :clientsPerDeveloper,
585
- :createdAt, :deviceFlowCodeDuration, :deviceFlowPollingInterval,
586
- :idTokenDuration, :modifiedAt, :number, :refreshTokenDuration,
587
- :serviceOwnerNumber, :userCodeLength, :pushedAuthReqDuration
588
- ])
589
-
590
- # Boolean attributes.
591
- BOOLEAN_ATTRIBUTES = ::Set.new([
592
- :backchannelBindingMessageRequiredInFapi, :backchannelUserCodeParameterSupported,
593
- :clientIdAliasEnabled,
594
- :directAuthorizationEndpointEnabled, :directIntrospectionEndpointEnabled,
595
- :directJwksEndpointEnabled, :directRevocationEndpointEnabled, :directTokenEndpointEnabled,
596
- :directUserInfoEndpointEnabled, :errorDescriptionOmitted, :errorUriOmitted,
597
- :mutualTlsValidatePkiCertChain, :pkceRequired, :pkceS256Required, :refreshTokenKept,
598
- :singleAccessTokenPerSubject, :tlsClientCertificateBoundAccessTokens,
599
- :dynamicRegistrationSupported, :missingClientIdAllowed, :refreshTokenDurationKept,
600
- :parRequired
601
- ])
602
-
603
- # String attributes.
604
- STRING_ATTRIBUTES = ::Set.new([
605
- :accessTokenSignAlg, :accessTokenSignatureKeyId, :accessTokenType,
606
- :apiSecret, :authenticationCallbackApiKey, :authenticationCallbackApiSecret,
607
- :authenticationCallbackEndpoint, :authorizationEndpoint, :authorizationSignatureKeyId,
608
- :backchannelAuthenticationEndpoint, :description, :developerAuthenticationCallbackApiKey,
609
- :developerAuthenticationCallbackApiSecret, :developerAuthenticationCallbackEndpoint,
610
- :deviceAuthorizationEndpoint, :deviceVerificationUri, :deviceVerificationUriComplete,
611
- :idTokenSignatureKeyId, :introspectionEndpoint, :issuer, :jwks, :jwksUri,
612
- :policyUri, :registrationEndpoint, :registrationManagementEndpoint,
613
- :requestObjectEndpoint, :revocationEndpoint, :serviceDocumentation, :serviceName,
614
- :tokenEndpoint, :tosUri, :userCodeCharset, :userInfoEndpoint, :userInfoSignatureKeyId,
615
- :pushedAuthReqEndpoint
616
- ])
617
-
618
- # String array attributes.
619
- STRING_ARRAY_ATTRIBUTES = ::Set.new([
620
- :supportedAcrs, :supportedBackchannelTokenDeliveryModes, :supportedClaimLocales,
621
- :supportedClaims, :supportedClaimTypes, :supportedDeveloperSnses,
622
- :supportedDisplays, :supportedGrantTypes, :supportedResponseTypes,
623
- :supportedServiceProfiles, :supportedSnses, :supportedTokenAuthMethods,
624
- :supportedUiLocales, :trustedRootCertificates, :supportedAuthorizationDataTypes,
625
- :supportedTrustFrameworks, :supportedEvidence, :supportedIdentityDocuments,
626
- :supportedVerificationMethods, :supportedVerifiedClaims
627
- ])
628
-
629
- # SNS credentials array attributes.
630
- SNS_CREDENTIALS_ARRAY_ATTRIBUTES = ::Set.new([
631
- :developerSnsCredentials, :snsCredentials
632
- ])
633
-
634
- # Mapping from snake cases to camel cases.
635
- SNAKE_TO_CAMEL = {
636
- :access_token_duration => :accessTokenDuration,
637
- :access_token_sign_alg => :accessTokenSignAlg,
638
- :access_token_signature_key_id => :accessTokenSignatureKeyId,
639
- :access_token_type => :accessTokenType,
640
- :allowable_clock_skew => :allowableClockSkew,
641
- :api_key => :apiKey,
642
- :api_secret => :apiSecret,
643
- :authentication_callback_api_key => :authenticationCallbackApiKey,
644
- :authentication_callback_api_secret => :authenticationCallbackApiSecret,
645
- :authentication_callback_endpoint => :authenticationCallbackEndpoint,
646
- :authorization_endpoint => :authorizationEndpoint,
647
- :authorization_response_duration => :authorizationResponseDuration,
648
- :authorization_signature_key_id => :authorizationSignatureKeyId,
649
- :backchannel_authentication_endpoint => :backchannelAuthenticationEndpoint,
650
- :backchannel_binding_message_required_in_fapi => :backchannelBindingMessageRequiredInFapi,
651
- :backchannel_auth_req_id_duration => :backchannelAuthReqIdDuration,
652
- :backchannel_polling_interval => :backchannelPollingInterval,
653
- :backchannel_user_code_parameter_supported => :backchannelUserCodeParameterSupported,
654
- :developer_authentication_callback_api_key => :developerAuthenticationCallbackApiKey,
655
- :developer_authentication_callback_api_secret => :developerAuthenticationCallbackApiSecret,
656
- :developer_authentication_callback_endpoint => :developerAuthenticationCallbackEndpoint,
657
- :developer_sns_credentials => :developerSnsCredentials,
658
- :device_authorization_endpoint => :deviceAuthorizationEndpoint,
659
- :device_flow_code_duration => :deviceFlowCodeDuration,
660
- :device_flow_polling_interval => :deviceFlowPollingInterval,
661
- :device_verification_uri => :deviceVerificationUri,
662
- :device_verification_uri_complete => :deviceVerificationUriComplete,
663
- :client_id_alias_enabled => :clientIdAliasEnabled,
664
- :clients_per_developer => :clientsPerDeveloper,
665
- :created_at => :createdAt,
666
- :direct_authorization_endpoint_enabled => :directAuthorizationEndpointEnabled,
667
- :direct_introspection_endpoint_enabled => :directIntrospectionEndpointEnabled,
668
- :direct_jwks_endpoint_enabled => :directJwksEndpointEnabled,
669
- :direct_revocation_endpoint_enabled => :directRevocationEndpointEnabled,
670
- :direct_token_endpoint_enabled => :directTokenEndpointEnabled,
671
- :direct_user_info_endpoint_enabled => :directUserInfoEndpointEnabled,
672
- :dynamic_registration_supported => :dynamicRegistrationSupported,
673
- :error_description_omitted => :errorDescriptionOmitted,
674
- :error_uri_omitted => :errorUriOmitted,
675
- :id_token_duration => :idTokenDuration,
676
- :id_token_signature_key_id => :idTokenSignatureKeyId,
677
- :introspection_endpoint => :introspectionEndpoint,
678
- :jwks_uri => :jwksUri,
679
- :modified_at => :modifiedAt,
680
- :mutual_tls_validate_pki_cert_chain => :mutualTlsValidatePkiCertChain,
681
- :pkce_required => :pkceRequired,
682
- :pkce_s256_required => :pkceS256Required,
683
- :policy_uri => :policyUri,
684
- :refresh_token_duration => :refreshTokenDuration,
685
- :refresh_token_kept => :refreshTokenKept,
686
- :registration_endpoint => :registrationEndpoint,
687
- :registration_management_endpoint => :registrationManagementEndpoint,
688
- :revocation_endpoint => :revocationEndpoint,
689
- :request_object_endpoint => :requestObjectEndpoint,
690
- :service_documentation => :serviceDocumentation,
691
- :service_name => :serviceName,
692
- :service_owner_number => :serviceOwnerNumber,
693
- :single_access_token_per_subject => :singleAccessTokenPerSubject,
694
- :sns_credentials => :snsCredentials,
695
- :supported_acrs => :supportedAcrs,
696
- :supported_backchannel_token_delivery_modes => :supportedBackchannelTokenDeliveryModes,
697
- :supported_claim_locales => :supportedClaimLocales,
698
- :supported_claims => :supportedClaims,
699
- :supported_claim_types => :supportedClaimTypes,
700
- :supported_developer_snses => :supportedDeveloperSnses,
701
- :supported_displays => :supportedDisplays,
702
- :supported_grant_types => :supportedGrantTypes,
703
- :supported_response_types => :supportedResponseTypes,
704
- :supported_scopes => :supportedScopes,
705
- :supported_service_profiles => :supportedServiceProfiles,
706
- :supported_snses => :supportedSnses,
707
- :supported_token_auth_methods => :supportedTokenAuthMethods,
708
- :supported_ui_locales => :supportedUiLocales,
709
- :tls_client_certificate_bound_access_tokens => :tlsClientCertificateBoundAccessTokens,
710
- :token_endpoint => :tokenEndpoint,
711
- :tos_uri => :tosUri,
712
- :trusted_root_certificates => :trustedRootCertificates,
713
- :user_code_charset => :userCodeCharset,
714
- :user_code_length => :userCodeLength,
715
- :user_info_endpoint => :userInfoEndpoint,
716
- :user_info_signature_key_id => :userInfoSignatureKeyId,
717
- :mtls_endpoint_aliases => :mtlsEndpointAliases,
718
- :pushed_auth_req_endpoint => :pushedAuthReqEndpoint,
719
- :pushed_auth_req_duration => :pushedAuthReqDuration,
720
- :supported_authorization_data_types => :supportedAuthorizationDataTypes,
721
- :supported_trust_frameworks => :supportedTrustFrameworks,
722
- :supported_evidence => :supportedEvidence,
723
- :supported_identity_documents => :supportedIdentityDocuments,
724
- :supported_verification_methods => :supportedVerificationMethods,
725
- :supported_verified_claims => :supportedVerifiedClaims,
726
- :missing_client_id_allowed => :missingClientIdAllowed,
727
- :refresh_token_duration_kept => :refreshTokenDurationKept,
728
- :par_required => :parRequired
729
- }
730
-
731
- # The constructor
732
- def initialize(hash = nil)
733
- # Set default values to integer attributes.
734
- INTEGER_ATTRIBUTES.each do |attr|
735
- send("#{attr}=", 0)
736
- end
737
-
738
- # Set default values to boolean attributes.
739
- BOOLEAN_ATTRIBUTES.each do |attr|
740
- send("#{attr}=", false)
741
- end
742
-
743
- # Set default values to string attributes.
744
- STRING_ATTRIBUTES.each do |attr|
745
- send("#{attr}=", nil)
746
- end
747
-
748
- # Set default values to string array attributes.
749
- STRING_ARRAY_ATTRIBUTES.each do |attr|
750
- send("#{attr}=", nil)
751
- end
752
-
753
- # Set default values to sns credentials array attributes.
754
- SNS_CREDENTIALS_ARRAY_ATTRIBUTES.each do |attr|
755
- send("#{attr}=", nil)
756
- end
414
+ attr_accessor :requestObjectRequired
415
+ alias_method :request_object_required, :requestObjectRequired
416
+ alias_method :request_object_required=, :requestObjectRequired=
757
417
 
758
- # Set default values to special objects.
759
- @metadata = nil
760
- @supportedScopes = nil
761
- @mtlsEndpointAliases = nil
418
+ attr_accessor :traditionalRequestObjectProcessingApplied
419
+ alias_method :traditional_request_object_processing_applied, :traditionalRequestObjectProcessingApplied
420
+ alias_method :traditional_request_object_processing_applied=, :traditionalRequestObjectProcessingApplied=
762
421
 
763
- # Set attribute values using the given hash.
764
- authlete_model_update(hash)
765
- end
422
+ attr_accessor :claimShortcutRestrictive
423
+ alias_method :claim_shortcut_restrictive, :claimShortcutRestrictive
424
+ alias_method :claim_shortcut_restrictive=, :claimShortcutRestrictive=
766
425
 
767
- def authlete_model_convert_key(key)
768
- key = key.to_sym
426
+ attr_accessor :scopeRequired
427
+ alias_method :scope_required, :scopeRequired
428
+ alias_method :scope_required=, :scopeRequired=
769
429
 
770
- # Convert snakecase to camelcase, if necessary.
771
- if SNAKE_TO_CAMEL.has_key?(key)
772
- key = SNAKE_TO_CAMEL[key]
773
- end
430
+ attr_accessor :nbfOptional
431
+ alias_method :nbf_optional, :nbfOptional
432
+ alias_method :nbf_optional=, :nbfOptional=
774
433
 
775
- key
776
- end
434
+ attr_accessor :issSuppressed
435
+ alias_method :iss_suppressed, :issSuppressed
436
+ alias_method :iss_suppressed=, :issSuppressed=
777
437
 
778
- def authlete_model_simple_attribute?(key)
779
- INTEGER_ATTRIBUTES.include?(key) or
780
- BOOLEAN_ATTRIBUTES.include?(key) or
781
- STRING_ATTRIBUTES.include?(key) or
782
- STRING_ARRAY_ATTRIBUTES.include?(key)
783
- end
438
+ attr_accessor :attributes
784
439
 
785
- def authlete_model_update(hash)
786
- return if hash.nil?
787
-
788
- hash.each do |key, value|
789
- key = authlete_model_convert_key(key)
790
-
791
- if authlete_model_simple_attribute?(key)
792
- send("#{key}=", value)
793
- elsif SNS_CREDENTIALS_ARRAY_ATTRIBUTES.include?(key)
794
- # Get an array consisting of "SnsCredentials" objects.
795
- parsed = get_parsed_array(value) do |element|
796
- Authlete::Model::SnsCredentials.parse(element)
797
- end
798
-
799
- send("#{key}=", parsed)
800
- elsif key == :metadata
801
- @metadata = get_parsed_array(value) do |element|
802
- Authlete::Model::Pair.parse(element)
803
- end
804
- elsif key == :supportedScopes
805
- @supportedScopes = get_parsed_array(value) do |element|
806
- Authlete::Model::Scope.parse(element)
807
- end
808
- elsif key == :mtlsEndpointAliases
809
- @mtlsEndpointAliases = get_parsed_array(value) do |element|
810
- Authlete::Model::NamedUri.parse(element)
811
- end
812
- end
813
- end
440
+ private
814
441
 
815
- self
442
+ def defaults
443
+ {
444
+ number: 0,
445
+ serviceOwnerNumber: 0,
446
+ serviceName: nil,
447
+ apiKey: 0,
448
+ apiSecret: nil,
449
+ issuer: nil,
450
+ authorizationEndpoint: nil,
451
+ tokenEndpoint: nil,
452
+ revocationEndpoint: nil,
453
+ supportedRevocationAuthMethods: nil,
454
+ userInfoEndpoint: nil,
455
+ jwksUri: nil,
456
+ jwks: nil,
457
+ registrationEndpoint: nil,
458
+ registrationManagementEndpoint: nil,
459
+ supportedScopes: nil,
460
+ supportedResponseTypes: nil,
461
+ supportedGrantTypes: nil,
462
+ supportedAcrs: nil,
463
+ supportedTokenAuthMethods: nil,
464
+ supportedDisplays: nil,
465
+ supportedClaimTypes: nil,
466
+ supportedClaims: nil,
467
+ serviceDocumentation: nil,
468
+ supportedClaimLocales: nil,
469
+ supportedUiLocales: nil,
470
+ policyUri: nil,
471
+ tosUri: nil,
472
+ authenticationCallbackEndpoint: nil,
473
+ authenticationCallbackApiKey: nil,
474
+ authenticationCallbackApiSecret: nil,
475
+ supportedSnses: nil,
476
+ snsCredentials: nil,
477
+ createdAt: 0,
478
+ modifiedAt: 0,
479
+ developerAuthenticationCallbackEndpoint: nil,
480
+ developerAuthenticationCallbackApiKey: nil,
481
+ developerAuthenticationCallbackApiSecret: nil,
482
+ supportedDeveloperSnses: nil,
483
+ developerSnsCredentials: nil,
484
+ clientsPerDeveloper: 0,
485
+ directAuthorizationEndpointEnabled: false,
486
+ directTokenEndpointEnabled: false,
487
+ directRevocationEndpointEnabled: false,
488
+ directUserInfoEndpointEnabled: false,
489
+ directJwksEndpointEnabled: false,
490
+ directIntrospectionEndpointEnabled: false,
491
+ singleAccessTokenPerSubject: false,
492
+ pkceRequired: false,
493
+ pkceS256Required: false,
494
+ refreshTokenKept: false,
495
+ refreshTokenDurationKept: false,
496
+ errorDescriptionOmitted: false,
497
+ errorUriOmitted: false,
498
+ clientIdAliasEnabled: false,
499
+ supportedServiceProfiles: nil,
500
+ tlsClientCertificateBoundAccessTokens: false,
501
+ introspectionEndpoint: nil,
502
+ supportedIntrospectionAuthMethods: nil,
503
+ mutualTlsValidatePkiCertChain: false,
504
+ trustedRootCertificates: nil,
505
+ dynamicRegistrationSupported: false,
506
+ endSessionEndpoint: nil,
507
+ description: nil,
508
+ accessTokenType: nil,
509
+ accessTokenSignAlg: nil,
510
+ accessTokenDuration: 0,
511
+ refreshTokenDuration: 0,
512
+ idTokenDuration: 0,
513
+ authorizationResponseDuration: 0,
514
+ pushedAuthReqDuration: 0,
515
+ metadata: nil,
516
+ accessTokenSignatureKeyId: nil,
517
+ authorizationSignatureKeyId: nil,
518
+ idTokenSignatureKeyId: nil,
519
+ userInfoSignatureKeyId: nil,
520
+ supportedBackchannelTokenDeliveryModes: nil,
521
+ backchannelAuthenticationEndpoint: nil,
522
+ backchannelUserCodeParameterSupported: false,
523
+ backchannelAuthReqIdDuration: 0,
524
+ backchannelPollingInterval: 0,
525
+ backchannelBindingMessageRequiredInFapi: false,
526
+ allowableClockSkew: 0,
527
+ deviceAuthorizationEndpoint: nil,
528
+ deviceVerificationUri: nil,
529
+ deviceVerificationUriComplete: nil,
530
+ deviceFlowCodeDuration: 0,
531
+ deviceFlowPollingInterval: 0,
532
+ userCodeCharset: nil,
533
+ userCodeLength: 0,
534
+ pushedAuthReqEndpoint: nil,
535
+ mtlsEndpointAliases: nil,
536
+ supportedAuthorizationDataTypes: nil,
537
+ supportedTrustFrameworks: nil,
538
+ supportedEvidence: nil,
539
+ supportedIdentityDocuments: nil,
540
+ supportedVerificationMethods: nil,
541
+ supportedVerifiedClaims: nil,
542
+ missingClientIdAllowed: false,
543
+ parRequired: false,
544
+ requestObjectRequired: false,
545
+ traditionalRequestObjectProcessingApplied: false,
546
+ claimShortcutRestrictive: false,
547
+ scopeRequired: false,
548
+ nbfOptional: false,
549
+ issSuppressed: false,
550
+ attributes: nil
551
+ }
816
552
  end
817
553
 
818
- public
819
-
820
- # Construct an instance from the given hash.
821
- #
822
- # If the given argument is nil or is not a Hash, nil is returned.
823
- # Otherwise, Service.new(hash) is returned.
824
- def self.parse(hash)
825
- if hash.nil? or (hash.kind_of?(Hash) == false)
826
- return nil
827
- end
828
-
829
- Service.new(hash)
554
+ def set_params(hash)
555
+ @number = hash[:number]
556
+ @serviceOwnerNumber = hash[:serviceOwnerNumber]
557
+ @serviceName = hash[:serviceName]
558
+ @apiKey = hash[:apiKey]
559
+ @apiSecret = hash[:apiSecret]
560
+ @issuer = hash[:issuer]
561
+ @authorizationEndpoint = hash[:authorizationEndpoint]
562
+ @tokenEndpoint = hash[:tokenEndpoint]
563
+ @revocationEndpoint = hash[:revocationEndpoint]
564
+ @supportedRevocationAuthMethods = hash[:supportedRevocationAuthMethods]
565
+ @userInfoEndpoint = hash[:userInfoEndpoint]
566
+ @jwksUri = hash[:jwksUri]
567
+ @jwks = hash[:jwks]
568
+ @registrationEndpoint = hash[:registrationEndpoint]
569
+ @registrationManagementEndpoint = hash[:registrationManagementEndpoint]
570
+ @supportedScopes = get_parsed_array(hash[:supportedScopes]) { |e| Authlete::Model::Scope.parse(e) }
571
+ @supportedResponseTypes = hash[:supportedResponseTypes]
572
+ @supportedGrantTypes = hash[:supportedGrantTypes]
573
+ @supportedAcrs = hash[:supportedAcrs]
574
+ @supportedTokenAuthMethods = hash[:supportedTokenAuthMethods]
575
+ @supportedDisplays = hash[:supportedDisplays]
576
+ @supportedClaimTypes = hash[:supportedClaimTypes]
577
+ @supportedClaims = hash[:supportedClaims]
578
+ @serviceDocumentation = hash[:serviceDocumentation]
579
+ @supportedClaimLocales = hash[:supportedClaimLocales]
580
+ @supportedUiLocales = hash[:supportedUiLocales]
581
+ @policyUri = hash[:policyUri]
582
+ @tosUri = hash[:tosUri]
583
+ @authenticationCallbackEndpoint = hash[:authenticationCallbackEndpoint]
584
+ @authenticationCallbackApiKey = hash[:authenticationCallbackApiKey]
585
+ @authenticationCallbackApiSecret = hash[:authenticationCallbackApiSecret]
586
+ @supportedSnses = hash[:supportedSnses]
587
+ @snsCredentials = get_parsed_array(hash[:snsCredentials]) { |e| Authlete::Model::SnsCredentials.parse(e) }
588
+ @createdAt = hash[:createdAt]
589
+ @modifiedAt = hash[:modifiedAt]
590
+ @developerAuthenticationCallbackEndpoint = hash[:developerAuthenticationCallbackEndpoint]
591
+ @developerAuthenticationCallbackApiKey = hash[:developerAuthenticationCallbackApiKey]
592
+ @developerAuthenticationCallbackApiSecret = hash[:developerAuthenticationCallbackApiSecret]
593
+ @supportedDeveloperSnses = hash[:supportedDeveloperSnses]
594
+ @developerSnsCredentials = get_parsed_array(hash[:developerSnsCredentials]) { |e| Authlete::Model::SnsCredentials.parse(e) }
595
+ @clientsPerDeveloper = hash[:clientsPerDeveloper]
596
+ @directAuthorizationEndpointEnabled = hash[:directAuthorizationEndpointEnabled]
597
+ @directTokenEndpointEnabled = hash[:directTokenEndpointEnabled]
598
+ @directRevocationEndpointEnabled = hash[:directRevocationEndpointEnabled]
599
+ @directUserInfoEndpointEnabled = hash[:directUserInfoEndpointEnabled]
600
+ @directJwksEndpointEnabled = hash[:directJwksEndpointEnabled]
601
+ @directIntrospectionEndpointEnabled = hash[:directIntrospectionEndpointEnabled]
602
+ @singleAccessTokenPerSubject = hash[:singleAccessTokenPerSubject]
603
+ @pkceRequired = hash[:pkceRequired]
604
+ @pkceS256Required = hash[:pkceS256Required]
605
+ @refreshTokenKept = hash[:refreshTokenKept]
606
+ @refreshTokenDurationKept = hash[:refreshTokenDurationKept]
607
+ @errorDescriptionOmitted = hash[:errorDescriptionOmitted]
608
+ @errorUriOmitted = hash[:errorUriOmitted]
609
+ @clientIdAliasEnabled = hash[:clientIdAliasEnabled]
610
+ @supportedServiceProfiles = hash[:supportedServiceProfiles]
611
+ @tlsClientCertificateBoundAccessTokens = hash[:tlsClientCertificateBoundAccessTokens]
612
+ @introspectionEndpoint = hash[:introspectionEndpoint]
613
+ @supportedIntrospectionAuthMethods = hash[:supportedIntrospectionAuthMethods]
614
+ @mutualTlsValidatePkiCertChain = hash[:mutualTlsValidatePkiCertChain]
615
+ @trustedRootCertificates = hash[:trustedRootCertificates]
616
+ @dynamicRegistrationSupported = hash[:dynamicRegistrationSupported]
617
+ @endSessionEndpoint = hash[:endSessionEndpoint]
618
+ @description = hash[:description]
619
+ @accessTokenType = hash[:accessTokenType]
620
+ @accessTokenSignAlg = hash[:accessTokenSignAlg]
621
+ @accessTokenDuration = hash[:accessTokenDuration]
622
+ @refreshTokenDuration = hash[:refreshTokenDuration]
623
+ @idTokenDuration = hash[:idTokenDuration]
624
+ @authorizationResponseDuration = hash[:authorizationResponseDuration]
625
+ @pushedAuthReqDuration = hash[:pushedAuthReqDuration]
626
+ @metadata = get_parsed_array(hash[:metadata]) { |e| Authlete::Model::Pair.parse(e) }
627
+ @accessTokenSignatureKeyId = hash[:accessTokenSignatureKeyId]
628
+ @authorizationSignatureKeyId = hash[:authorizationSignatureKeyId]
629
+ @idTokenSignatureKeyId = hash[:idTokenSignatureKeyId]
630
+ @userInfoSignatureKeyId = hash[:userInfoSignatureKeyId]
631
+ @supportedBackchannelTokenDeliveryModes = hash[:supportedBackchannelTokenDeliveryModes]
632
+ @backchannelAuthenticationEndpoint = hash[:backchannelAuthenticationEndpoint]
633
+ @backchannelUserCodeParameterSupported = hash[:backchannelUserCodeParameterSupported]
634
+ @backchannelAuthReqIdDuration = hash[:backchannelAuthReqIdDuration]
635
+ @backchannelPollingInterval = hash[:backchannelPollingInterval]
636
+ @backchannelBindingMessageRequiredInFapi = hash[:backchannelBindingMessageRequiredInFapi]
637
+ @allowableClockSkew = hash[:allowableClockSkew]
638
+ @deviceAuthorizationEndpoint = hash[:deviceAuthorizationEndpoint]
639
+ @deviceVerificationUri = hash[:deviceVerificationUri]
640
+ @deviceVerificationUriComplete = hash[:deviceVerificationUriComplete]
641
+ @deviceFlowCodeDuration = hash[:deviceFlowCodeDuration]
642
+ @deviceFlowPollingInterval = hash[:deviceFlowPollingInterval]
643
+ @userCodeCharset = hash[:userCodeCharset]
644
+ @userCodeLength = hash[:userCodeLength]
645
+ @pushedAuthReqEndpoint = hash[:pushedAuthReqEndpoint]
646
+ @mtlsEndpointAliases = get_parsed_array(hash[:mtlsEndpointAliases]) { |e| Authlete::Model::NamedUri.parse(e) }
647
+ @supportedAuthorizationDataTypes = hash[:supportedAuthorizationDataTypes]
648
+ @supportedTrustFrameworks = hash[:supportedTrustFrameworks]
649
+ @supportedEvidence = hash[:supportedEvidence]
650
+ @supportedIdentityDocuments = hash[:supportedIdentityDocuments]
651
+ @supportedVerificationMethods = hash[:supportedVerificationMethods]
652
+ @supportedVerifiedClaims = hash[:supportedVerifiedClaims]
653
+ @missingClientIdAllowed = hash[:missingClientIdAllowed]
654
+ @parRequired = hash[:parRequired]
655
+ @requestObjectRequired = hash[:requestObjectRequired]
656
+ @traditionalRequestObjectProcessingApplied = hash[:traditionalRequestObjectProcessingApplied]
657
+ @claimShortcutRestrictive = hash[:claimShortcutRestrictive]
658
+ @scopeRequired = hash[:scopeRequired]
659
+ @nbfOptional = hash[:nbfOptional]
660
+ @issSuppressed = hash[:issSuppressed]
661
+ @attributes = get_parsed_array(hash[:attributes]) { |e| Authlete::Model::Pair.parse(e) }
830
662
  end
831
663
 
832
- # Convert this object into a hash.
833
- def to_hash
834
- hash = {}
835
-
836
- instance_variables.each do |var|
837
- key = var.to_s.delete("@").to_sym
838
- val = instance_variable_get(var)
664
+ def to_hash_value(key, var)
665
+ raw_val = instance_variable_get(var)
839
666
 
840
- if authlete_model_simple_attribute?(key) or val.nil?
841
- hash[key] = val
842
- elsif key == :developerSnsCredentials or key == :snsCredentials or
843
- key == :supportedScopes or key == :metadata or key == :mtlsEndpointAliases
844
- hash[key] = val.map { |element| element.to_hash }
845
- end
667
+ case key
668
+ when :snsCredentials, :developerSnsCredentials, :supportedScopes,
669
+ :metadata, :mtlsEndpointAliases, :attributes
670
+ raw_val&.map { |e| e.to_hash }
671
+ else
672
+ raw_val
846
673
  end
847
-
848
- hash
849
674
  end
850
675
  end
851
676
  end
852
- end
677
+ end