Class: Authentik::Api::ProxyOutpostConfig

Inherits:
ApiModelBase show all
Defined in:
lib/authentik/api/models/proxy_outpost_config.rb

Overview

Proxy provider serializer for outposts

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ ProxyOutpostConfig

Initializes the object

Parameters:

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

    Model attributes in the form of hash



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 162

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::ProxyOutpostConfig` 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::ProxyOutpostConfig`. 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?(:'pk')
    self.pk = attributes[:'pk']
  else
    self.pk = nil
  end

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

  if attributes.key?(:'internal_host')
    self.internal_host = attributes[:'internal_host']
  end

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

  if attributes.key?(:'internal_host_ssl_validation')
    self.internal_host_ssl_validation = attributes[:'internal_host_ssl_validation']
  end

  if attributes.key?(:'client_id')
    self.client_id = attributes[:'client_id']
  end

  if attributes.key?(:'client_secret')
    self.client_secret = attributes[:'client_secret']
  end

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

  if attributes.key?(:'cookie_secret')
    self.cookie_secret = attributes[:'cookie_secret']
  end

  if attributes.key?(:'certificate')
    self.certificate = attributes[:'certificate']
  end

  if attributes.key?(:'skip_path_regex')
    self.skip_path_regex = attributes[:'skip_path_regex']
  end

  if attributes.key?(:'basic_auth_enabled')
    self.basic_auth_enabled = attributes[:'basic_auth_enabled']
  end

  if attributes.key?(:'basic_auth_password_attribute')
    self.basic_auth_password_attribute = attributes[:'basic_auth_password_attribute']
  end

  if attributes.key?(:'basic_auth_user_attribute')
    self.basic_auth_user_attribute = attributes[:'basic_auth_user_attribute']
  end

  if attributes.key?(:'mode')
    self.mode = attributes[:'mode']
  end

  if attributes.key?(:'cookie_domain')
    self.cookie_domain = attributes[:'cookie_domain']
  end

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

  if attributes.key?(:'intercept_header_auth')
    self.intercept_header_auth = attributes[:'intercept_header_auth']
  end

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

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

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

Instance Attribute Details

#access_token_validityObject

Get token validity as second count



52
53
54
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 52

def access_token_validity
  @access_token_validity
end

#assigned_application_nameObject

Application’s display Name.



64
65
66
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 64

def assigned_application_name
  @assigned_application_name
end

#assigned_application_slugObject

Internal application name, used in URLs.



61
62
63
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 61

def assigned_application_slug
  @assigned_application_slug
end

#basic_auth_enabledObject

Set a custom HTTP-Basic Authentication header based on values from authentik.



38
39
40
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 38

def basic_auth_enabled
  @basic_auth_enabled
end

#basic_auth_password_attributeObject

User/Group Attribute used for the password part of the HTTP-Basic Header.



41
42
43
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 41

def basic_auth_password_attribute
  @basic_auth_password_attribute
end

#basic_auth_user_attributeObject

User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user’s Email address is used.



44
45
46
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 44

def basic_auth_user_attribute
  @basic_auth_user_attribute
end

#certificateObject

Returns the value of attribute certificate.



32
33
34
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 32

def certificate
  @certificate
end

#client_idObject

Returns the value of attribute client_id.



24
25
26
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 24

def client_id
  @client_id
end

#client_secretObject

Returns the value of attribute client_secret.



26
27
28
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 26

def client_secret
  @client_secret
end

Returns the value of attribute cookie_domain.



49
50
51
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 49

def cookie_domain
  @cookie_domain
end

Returns the value of attribute cookie_secret.



30
31
32
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 30

def cookie_secret
  @cookie_secret
end

#external_hostObject

Returns the value of attribute external_host.



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

def external_host
  @external_host
end

#intercept_header_authObject

When enabled, this provider will intercept the authorization header and authenticate requests based on its value.



55
56
57
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 55

def intercept_header_auth
  @intercept_header_auth
end

#internal_hostObject

Returns the value of attribute internal_host.



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

def internal_host
  @internal_host
end

#internal_host_ssl_validationObject

Validate SSL Certificates of upstream servers



22
23
24
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 22

def internal_host_ssl_validation
  @internal_host_ssl_validation
end

#modeObject

Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host.



47
48
49
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 47

def mode
  @mode
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#oidc_configurationObject

Returns the value of attribute oidc_configuration.



28
29
30
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 28

def oidc_configuration
  @oidc_configuration
end

#pkObject

Returns the value of attribute pk.



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

def pk
  @pk
end

#scopes_to_requestObject

Get all the scope names the outpost should request, including custom-defined ones



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

def scopes_to_request
  @scopes_to_request
end

#skip_path_regexObject

Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression.



35
36
37
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 35

def skip_path_regex
  @skip_path_regex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



116
117
118
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 116

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



121
122
123
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 121

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 89

def self.attribute_map
  {
    :'pk' => :'pk',
    :'name' => :'name',
    :'internal_host' => :'internal_host',
    :'external_host' => :'external_host',
    :'internal_host_ssl_validation' => :'internal_host_ssl_validation',
    :'client_id' => :'client_id',
    :'client_secret' => :'client_secret',
    :'oidc_configuration' => :'oidc_configuration',
    :'cookie_secret' => :'cookie_secret',
    :'certificate' => :'certificate',
    :'skip_path_regex' => :'skip_path_regex',
    :'basic_auth_enabled' => :'basic_auth_enabled',
    :'basic_auth_password_attribute' => :'basic_auth_password_attribute',
    :'basic_auth_user_attribute' => :'basic_auth_user_attribute',
    :'mode' => :'mode',
    :'cookie_domain' => :'cookie_domain',
    :'access_token_validity' => :'access_token_validity',
    :'intercept_header_auth' => :'intercept_header_auth',
    :'scopes_to_request' => :'scopes_to_request',
    :'assigned_application_slug' => :'assigned_application_slug',
    :'assigned_application_name' => :'assigned_application_name'
  }
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



480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 480

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



153
154
155
156
157
158
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 153

def self.openapi_nullable
  Set.new([
    :'certificate',
    :'access_token_validity',
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 126

def self.openapi_types
  {
    :'pk' => :'Integer',
    :'name' => :'String',
    :'internal_host' => :'String',
    :'external_host' => :'String',
    :'internal_host_ssl_validation' => :'Boolean',
    :'client_id' => :'String',
    :'client_secret' => :'String',
    :'oidc_configuration' => :'OpenIDConnectConfiguration',
    :'cookie_secret' => :'String',
    :'certificate' => :'String',
    :'skip_path_regex' => :'String',
    :'basic_auth_enabled' => :'Boolean',
    :'basic_auth_password_attribute' => :'String',
    :'basic_auth_user_attribute' => :'String',
    :'mode' => :'ProxyMode',
    :'cookie_domain' => :'String',
    :'access_token_validity' => :'Float',
    :'intercept_header_auth' => :'Boolean',
    :'scopes_to_request' => :'Array<String>',
    :'assigned_application_slug' => :'String',
    :'assigned_application_name' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 439

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pk == o.pk &&
      name == o.name &&
      internal_host == o.internal_host &&
      external_host == o.external_host &&
      internal_host_ssl_validation == o.internal_host_ssl_validation &&
      client_id == o.client_id &&
      client_secret == o.client_secret &&
      oidc_configuration == o.oidc_configuration &&
      cookie_secret == o.cookie_secret &&
      certificate == o.certificate &&
      skip_path_regex == o.skip_path_regex &&
      basic_auth_enabled == o.basic_auth_enabled &&
      basic_auth_password_attribute == o.basic_auth_password_attribute &&
      basic_auth_user_attribute == o.basic_auth_user_attribute &&
      mode == o.mode &&
      cookie_domain == o.cookie_domain &&
      access_token_validity == o.access_token_validity &&
      intercept_header_auth == o.intercept_header_auth &&
      scopes_to_request == o.scopes_to_request &&
      assigned_application_slug == o.assigned_application_slug &&
      assigned_application_name == o.assigned_application_name
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


467
468
469
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 467

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



473
474
475
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 473

def hash
  [pk, name, internal_host, external_host, internal_host_ssl_validation, client_id, client_secret, oidc_configuration, cookie_secret, certificate, skip_path_regex, basic_auth_enabled, basic_auth_password_attribute, basic_auth_user_attribute, mode, cookie_domain, access_token_validity, intercept_header_auth, scopes_to_request, assigned_application_slug, assigned_application_name].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 281

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

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

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

  if !@client_id.nil? && @client_id.to_s.length > 255
    invalid_properties.push('invalid value for "client_id", the character length must be smaller than or equal to 255.')
  end

  if !@client_secret.nil? && @client_secret.to_s.length > 255
    invalid_properties.push('invalid value for "client_secret", the character length must be smaller than or equal to 255.')
  end

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

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

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

  if @assigned_application_name.nil?
    invalid_properties.push('invalid value for "assigned_application_name", assigned_application_name 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



502
503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 502

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



325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/authentik/api/models/proxy_outpost_config.rb', line 325

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @pk.nil?
  return false if @name.nil?
  return false if @external_host.nil?
  return false if !@client_id.nil? && @client_id.to_s.length > 255
  return false if !@client_secret.nil? && @client_secret.to_s.length > 255
  return false if @oidc_configuration.nil?
  return false if @scopes_to_request.nil?
  return false if @assigned_application_slug.nil?
  return false if @assigned_application_name.nil?
  true
end