Class: Authentik::Api::OpenIDConnectConfiguration

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/authentik/api/models/open_id_connect_configuration.rb

Overview

rest_framework Serializer for OIDC Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ OpenIDConnectConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 87

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::OpenIDConnectConfiguration` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::OpenIDConnectConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'issuer')
    self.issuer = attributes[:'issuer']
  else
    self.issuer = nil
  end

  if attributes.key?(:'authorization_endpoint')
    self.authorization_endpoint = attributes[:'authorization_endpoint']
  else
    self.authorization_endpoint = nil
  end

  if attributes.key?(:'token_endpoint')
    self.token_endpoint = attributes[:'token_endpoint']
  else
    self.token_endpoint = nil
  end

  if attributes.key?(:'userinfo_endpoint')
    self.userinfo_endpoint = attributes[:'userinfo_endpoint']
  else
    self.userinfo_endpoint = nil
  end

  if attributes.key?(:'end_session_endpoint')
    self.end_session_endpoint = attributes[:'end_session_endpoint']
  else
    self.end_session_endpoint = nil
  end

  if attributes.key?(:'introspection_endpoint')
    self.introspection_endpoint = attributes[:'introspection_endpoint']
  else
    self.introspection_endpoint = nil
  end

  if attributes.key?(:'jwks_uri')
    self.jwks_uri = attributes[:'jwks_uri']
  else
    self.jwks_uri = nil
  end

  if attributes.key?(:'response_types_supported')
    if (value = attributes[:'response_types_supported']).is_a?(Array)
      self.response_types_supported = value
    end
  else
    self.response_types_supported = nil
  end

  if attributes.key?(:'id_token_signing_alg_values_supported')
    if (value = attributes[:'id_token_signing_alg_values_supported']).is_a?(Array)
      self.id_token_signing_alg_values_supported = value
    end
  else
    self.id_token_signing_alg_values_supported = nil
  end

  if attributes.key?(:'subject_types_supported')
    if (value = attributes[:'subject_types_supported']).is_a?(Array)
      self.subject_types_supported = value
    end
  else
    self.subject_types_supported = nil
  end

  if attributes.key?(:'token_endpoint_auth_methods_supported')
    if (value = attributes[:'token_endpoint_auth_methods_supported']).is_a?(Array)
      self.token_endpoint_auth_methods_supported = value
    end
  else
    self.token_endpoint_auth_methods_supported = nil
  end
end

Instance Attribute Details

#authorization_endpointObject

Returns the value of attribute authorization_endpoint.



15
16
17
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 15

def authorization_endpoint
  @authorization_endpoint
end

#end_session_endpointObject

Returns the value of attribute end_session_endpoint.



21
22
23
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 21

def end_session_endpoint
  @end_session_endpoint
end

#id_token_signing_alg_values_supportedObject

Returns the value of attribute id_token_signing_alg_values_supported.



29
30
31
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 29

def id_token_signing_alg_values_supported
  @id_token_signing_alg_values_supported
end

#introspection_endpointObject

Returns the value of attribute introspection_endpoint.



23
24
25
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 23

def introspection_endpoint
  @introspection_endpoint
end

#issuerObject

Returns the value of attribute issuer.



13
14
15
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 13

def issuer
  @issuer
end

#jwks_uriObject

Returns the value of attribute jwks_uri.



25
26
27
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 25

def jwks_uri
  @jwks_uri
end

#response_types_supportedObject

Returns the value of attribute response_types_supported.



27
28
29
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 27

def response_types_supported
  @response_types_supported
end

#subject_types_supportedObject

Returns the value of attribute subject_types_supported.



31
32
33
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 31

def subject_types_supported
  @subject_types_supported
end

#token_endpointObject

Returns the value of attribute token_endpoint.



17
18
19
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 17

def token_endpoint
  @token_endpoint
end

#token_endpoint_auth_methods_supportedObject

Returns the value of attribute token_endpoint_auth_methods_supported.



33
34
35
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 33

def token_endpoint_auth_methods_supported
  @token_endpoint_auth_methods_supported
end

#userinfo_endpointObject

Returns the value of attribute userinfo_endpoint.



19
20
21
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 19

def userinfo_endpoint
  @userinfo_endpoint
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



53
54
55
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 53

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



58
59
60
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 58

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 36

def self.attribute_map
  {
    :'issuer' => :'issuer',
    :'authorization_endpoint' => :'authorization_endpoint',
    :'token_endpoint' => :'token_endpoint',
    :'userinfo_endpoint' => :'userinfo_endpoint',
    :'end_session_endpoint' => :'end_session_endpoint',
    :'introspection_endpoint' => :'introspection_endpoint',
    :'jwks_uri' => :'jwks_uri',
    :'response_types_supported' => :'response_types_supported',
    :'id_token_signing_alg_values_supported' => :'id_token_signing_alg_values_supported',
    :'subject_types_supported' => :'subject_types_supported',
    :'token_endpoint_auth_methods_supported' => :'token_endpoint_auth_methods_supported'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 389

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



80
81
82
83
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 80

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 63

def self.openapi_types
  {
    :'issuer' => :'String',
    :'authorization_endpoint' => :'String',
    :'token_endpoint' => :'String',
    :'userinfo_endpoint' => :'String',
    :'end_session_endpoint' => :'String',
    :'introspection_endpoint' => :'String',
    :'jwks_uri' => :'String',
    :'response_types_supported' => :'Array<String>',
    :'id_token_signing_alg_values_supported' => :'Array<String>',
    :'subject_types_supported' => :'Array<String>',
    :'token_endpoint_auth_methods_supported' => :'Array<String>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 358

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      issuer == o.issuer &&
      authorization_endpoint == o.authorization_endpoint &&
      token_endpoint == o.token_endpoint &&
      userinfo_endpoint == o.userinfo_endpoint &&
      end_session_endpoint == o.end_session_endpoint &&
      introspection_endpoint == o.introspection_endpoint &&
      jwks_uri == o.jwks_uri &&
      response_types_supported == o.response_types_supported &&
      id_token_signing_alg_values_supported == o.id_token_signing_alg_values_supported &&
      subject_types_supported == o.subject_types_supported &&
      token_endpoint_auth_methods_supported == o.token_endpoint_auth_methods_supported
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


376
377
378
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 376

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



382
383
384
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 382

def hash
  [issuer, authorization_endpoint, token_endpoint, userinfo_endpoint, end_session_endpoint, introspection_endpoint, jwks_uri, response_types_supported, id_token_signing_alg_values_supported, subject_types_supported, token_endpoint_auth_methods_supported].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 178

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @issuer.nil?
    invalid_properties.push('invalid value for "issuer", issuer cannot be nil.')
  end

  if @authorization_endpoint.nil?
    invalid_properties.push('invalid value for "authorization_endpoint", authorization_endpoint cannot be nil.')
  end

  if @token_endpoint.nil?
    invalid_properties.push('invalid value for "token_endpoint", token_endpoint cannot be nil.')
  end

  if @userinfo_endpoint.nil?
    invalid_properties.push('invalid value for "userinfo_endpoint", userinfo_endpoint cannot be nil.')
  end

  if @end_session_endpoint.nil?
    invalid_properties.push('invalid value for "end_session_endpoint", end_session_endpoint cannot be nil.')
  end

  if @introspection_endpoint.nil?
    invalid_properties.push('invalid value for "introspection_endpoint", introspection_endpoint cannot be nil.')
  end

  if @jwks_uri.nil?
    invalid_properties.push('invalid value for "jwks_uri", jwks_uri cannot be nil.')
  end

  if @response_types_supported.nil?
    invalid_properties.push('invalid value for "response_types_supported", response_types_supported cannot be nil.')
  end

  if @id_token_signing_alg_values_supported.nil?
    invalid_properties.push('invalid value for "id_token_signing_alg_values_supported", id_token_signing_alg_values_supported cannot be nil.')
  end

  if @subject_types_supported.nil?
    invalid_properties.push('invalid value for "subject_types_supported", subject_types_supported cannot be nil.')
  end

  if @token_endpoint_auth_methods_supported.nil?
    invalid_properties.push('invalid value for "token_endpoint_auth_methods_supported", token_endpoint_auth_methods_supported cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 411

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/authentik/api/models/open_id_connect_configuration.rb', line 230

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @issuer.nil?
  return false if @authorization_endpoint.nil?
  return false if @token_endpoint.nil?
  return false if @userinfo_endpoint.nil?
  return false if @end_session_endpoint.nil?
  return false if @introspection_endpoint.nil?
  return false if @jwks_uri.nil?
  return false if @response_types_supported.nil?
  return false if @id_token_signing_alg_values_supported.nil?
  return false if @subject_types_supported.nil?
  return false if @token_endpoint_auth_methods_supported.nil?
  true
end