ory-hydra-client 0.0.0.alpha39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +165 -0
- data/Rakefile +10 -0
- data/docs/AcceptConsentRequest.md +25 -0
- data/docs/AcceptLoginRequest.md +27 -0
- data/docs/AdminApi.md +1443 -0
- data/docs/CompletedRequest.md +17 -0
- data/docs/ConsentRequest.md +39 -0
- data/docs/ConsentRequestSession.md +19 -0
- data/docs/FlushInactiveOAuth2TokensRequest.md +17 -0
- data/docs/GenericError.md +23 -0
- data/docs/HealthNotReadyStatus.md +17 -0
- data/docs/HealthStatus.md +17 -0
- data/docs/JSONWebKey.md +49 -0
- data/docs/JSONWebKeySet.md +17 -0
- data/docs/JsonWebKeySetGeneratorRequest.md +21 -0
- data/docs/LoginRequest.md +33 -0
- data/docs/LogoutRequest.md +23 -0
- data/docs/OAuth2Client.md +79 -0
- data/docs/OAuth2TokenIntrospection.md +41 -0
- data/docs/Oauth2TokenResponse.md +27 -0
- data/docs/OauthTokenResponse.md +27 -0
- data/docs/OpenIDConnectContext.md +25 -0
- data/docs/PreviousConsentSession.md +27 -0
- data/docs/PublicApi.md +398 -0
- data/docs/RejectRequest.md +25 -0
- data/docs/UserinfoResponse.md +53 -0
- data/docs/Version.md +17 -0
- data/docs/WellKnown.md +65 -0
- data/lib/ory-hydra-client.rb +65 -0
- data/lib/ory-hydra-client/api/admin_api.rb +1879 -0
- data/lib/ory-hydra-client/api/public_api.rb +498 -0
- data/lib/ory-hydra-client/api_client.rb +386 -0
- data/lib/ory-hydra-client/api_error.rb +57 -0
- data/lib/ory-hydra-client/configuration.rb +255 -0
- data/lib/ory-hydra-client/models/accept_consent_request.rb +250 -0
- data/lib/ory-hydra-client/models/accept_login_request.rb +264 -0
- data/lib/ory-hydra-client/models/completed_request.rb +207 -0
- data/lib/ory-hydra-client/models/consent_request.rb +321 -0
- data/lib/ory-hydra-client/models/consent_request_session.rb +221 -0
- data/lib/ory-hydra-client/models/flush_inactive_o_auth2_tokens_request.rb +207 -0
- data/lib/ory-hydra-client/models/generic_error.rb +243 -0
- data/lib/ory-hydra-client/models/health_not_ready_status.rb +209 -0
- data/lib/ory-hydra-client/models/health_status.rb +207 -0
- data/lib/ory-hydra-client/models/json_web_key.rb +377 -0
- data/lib/ory-hydra-client/models/json_web_key_set.rb +209 -0
- data/lib/ory-hydra-client/models/json_web_key_set_generator_request.rb +242 -0
- data/lib/ory-hydra-client/models/login_request.rb +289 -0
- data/lib/ory-hydra-client/models/logout_request.rb +237 -0
- data/lib/ory-hydra-client/models/o_auth2_client.rb +551 -0
- data/lib/ory-hydra-client/models/o_auth2_token_introspection.rb +337 -0
- data/lib/ory-hydra-client/models/oauth2_token_response.rb +252 -0
- data/lib/ory-hydra-client/models/oauth_token_response.rb +258 -0
- data/lib/ory-hydra-client/models/open_id_connect_context.rb +253 -0
- data/lib/ory-hydra-client/models/previous_consent_session.rb +260 -0
- data/lib/ory-hydra-client/models/reject_request.rb +242 -0
- data/lib/ory-hydra-client/models/userinfo_response.rb +388 -0
- data/lib/ory-hydra-client/models/version.rb +207 -0
- data/lib/ory-hydra-client/models/well_known.rb +501 -0
- data/lib/ory-hydra-client/version.rb +15 -0
- data/ory-hydra-client.gemspec +39 -0
- data/spec/api/admin_api_spec.rb +395 -0
- data/spec/api/public_api_spec.rb +129 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/accept_consent_request_spec.rb +65 -0
- data/spec/models/accept_login_request_spec.rb +71 -0
- data/spec/models/completed_request_spec.rb +41 -0
- data/spec/models/consent_request_session_spec.rb +47 -0
- data/spec/models/consent_request_spec.rb +107 -0
- data/spec/models/flush_inactive_o_auth2_tokens_request_spec.rb +41 -0
- data/spec/models/generic_error_spec.rb +59 -0
- data/spec/models/health_not_ready_status_spec.rb +41 -0
- data/spec/models/health_status_spec.rb +41 -0
- data/spec/models/json_web_key_set_generator_request_spec.rb +53 -0
- data/spec/models/json_web_key_set_spec.rb +41 -0
- data/spec/models/json_web_key_spec.rb +137 -0
- data/spec/models/login_request_spec.rb +89 -0
- data/spec/models/logout_request_spec.rb +59 -0
- data/spec/models/o_auth2_client_spec.rb +227 -0
- data/spec/models/o_auth2_token_introspection_spec.rb +113 -0
- data/spec/models/oauth2_token_response_spec.rb +71 -0
- data/spec/models/oauth_token_response_spec.rb +71 -0
- data/spec/models/open_id_connect_context_spec.rb +65 -0
- data/spec/models/previous_consent_session_spec.rb +71 -0
- data/spec/models/reject_request_spec.rb +65 -0
- data/spec/models/userinfo_response_spec.rb +149 -0
- data/spec/models/version_spec.rb +41 -0
- data/spec/models/well_known_spec.rb +185 -0
- data/spec/spec_helper.rb +111 -0
- metadata +223 -0
@@ -0,0 +1,551 @@
|
|
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 OAuth2Client
|
17
|
+
# AllowedCORSOrigins are one or more URLs (scheme://host[:port]) which are allowed to make CORS requests to the /oauth/token endpoint. If this array is empty, the sever's CORS origin configuration (`CORS_ALLOWED_ORIGINS`) will be used instead. If this array is set, the allowed origins are appended to the server's CORS origin configuration. Be aware that environment variable `CORS_ENABLED` MUST be set to `true` for this to work.
|
18
|
+
attr_accessor :allowed_cors_origins
|
19
|
+
|
20
|
+
# Audience is a whitelist defining the audiences this client is allowed to request tokens for. An audience limits the applicability of an OAuth 2.0 Access Token to, for example, certain API endpoints. The value is a list of URLs. URLs MUST NOT contain whitespaces.
|
21
|
+
attr_accessor :audience
|
22
|
+
|
23
|
+
# Boolean value specifying whether the RP requires that a sid (session ID) Claim be included in the Logout Token to identify the RP session with the OP when the backchannel_logout_uri is used. If omitted, the default value is false.
|
24
|
+
attr_accessor :backchannel_logout_session_required
|
25
|
+
|
26
|
+
# RP URL that will cause the RP to log itself out when sent a Logout Token by the OP.
|
27
|
+
attr_accessor :backchannel_logout_uri
|
28
|
+
|
29
|
+
# ClientID is the id for this client.
|
30
|
+
attr_accessor :client_id
|
31
|
+
|
32
|
+
# Name is the human-readable string name of the client to be presented to the end-user during authorization.
|
33
|
+
attr_accessor :client_name
|
34
|
+
|
35
|
+
# Secret is the client's secret. The secret will be included in the create request as cleartext, and then never again. The secret is stored using BCrypt so it is impossible to recover it. Tell your users that they need to write the secret down as it will not be made available again.
|
36
|
+
attr_accessor :client_secret
|
37
|
+
|
38
|
+
# SecretExpiresAt is an integer holding the time at which the client secret will expire or 0 if it will not expire. The time is represented as the number of seconds from 1970-01-01T00:00:00Z as measured in UTC until the date/time of expiration. This feature is currently not supported and it's value will always be set to 0.
|
39
|
+
attr_accessor :client_secret_expires_at
|
40
|
+
|
41
|
+
# ClientURI is an URL string of a web page providing information about the client. If present, the server SHOULD display this URL to the end-user in a clickable fashion.
|
42
|
+
attr_accessor :client_uri
|
43
|
+
|
44
|
+
# Contacts is a array of strings representing ways to contact people responsible for this client, typically email addresses.
|
45
|
+
attr_accessor :contacts
|
46
|
+
|
47
|
+
# CreatedAt returns the timestamp of the client's creation.
|
48
|
+
attr_accessor :created_at
|
49
|
+
|
50
|
+
# Boolean value specifying whether the RP requires that iss (issuer) and sid (session ID) query parameters be included to identify the RP session with the OP when the frontchannel_logout_uri is used. If omitted, the default value is false.
|
51
|
+
attr_accessor :frontchannel_logout_session_required
|
52
|
+
|
53
|
+
# RP URL that will cause the RP to log itself out when rendered in an iframe by the OP. An iss (issuer) query parameter and a sid (session ID) query parameter MAY be included by the OP to enable the RP to validate the request and to determine which of the potentially multiple sessions is to be logged out; if either is included, both MUST be.
|
54
|
+
attr_accessor :frontchannel_logout_uri
|
55
|
+
|
56
|
+
# GrantTypes is an array of grant types the client is allowed to use.
|
57
|
+
attr_accessor :grant_types
|
58
|
+
|
59
|
+
attr_accessor :jwks
|
60
|
+
|
61
|
+
# URL for the Client's JSON Web Key Set [JWK] document. If the Client signs requests to the Server, it contains the signing key(s) the Server uses to validate signatures from the Client. The JWK Set MAY also contain the Client's encryption keys(s), which are used by the Server to encrypt responses to the Client. When both signing and encryption keys are made available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate each key's intended usage. Although some algorithms allow the same key to be used for both signatures and encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match those in the certificate.
|
62
|
+
attr_accessor :jwks_uri
|
63
|
+
|
64
|
+
# LogoURI is an URL string that references a logo for the client.
|
65
|
+
attr_accessor :logo_uri
|
66
|
+
|
67
|
+
# Metadata is arbitrary data.
|
68
|
+
attr_accessor :metadata
|
69
|
+
|
70
|
+
# Owner is a string identifying the owner of the OAuth 2.0 Client.
|
71
|
+
attr_accessor :owner
|
72
|
+
|
73
|
+
# PolicyURI is a URL string that points to a human-readable privacy policy document that describes how the deployment organization collects, uses, retains, and discloses personal data.
|
74
|
+
attr_accessor :policy_uri
|
75
|
+
|
76
|
+
# Array of URLs supplied by the RP to which it MAY request that the End-User's User Agent be redirected using the post_logout_redirect_uri parameter after a logout has been performed.
|
77
|
+
attr_accessor :post_logout_redirect_uris
|
78
|
+
|
79
|
+
# RedirectURIs is an array of allowed redirect urls for the client, for example http://mydomain/oauth/callback .
|
80
|
+
attr_accessor :redirect_uris
|
81
|
+
|
82
|
+
# JWS [JWS] alg algorithm [JWA] that MUST be used for signing Request Objects sent to the OP. All Request Objects from this Client MUST be rejected, if not signed with this algorithm.
|
83
|
+
attr_accessor :request_object_signing_alg
|
84
|
+
|
85
|
+
# Array of request_uri values that are pre-registered by the RP for use at the OP. Servers MAY cache the contents of the files referenced by these URIs and not retrieve them at the time they are used in a request. OPs can require that request_uri values used be pre-registered with the require_request_uri_registration discovery parameter.
|
86
|
+
attr_accessor :request_uris
|
87
|
+
|
88
|
+
# ResponseTypes is an array of the OAuth 2.0 response type strings that the client can use at the authorization endpoint.
|
89
|
+
attr_accessor :response_types
|
90
|
+
|
91
|
+
# Scope is a string containing a space-separated list of scope values (as described in Section 3.3 of OAuth 2.0 [RFC6749]) that the client can use when requesting access tokens.
|
92
|
+
attr_accessor :scope
|
93
|
+
|
94
|
+
# URL using the https scheme to be used in calculating Pseudonymous Identifiers by the OP. The URL references a file with a single JSON array of redirect_uri values.
|
95
|
+
attr_accessor :sector_identifier_uri
|
96
|
+
|
97
|
+
# SubjectType requested for responses to this Client. The subject_types_supported Discovery parameter contains a list of the supported subject_type values for this server. Valid types include `pairwise` and `public`.
|
98
|
+
attr_accessor :subject_type
|
99
|
+
|
100
|
+
# Requested Client Authentication method for the Token Endpoint. The options are client_secret_post, client_secret_basic, private_key_jwt, and none.
|
101
|
+
attr_accessor :token_endpoint_auth_method
|
102
|
+
|
103
|
+
# TermsOfServiceURI is a URL string that points to a human-readable terms of service document for the client that describes a contractual relationship between the end-user and the client that the end-user accepts when authorizing the client.
|
104
|
+
attr_accessor :tos_uri
|
105
|
+
|
106
|
+
# UpdatedAt returns the timestamp of the last update.
|
107
|
+
attr_accessor :updated_at
|
108
|
+
|
109
|
+
# JWS alg algorithm [JWA] REQUIRED for signing UserInfo Responses. If this is specified, the response will be JWT [JWT] serialized, and signed using JWS. The default, if omitted, is for the UserInfo Response to return the Claims as a UTF-8 encoded JSON object using the application/json content-type.
|
110
|
+
attr_accessor :userinfo_signed_response_alg
|
111
|
+
|
112
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
113
|
+
def self.attribute_map
|
114
|
+
{
|
115
|
+
:'allowed_cors_origins' => :'allowed_cors_origins',
|
116
|
+
:'audience' => :'audience',
|
117
|
+
:'backchannel_logout_session_required' => :'backchannel_logout_session_required',
|
118
|
+
:'backchannel_logout_uri' => :'backchannel_logout_uri',
|
119
|
+
:'client_id' => :'client_id',
|
120
|
+
:'client_name' => :'client_name',
|
121
|
+
:'client_secret' => :'client_secret',
|
122
|
+
:'client_secret_expires_at' => :'client_secret_expires_at',
|
123
|
+
:'client_uri' => :'client_uri',
|
124
|
+
:'contacts' => :'contacts',
|
125
|
+
:'created_at' => :'created_at',
|
126
|
+
:'frontchannel_logout_session_required' => :'frontchannel_logout_session_required',
|
127
|
+
:'frontchannel_logout_uri' => :'frontchannel_logout_uri',
|
128
|
+
:'grant_types' => :'grant_types',
|
129
|
+
:'jwks' => :'jwks',
|
130
|
+
:'jwks_uri' => :'jwks_uri',
|
131
|
+
:'logo_uri' => :'logo_uri',
|
132
|
+
:'metadata' => :'metadata',
|
133
|
+
:'owner' => :'owner',
|
134
|
+
:'policy_uri' => :'policy_uri',
|
135
|
+
:'post_logout_redirect_uris' => :'post_logout_redirect_uris',
|
136
|
+
:'redirect_uris' => :'redirect_uris',
|
137
|
+
:'request_object_signing_alg' => :'request_object_signing_alg',
|
138
|
+
:'request_uris' => :'request_uris',
|
139
|
+
:'response_types' => :'response_types',
|
140
|
+
:'scope' => :'scope',
|
141
|
+
:'sector_identifier_uri' => :'sector_identifier_uri',
|
142
|
+
:'subject_type' => :'subject_type',
|
143
|
+
:'token_endpoint_auth_method' => :'token_endpoint_auth_method',
|
144
|
+
:'tos_uri' => :'tos_uri',
|
145
|
+
:'updated_at' => :'updated_at',
|
146
|
+
:'userinfo_signed_response_alg' => :'userinfo_signed_response_alg'
|
147
|
+
}
|
148
|
+
end
|
149
|
+
|
150
|
+
# Attribute type mapping.
|
151
|
+
def self.openapi_types
|
152
|
+
{
|
153
|
+
:'allowed_cors_origins' => :'Array<String>',
|
154
|
+
:'audience' => :'Array<String>',
|
155
|
+
:'backchannel_logout_session_required' => :'Boolean',
|
156
|
+
:'backchannel_logout_uri' => :'String',
|
157
|
+
:'client_id' => :'String',
|
158
|
+
:'client_name' => :'String',
|
159
|
+
:'client_secret' => :'String',
|
160
|
+
:'client_secret_expires_at' => :'Integer',
|
161
|
+
:'client_uri' => :'String',
|
162
|
+
:'contacts' => :'Array<String>',
|
163
|
+
:'created_at' => :'DateTime',
|
164
|
+
:'frontchannel_logout_session_required' => :'Boolean',
|
165
|
+
:'frontchannel_logout_uri' => :'String',
|
166
|
+
:'grant_types' => :'Array<String>',
|
167
|
+
:'jwks' => :'JSONWebKeySet',
|
168
|
+
:'jwks_uri' => :'String',
|
169
|
+
:'logo_uri' => :'String',
|
170
|
+
:'metadata' => :'Hash<String, Object>',
|
171
|
+
:'owner' => :'String',
|
172
|
+
:'policy_uri' => :'String',
|
173
|
+
:'post_logout_redirect_uris' => :'Array<String>',
|
174
|
+
:'redirect_uris' => :'Array<String>',
|
175
|
+
:'request_object_signing_alg' => :'String',
|
176
|
+
:'request_uris' => :'Array<String>',
|
177
|
+
:'response_types' => :'Array<String>',
|
178
|
+
:'scope' => :'String',
|
179
|
+
:'sector_identifier_uri' => :'String',
|
180
|
+
:'subject_type' => :'String',
|
181
|
+
:'token_endpoint_auth_method' => :'String',
|
182
|
+
:'tos_uri' => :'String',
|
183
|
+
:'updated_at' => :'DateTime',
|
184
|
+
:'userinfo_signed_response_alg' => :'String'
|
185
|
+
}
|
186
|
+
end
|
187
|
+
|
188
|
+
# List of attributes with nullable: true
|
189
|
+
def self.openapi_nullable
|
190
|
+
Set.new([
|
191
|
+
])
|
192
|
+
end
|
193
|
+
|
194
|
+
# Initializes the object
|
195
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
196
|
+
def initialize(attributes = {})
|
197
|
+
if (!attributes.is_a?(Hash))
|
198
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OryHydraClient::OAuth2Client` initialize method"
|
199
|
+
end
|
200
|
+
|
201
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
202
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
203
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
204
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OryHydraClient::OAuth2Client`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
205
|
+
end
|
206
|
+
h[k.to_sym] = v
|
207
|
+
}
|
208
|
+
|
209
|
+
if attributes.key?(:'allowed_cors_origins')
|
210
|
+
if (value = attributes[:'allowed_cors_origins']).is_a?(Array)
|
211
|
+
self.allowed_cors_origins = value
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
if attributes.key?(:'audience')
|
216
|
+
if (value = attributes[:'audience']).is_a?(Array)
|
217
|
+
self.audience = value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'backchannel_logout_session_required')
|
222
|
+
self.backchannel_logout_session_required = attributes[:'backchannel_logout_session_required']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'backchannel_logout_uri')
|
226
|
+
self.backchannel_logout_uri = attributes[:'backchannel_logout_uri']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'client_id')
|
230
|
+
self.client_id = attributes[:'client_id']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'client_name')
|
234
|
+
self.client_name = attributes[:'client_name']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'client_secret')
|
238
|
+
self.client_secret = attributes[:'client_secret']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'client_secret_expires_at')
|
242
|
+
self.client_secret_expires_at = attributes[:'client_secret_expires_at']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'client_uri')
|
246
|
+
self.client_uri = attributes[:'client_uri']
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'contacts')
|
250
|
+
if (value = attributes[:'contacts']).is_a?(Array)
|
251
|
+
self.contacts = value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
if attributes.key?(:'created_at')
|
256
|
+
self.created_at = attributes[:'created_at']
|
257
|
+
end
|
258
|
+
|
259
|
+
if attributes.key?(:'frontchannel_logout_session_required')
|
260
|
+
self.frontchannel_logout_session_required = attributes[:'frontchannel_logout_session_required']
|
261
|
+
end
|
262
|
+
|
263
|
+
if attributes.key?(:'frontchannel_logout_uri')
|
264
|
+
self.frontchannel_logout_uri = attributes[:'frontchannel_logout_uri']
|
265
|
+
end
|
266
|
+
|
267
|
+
if attributes.key?(:'grant_types')
|
268
|
+
if (value = attributes[:'grant_types']).is_a?(Array)
|
269
|
+
self.grant_types = value
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
if attributes.key?(:'jwks')
|
274
|
+
self.jwks = attributes[:'jwks']
|
275
|
+
end
|
276
|
+
|
277
|
+
if attributes.key?(:'jwks_uri')
|
278
|
+
self.jwks_uri = attributes[:'jwks_uri']
|
279
|
+
end
|
280
|
+
|
281
|
+
if attributes.key?(:'logo_uri')
|
282
|
+
self.logo_uri = attributes[:'logo_uri']
|
283
|
+
end
|
284
|
+
|
285
|
+
if attributes.key?(:'metadata')
|
286
|
+
if (value = attributes[:'metadata']).is_a?(Hash)
|
287
|
+
self.metadata = value
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
if attributes.key?(:'owner')
|
292
|
+
self.owner = attributes[:'owner']
|
293
|
+
end
|
294
|
+
|
295
|
+
if attributes.key?(:'policy_uri')
|
296
|
+
self.policy_uri = attributes[:'policy_uri']
|
297
|
+
end
|
298
|
+
|
299
|
+
if attributes.key?(:'post_logout_redirect_uris')
|
300
|
+
if (value = attributes[:'post_logout_redirect_uris']).is_a?(Array)
|
301
|
+
self.post_logout_redirect_uris = value
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
if attributes.key?(:'redirect_uris')
|
306
|
+
if (value = attributes[:'redirect_uris']).is_a?(Array)
|
307
|
+
self.redirect_uris = value
|
308
|
+
end
|
309
|
+
end
|
310
|
+
|
311
|
+
if attributes.key?(:'request_object_signing_alg')
|
312
|
+
self.request_object_signing_alg = attributes[:'request_object_signing_alg']
|
313
|
+
end
|
314
|
+
|
315
|
+
if attributes.key?(:'request_uris')
|
316
|
+
if (value = attributes[:'request_uris']).is_a?(Array)
|
317
|
+
self.request_uris = value
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
if attributes.key?(:'response_types')
|
322
|
+
if (value = attributes[:'response_types']).is_a?(Array)
|
323
|
+
self.response_types = value
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
if attributes.key?(:'scope')
|
328
|
+
self.scope = attributes[:'scope']
|
329
|
+
end
|
330
|
+
|
331
|
+
if attributes.key?(:'sector_identifier_uri')
|
332
|
+
self.sector_identifier_uri = attributes[:'sector_identifier_uri']
|
333
|
+
end
|
334
|
+
|
335
|
+
if attributes.key?(:'subject_type')
|
336
|
+
self.subject_type = attributes[:'subject_type']
|
337
|
+
end
|
338
|
+
|
339
|
+
if attributes.key?(:'token_endpoint_auth_method')
|
340
|
+
self.token_endpoint_auth_method = attributes[:'token_endpoint_auth_method']
|
341
|
+
end
|
342
|
+
|
343
|
+
if attributes.key?(:'tos_uri')
|
344
|
+
self.tos_uri = attributes[:'tos_uri']
|
345
|
+
end
|
346
|
+
|
347
|
+
if attributes.key?(:'updated_at')
|
348
|
+
self.updated_at = attributes[:'updated_at']
|
349
|
+
end
|
350
|
+
|
351
|
+
if attributes.key?(:'userinfo_signed_response_alg')
|
352
|
+
self.userinfo_signed_response_alg = attributes[:'userinfo_signed_response_alg']
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
357
|
+
# @return Array for valid properties with the reasons
|
358
|
+
def list_invalid_properties
|
359
|
+
invalid_properties = Array.new
|
360
|
+
pattern = Regexp.new(/([a-zA-Z0-9\.\*]+\s?)+/)
|
361
|
+
if !@scope.nil? && @scope !~ pattern
|
362
|
+
invalid_properties.push("invalid value for \"scope\", must conform to the pattern #{pattern}.")
|
363
|
+
end
|
364
|
+
|
365
|
+
invalid_properties
|
366
|
+
end
|
367
|
+
|
368
|
+
# Check to see if the all the properties in the model are valid
|
369
|
+
# @return true if the model is valid
|
370
|
+
def valid?
|
371
|
+
return false if !@scope.nil? && @scope !~ Regexp.new(/([a-zA-Z0-9\.\*]+\s?)+/)
|
372
|
+
true
|
373
|
+
end
|
374
|
+
|
375
|
+
# Custom attribute writer method with validation
|
376
|
+
# @param [Object] scope Value to be assigned
|
377
|
+
def scope=(scope)
|
378
|
+
pattern = Regexp.new(/([a-zA-Z0-9\.\*]+\s?)+/)
|
379
|
+
if !scope.nil? && scope !~ pattern
|
380
|
+
fail ArgumentError, "invalid value for \"scope\", must conform to the pattern #{pattern}."
|
381
|
+
end
|
382
|
+
|
383
|
+
@scope = scope
|
384
|
+
end
|
385
|
+
|
386
|
+
# Checks equality by comparing each attribute.
|
387
|
+
# @param [Object] Object to be compared
|
388
|
+
def ==(o)
|
389
|
+
return true if self.equal?(o)
|
390
|
+
self.class == o.class &&
|
391
|
+
allowed_cors_origins == o.allowed_cors_origins &&
|
392
|
+
audience == o.audience &&
|
393
|
+
backchannel_logout_session_required == o.backchannel_logout_session_required &&
|
394
|
+
backchannel_logout_uri == o.backchannel_logout_uri &&
|
395
|
+
client_id == o.client_id &&
|
396
|
+
client_name == o.client_name &&
|
397
|
+
client_secret == o.client_secret &&
|
398
|
+
client_secret_expires_at == o.client_secret_expires_at &&
|
399
|
+
client_uri == o.client_uri &&
|
400
|
+
contacts == o.contacts &&
|
401
|
+
created_at == o.created_at &&
|
402
|
+
frontchannel_logout_session_required == o.frontchannel_logout_session_required &&
|
403
|
+
frontchannel_logout_uri == o.frontchannel_logout_uri &&
|
404
|
+
grant_types == o.grant_types &&
|
405
|
+
jwks == o.jwks &&
|
406
|
+
jwks_uri == o.jwks_uri &&
|
407
|
+
logo_uri == o.logo_uri &&
|
408
|
+
metadata == o.metadata &&
|
409
|
+
owner == o.owner &&
|
410
|
+
policy_uri == o.policy_uri &&
|
411
|
+
post_logout_redirect_uris == o.post_logout_redirect_uris &&
|
412
|
+
redirect_uris == o.redirect_uris &&
|
413
|
+
request_object_signing_alg == o.request_object_signing_alg &&
|
414
|
+
request_uris == o.request_uris &&
|
415
|
+
response_types == o.response_types &&
|
416
|
+
scope == o.scope &&
|
417
|
+
sector_identifier_uri == o.sector_identifier_uri &&
|
418
|
+
subject_type == o.subject_type &&
|
419
|
+
token_endpoint_auth_method == o.token_endpoint_auth_method &&
|
420
|
+
tos_uri == o.tos_uri &&
|
421
|
+
updated_at == o.updated_at &&
|
422
|
+
userinfo_signed_response_alg == o.userinfo_signed_response_alg
|
423
|
+
end
|
424
|
+
|
425
|
+
# @see the `==` method
|
426
|
+
# @param [Object] Object to be compared
|
427
|
+
def eql?(o)
|
428
|
+
self == o
|
429
|
+
end
|
430
|
+
|
431
|
+
# Calculates hash code according to all attributes.
|
432
|
+
# @return [Integer] Hash code
|
433
|
+
def hash
|
434
|
+
[allowed_cors_origins, audience, backchannel_logout_session_required, backchannel_logout_uri, client_id, client_name, client_secret, client_secret_expires_at, client_uri, contacts, created_at, frontchannel_logout_session_required, frontchannel_logout_uri, grant_types, jwks, jwks_uri, logo_uri, metadata, owner, policy_uri, post_logout_redirect_uris, redirect_uris, request_object_signing_alg, request_uris, response_types, scope, sector_identifier_uri, subject_type, token_endpoint_auth_method, tos_uri, updated_at, userinfo_signed_response_alg].hash
|
435
|
+
end
|
436
|
+
|
437
|
+
# Builds the object from hash
|
438
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
439
|
+
# @return [Object] Returns the model itself
|
440
|
+
def self.build_from_hash(attributes)
|
441
|
+
new.build_from_hash(attributes)
|
442
|
+
end
|
443
|
+
|
444
|
+
# Builds the object from hash
|
445
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
446
|
+
# @return [Object] Returns the model itself
|
447
|
+
def build_from_hash(attributes)
|
448
|
+
return nil unless attributes.is_a?(Hash)
|
449
|
+
self.class.openapi_types.each_pair do |key, type|
|
450
|
+
if type =~ /\AArray<(.*)>/i
|
451
|
+
# check to ensure the input is an array given that the attribute
|
452
|
+
# is documented as an array but the input is not
|
453
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
454
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
455
|
+
end
|
456
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
457
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
458
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
459
|
+
end
|
460
|
+
|
461
|
+
self
|
462
|
+
end
|
463
|
+
|
464
|
+
# Deserializes the data based on type
|
465
|
+
# @param string type Data type
|
466
|
+
# @param string value Value to be deserialized
|
467
|
+
# @return [Object] Deserialized data
|
468
|
+
def _deserialize(type, value)
|
469
|
+
case type.to_sym
|
470
|
+
when :DateTime
|
471
|
+
DateTime.parse(value)
|
472
|
+
when :Date
|
473
|
+
Date.parse(value)
|
474
|
+
when :String
|
475
|
+
value.to_s
|
476
|
+
when :Integer
|
477
|
+
value.to_i
|
478
|
+
when :Float
|
479
|
+
value.to_f
|
480
|
+
when :Boolean
|
481
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
482
|
+
true
|
483
|
+
else
|
484
|
+
false
|
485
|
+
end
|
486
|
+
when :Object
|
487
|
+
# generic object (usually a Hash), return directly
|
488
|
+
value
|
489
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
490
|
+
inner_type = Regexp.last_match[:inner_type]
|
491
|
+
value.map { |v| _deserialize(inner_type, v) }
|
492
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
493
|
+
k_type = Regexp.last_match[:k_type]
|
494
|
+
v_type = Regexp.last_match[:v_type]
|
495
|
+
{}.tap do |hash|
|
496
|
+
value.each do |k, v|
|
497
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
498
|
+
end
|
499
|
+
end
|
500
|
+
else # model
|
501
|
+
OryHydraClient.const_get(type).build_from_hash(value)
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
# Returns the string representation of the object
|
506
|
+
# @return [String] String presentation of the object
|
507
|
+
def to_s
|
508
|
+
to_hash.to_s
|
509
|
+
end
|
510
|
+
|
511
|
+
# to_body is an alias to to_hash (backward compatibility)
|
512
|
+
# @return [Hash] Returns the object in the form of hash
|
513
|
+
def to_body
|
514
|
+
to_hash
|
515
|
+
end
|
516
|
+
|
517
|
+
# Returns the object in the form of hash
|
518
|
+
# @return [Hash] Returns the object in the form of hash
|
519
|
+
def to_hash
|
520
|
+
hash = {}
|
521
|
+
self.class.attribute_map.each_pair do |attr, param|
|
522
|
+
value = self.send(attr)
|
523
|
+
if value.nil?
|
524
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
525
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
526
|
+
end
|
527
|
+
|
528
|
+
hash[param] = _to_hash(value)
|
529
|
+
end
|
530
|
+
hash
|
531
|
+
end
|
532
|
+
|
533
|
+
# Outputs non-array value in the form of hash
|
534
|
+
# For object, use to_hash. Otherwise, just return the value
|
535
|
+
# @param [Object] value Any valid value
|
536
|
+
# @return [Hash] Returns the value in the form of hash
|
537
|
+
def _to_hash(value)
|
538
|
+
if value.is_a?(Array)
|
539
|
+
value.compact.map { |v| _to_hash(v) }
|
540
|
+
elsif value.is_a?(Hash)
|
541
|
+
{}.tap do |hash|
|
542
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
543
|
+
end
|
544
|
+
elsif value.respond_to? :to_hash
|
545
|
+
value.to_hash
|
546
|
+
else
|
547
|
+
value
|
548
|
+
end
|
549
|
+
end
|
550
|
+
end
|
551
|
+
end
|