ory-hydra-client 0.0.0.alpha39

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +165 -0
  4. data/Rakefile +10 -0
  5. data/docs/AcceptConsentRequest.md +25 -0
  6. data/docs/AcceptLoginRequest.md +27 -0
  7. data/docs/AdminApi.md +1443 -0
  8. data/docs/CompletedRequest.md +17 -0
  9. data/docs/ConsentRequest.md +39 -0
  10. data/docs/ConsentRequestSession.md +19 -0
  11. data/docs/FlushInactiveOAuth2TokensRequest.md +17 -0
  12. data/docs/GenericError.md +23 -0
  13. data/docs/HealthNotReadyStatus.md +17 -0
  14. data/docs/HealthStatus.md +17 -0
  15. data/docs/JSONWebKey.md +49 -0
  16. data/docs/JSONWebKeySet.md +17 -0
  17. data/docs/JsonWebKeySetGeneratorRequest.md +21 -0
  18. data/docs/LoginRequest.md +33 -0
  19. data/docs/LogoutRequest.md +23 -0
  20. data/docs/OAuth2Client.md +79 -0
  21. data/docs/OAuth2TokenIntrospection.md +41 -0
  22. data/docs/Oauth2TokenResponse.md +27 -0
  23. data/docs/OauthTokenResponse.md +27 -0
  24. data/docs/OpenIDConnectContext.md +25 -0
  25. data/docs/PreviousConsentSession.md +27 -0
  26. data/docs/PublicApi.md +398 -0
  27. data/docs/RejectRequest.md +25 -0
  28. data/docs/UserinfoResponse.md +53 -0
  29. data/docs/Version.md +17 -0
  30. data/docs/WellKnown.md +65 -0
  31. data/lib/ory-hydra-client.rb +65 -0
  32. data/lib/ory-hydra-client/api/admin_api.rb +1879 -0
  33. data/lib/ory-hydra-client/api/public_api.rb +498 -0
  34. data/lib/ory-hydra-client/api_client.rb +386 -0
  35. data/lib/ory-hydra-client/api_error.rb +57 -0
  36. data/lib/ory-hydra-client/configuration.rb +255 -0
  37. data/lib/ory-hydra-client/models/accept_consent_request.rb +250 -0
  38. data/lib/ory-hydra-client/models/accept_login_request.rb +264 -0
  39. data/lib/ory-hydra-client/models/completed_request.rb +207 -0
  40. data/lib/ory-hydra-client/models/consent_request.rb +321 -0
  41. data/lib/ory-hydra-client/models/consent_request_session.rb +221 -0
  42. data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +207 -0
  43. data/lib/ory-hydra-client/models/generic_error.rb +243 -0
  44. data/lib/ory-hydra-client/models/health_not_ready_status.rb +209 -0
  45. data/lib/ory-hydra-client/models/health_status.rb +207 -0
  46. data/lib/ory-hydra-client/models/json_web_key.rb +377 -0
  47. data/lib/ory-hydra-client/models/json_web_key_set.rb +209 -0
  48. data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +242 -0
  49. data/lib/ory-hydra-client/models/login_request.rb +289 -0
  50. data/lib/ory-hydra-client/models/logout_request.rb +237 -0
  51. data/lib/ory-hydra-client/models/o_auth2_client.rb +551 -0
  52. data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +337 -0
  53. data/lib/ory-hydra-client/models/oauth2_token_response.rb +252 -0
  54. data/lib/ory-hydra-client/models/oauth_token_response.rb +258 -0
  55. data/lib/ory-hydra-client/models/open_id_connect_context.rb +253 -0
  56. data/lib/ory-hydra-client/models/previous_consent_session.rb +260 -0
  57. data/lib/ory-hydra-client/models/reject_request.rb +242 -0
  58. data/lib/ory-hydra-client/models/userinfo_response.rb +388 -0
  59. data/lib/ory-hydra-client/models/version.rb +207 -0
  60. data/lib/ory-hydra-client/models/well_known.rb +501 -0
  61. data/lib/ory-hydra-client/version.rb +15 -0
  62. data/ory-hydra-client.gemspec +39 -0
  63. data/spec/api/admin_api_spec.rb +395 -0
  64. data/spec/api/public_api_spec.rb +129 -0
  65. data/spec/api_client_spec.rb +226 -0
  66. data/spec/configuration_spec.rb +42 -0
  67. data/spec/models/accept_consent_request_spec.rb +65 -0
  68. data/spec/models/accept_login_request_spec.rb +71 -0
  69. data/spec/models/completed_request_spec.rb +41 -0
  70. data/spec/models/consent_request_session_spec.rb +47 -0
  71. data/spec/models/consent_request_spec.rb +107 -0
  72. data/spec/models/flush_inactive_o_auth2_tokens_request_spec.rb +41 -0
  73. data/spec/models/generic_error_spec.rb +59 -0
  74. data/spec/models/health_not_ready_status_spec.rb +41 -0
  75. data/spec/models/health_status_spec.rb +41 -0
  76. data/spec/models/json_web_key_set_generator_request_spec.rb +53 -0
  77. data/spec/models/json_web_key_set_spec.rb +41 -0
  78. data/spec/models/json_web_key_spec.rb +137 -0
  79. data/spec/models/login_request_spec.rb +89 -0
  80. data/spec/models/logout_request_spec.rb +59 -0
  81. data/spec/models/o_auth2_client_spec.rb +227 -0
  82. data/spec/models/o_auth2_token_introspection_spec.rb +113 -0
  83. data/spec/models/oauth2_token_response_spec.rb +71 -0
  84. data/spec/models/oauth_token_response_spec.rb +71 -0
  85. data/spec/models/open_id_connect_context_spec.rb +65 -0
  86. data/spec/models/previous_consent_session_spec.rb +71 -0
  87. data/spec/models/reject_request_spec.rb +65 -0
  88. data/spec/models/userinfo_response_spec.rb +149 -0
  89. data/spec/models/version_spec.rb +41 -0
  90. data/spec/models/well_known_spec.rb +185 -0
  91. data/spec/spec_helper.rb +111 -0
  92. metadata +223 -0
@@ -0,0 +1,260 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v0.0.0-alpha.39
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ # The response used to return used consent requests same as HandledLoginRequest, just with consent_request exposed as json
17
+ class PreviousConsentSession
18
+ attr_accessor :consent_request
19
+
20
+ # GrantedAudience sets the audience the user authorized the client to use. Should be a subset of `requested_access_token_audience`.
21
+ attr_accessor :grant_access_token_audience
22
+
23
+ # GrantScope sets the scope the user authorized the client to use. Should be a subset of `requested_scope`
24
+ attr_accessor :grant_scope
25
+
26
+ # Remember, if set to true, tells ORY Hydra to remember this consent authorization and reuse it if the same client asks the same user for the same, or a subset of, scope.
27
+ attr_accessor :remember
28
+
29
+ # RememberFor sets how long the consent authorization should be remembered for in seconds. If set to `0`, the authorization will be remembered indefinitely.
30
+ attr_accessor :remember_for
31
+
32
+ attr_accessor :session
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'consent_request' => :'consent_request',
38
+ :'grant_access_token_audience' => :'grant_access_token_audience',
39
+ :'grant_scope' => :'grant_scope',
40
+ :'remember' => :'remember',
41
+ :'remember_for' => :'remember_for',
42
+ :'session' => :'session'
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'consent_request' => :'ConsentRequest',
50
+ :'grant_access_token_audience' => :'Array<String>',
51
+ :'grant_scope' => :'Array<String>',
52
+ :'remember' => :'Boolean',
53
+ :'remember_for' => :'Integer',
54
+ :'session' => :'ConsentRequestSession'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::PreviousConsentSession` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!self.class.attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::PreviousConsentSession`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'consent_request')
80
+ self.consent_request = attributes[:'consent_request']
81
+ end
82
+
83
+ if attributes.key?(:'grant_access_token_audience')
84
+ if (value = attributes[:'grant_access_token_audience']).is_a?(Array)
85
+ self.grant_access_token_audience = value
86
+ end
87
+ end
88
+
89
+ if attributes.key?(:'grant_scope')
90
+ if (value = attributes[:'grant_scope']).is_a?(Array)
91
+ self.grant_scope = value
92
+ end
93
+ end
94
+
95
+ if attributes.key?(:'remember')
96
+ self.remember = attributes[:'remember']
97
+ end
98
+
99
+ if attributes.key?(:'remember_for')
100
+ self.remember_for = attributes[:'remember_for']
101
+ end
102
+
103
+ if attributes.key?(:'session')
104
+ self.session = attributes[:'session']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ invalid_properties = Array.new
112
+ invalid_properties
113
+ end
114
+
115
+ # Check to see if the all the properties in the model are valid
116
+ # @return true if the model is valid
117
+ def valid?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ consent_request == o.consent_request &&
127
+ grant_access_token_audience == o.grant_access_token_audience &&
128
+ grant_scope == o.grant_scope &&
129
+ remember == o.remember &&
130
+ remember_for == o.remember_for &&
131
+ session == o.session
132
+ end
133
+
134
+ # @see the `==` method
135
+ # @param [Object] Object to be compared
136
+ def eql?(o)
137
+ self == o
138
+ end
139
+
140
+ # Calculates hash code according to all attributes.
141
+ # @return [Integer] Hash code
142
+ def hash
143
+ [consent_request, grant_access_token_audience, grant_scope, remember, remember_for, session].hash
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def self.build_from_hash(attributes)
150
+ new.build_from_hash(attributes)
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.openapi_types.each_pair do |key, type|
159
+ if type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
164
+ end
165
+ elsif !attributes[self.class.attribute_map[key]].nil?
166
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ OryHydraClient.const_get(type).build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map { |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+ end
260
+ end
@@ -0,0 +1,242 @@
1
+ =begin
2
+ #ORY Hydra
3
+
4
+ #Welcome to the ORY Hydra HTTP API documentation. You will find documentation for all HTTP APIs here.
5
+
6
+ The version of the OpenAPI document: v0.0.0-alpha.39
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module OryHydraClient
16
+ class RejectRequest
17
+ attr_accessor :error
18
+
19
+ attr_accessor :error_debug
20
+
21
+ attr_accessor :error_description
22
+
23
+ attr_accessor :error_hint
24
+
25
+ attr_accessor :status_code
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'error' => :'error',
31
+ :'error_debug' => :'error_debug',
32
+ :'error_description' => :'error_description',
33
+ :'error_hint' => :'error_hint',
34
+ :'status_code' => :'status_code'
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'error' => :'String',
42
+ :'error_debug' => :'String',
43
+ :'error_description' => :'String',
44
+ :'error_hint' => :'String',
45
+ :'status_code' => :'Integer'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::RejectRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::RejectRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'error')
71
+ self.error = attributes[:'error']
72
+ end
73
+
74
+ if attributes.key?(:'error_debug')
75
+ self.error_debug = attributes[:'error_debug']
76
+ end
77
+
78
+ if attributes.key?(:'error_description')
79
+ self.error_description = attributes[:'error_description']
80
+ end
81
+
82
+ if attributes.key?(:'error_hint')
83
+ self.error_hint = attributes[:'error_hint']
84
+ end
85
+
86
+ if attributes.key?(:'status_code')
87
+ self.status_code = attributes[:'status_code']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ invalid_properties = Array.new
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ error == o.error &&
110
+ error_debug == o.error_debug &&
111
+ error_description == o.error_description &&
112
+ error_hint == o.error_hint &&
113
+ status_code == o.status_code
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [error, error_debug, error_description, error_hint, status_code].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ new.build_from_hash(attributes)
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def build_from_hash(attributes)
139
+ return nil unless attributes.is_a?(Hash)
140
+ self.class.openapi_types.each_pair do |key, type|
141
+ if type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
145
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
149
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Deserializes the data based on type
156
+ # @param string type Data type
157
+ # @param string value Value to be deserialized
158
+ # @return [Object] Deserialized data
159
+ def _deserialize(type, value)
160
+ case type.to_sym
161
+ when :DateTime
162
+ DateTime.parse(value)
163
+ when :Date
164
+ Date.parse(value)
165
+ when :String
166
+ value.to_s
167
+ when :Integer
168
+ value.to_i
169
+ when :Float
170
+ value.to_f
171
+ when :Boolean
172
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
173
+ true
174
+ else
175
+ false
176
+ end
177
+ when :Object
178
+ # generic object (usually a Hash), return directly
179
+ value
180
+ when /\AArray<(?<inner_type>.+)>\z/
181
+ inner_type = Regexp.last_match[:inner_type]
182
+ value.map { |v| _deserialize(inner_type, v) }
183
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
184
+ k_type = Regexp.last_match[:k_type]
185
+ v_type = Regexp.last_match[:v_type]
186
+ {}.tap do |hash|
187
+ value.each do |k, v|
188
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
189
+ end
190
+ end
191
+ else # model
192
+ OryHydraClient.const_get(type).build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.openapi_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+ end
242
+ end