Class: Authentik::Api::PatchedSAMLSourceRequest

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

Overview

SAMLSource Serializer

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
278
279
280
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
322
323
324
325
326
327
328
329
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 200

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#allow_idp_initiatedObject

Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done.



59
60
61
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 59

def allow_idp_initiated
  @allow_idp_initiated
end

#authentication_flowObject

Flow to use when authenticating existing users.



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

def authentication_flow
  @authentication_flow
end

#binding_typeObject

Returns the value of attribute binding_type.



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

def binding_type
  @binding_type
end

#digest_algorithmObject

Returns the value of attribute digest_algorithm.



72
73
74
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 72

def digest_algorithm
  @digest_algorithm
end

#enabledObject

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#encryption_kpObject

When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key.



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

def encryption_kp
  @encryption_kp
end

#enrollment_flowObject

Flow to use when enrolling new users.



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

def enrollment_flow
  @enrollment_flow
end

#group_matching_modeObject

How the source determines if an existing group should be used or a new group created.



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

def group_matching_mode
  @group_matching_mode
end

#group_property_mappingsObject

Returns the value of attribute group_property_mappings.



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

def group_property_mappings
  @group_property_mappings
end

#iconObject

Returns the value of attribute icon.



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

def icon
  @icon
end

#issuerObject

Also known as Entity ID. Defaults the Metadata URL.



50
51
52
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 50

def issuer
  @issuer
end

#nameObject

Source’s display Name.



14
15
16
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 14

def name
  @name
end

#name_id_policyObject

NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent.



62
63
64
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 62

def name_id_policy
  @name_id_policy
end

#policy_engine_modeObject

Returns the value of attribute policy_engine_mode.



34
35
36
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 34

def policy_engine_mode
  @policy_engine_mode
end

#pre_authentication_flowObject

Flow used before authentication.



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

def pre_authentication_flow
  @pre_authentication_flow
end

When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon.



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

def promoted
  @promoted
end

#signature_algorithmObject

Returns the value of attribute signature_algorithm.



74
75
76
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 74

def signature_algorithm
  @signature_algorithm
end

#signed_assertionObject

Returns the value of attribute signed_assertion.



82
83
84
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 82

def signed_assertion
  @signed_assertion
end

#signed_responseObject

Returns the value of attribute signed_response.



84
85
86
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 84

def signed_response
  @signed_response
end

#signing_kpObject

Keypair used to sign outgoing Responses going to the Identity Provider.



70
71
72
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 70

def signing_kp
  @signing_kp
end

#slo_urlObject

Optional URL if your IDP supports Single-Logout.



56
57
58
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 56

def slo_url
  @slo_url
end

#slugObject

Internal source name, used in URLs.



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

def slug
  @slug
end

#sso_urlObject

URL that the initial Login request is sent to.



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

def sso_url
  @sso_url
end

#temporary_user_delete_afterObject

Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format ‘transient’, and the user doesn’t log out manually. (Format: hours=1;minutes=2;seconds=3).



77
78
79
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 77

def temporary_user_delete_after
  @temporary_user_delete_after
end

#user_matching_modeObject

How the source determines if an existing user should be authenticated or a new user enrolled.



37
38
39
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 37

def user_matching_mode
  @user_matching_mode
end

#user_path_templateObject

Returns the value of attribute user_path_template.



39
40
41
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 39

def user_path_template
  @user_path_template
end

#user_property_mappingsObject

Returns the value of attribute user_property_mappings.



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

def user_property_mappings
  @user_property_mappings
end

#verification_kpObject

When selected, incoming assertion’s Signatures will be validated against this certificate. To allow unsigned Requests, leave on default.



67
68
69
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 67

def verification_kp
  @verification_kp
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



143
144
145
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 143

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



148
149
150
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 148

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'name' => :'name',
    :'slug' => :'slug',
    :'enabled' => :'enabled',
    :'promoted' => :'promoted',
    :'authentication_flow' => :'authentication_flow',
    :'enrollment_flow' => :'enrollment_flow',
    :'user_property_mappings' => :'user_property_mappings',
    :'group_property_mappings' => :'group_property_mappings',
    :'policy_engine_mode' => :'policy_engine_mode',
    :'user_matching_mode' => :'user_matching_mode',
    :'user_path_template' => :'user_path_template',
    :'icon' => :'icon',
    :'group_matching_mode' => :'group_matching_mode',
    :'pre_authentication_flow' => :'pre_authentication_flow',
    :'issuer' => :'issuer',
    :'sso_url' => :'sso_url',
    :'slo_url' => :'slo_url',
    :'allow_idp_initiated' => :'allow_idp_initiated',
    :'name_id_policy' => :'name_id_policy',
    :'binding_type' => :'binding_type',
    :'verification_kp' => :'verification_kp',
    :'signing_kp' => :'signing_kp',
    :'digest_algorithm' => :'digest_algorithm',
    :'signature_algorithm' => :'signature_algorithm',
    :'temporary_user_delete_after' => :'temporary_user_delete_after',
    :'encryption_kp' => :'encryption_kp',
    :'signed_assertion' => :'signed_assertion',
    :'signed_response' => :'signed_response'
  }
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



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 502

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



187
188
189
190
191
192
193
194
195
196
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 187

def self.openapi_nullable
  Set.new([
    :'authentication_flow',
    :'enrollment_flow',
    :'slo_url',
    :'verification_kp',
    :'signing_kp',
    :'encryption_kp',
  ])
end

.openapi_typesObject

Attribute type mapping.



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 153

def self.openapi_types
  {
    :'name' => :'String',
    :'slug' => :'String',
    :'enabled' => :'Boolean',
    :'promoted' => :'Boolean',
    :'authentication_flow' => :'String',
    :'enrollment_flow' => :'String',
    :'user_property_mappings' => :'Array<String>',
    :'group_property_mappings' => :'Array<String>',
    :'policy_engine_mode' => :'PolicyEngineMode',
    :'user_matching_mode' => :'UserMatchingModeEnum',
    :'user_path_template' => :'String',
    :'icon' => :'String',
    :'group_matching_mode' => :'GroupMatchingModeEnum',
    :'pre_authentication_flow' => :'String',
    :'issuer' => :'String',
    :'sso_url' => :'String',
    :'slo_url' => :'String',
    :'allow_idp_initiated' => :'Boolean',
    :'name_id_policy' => :'SAMLNameIDPolicyEnum',
    :'binding_type' => :'BindingTypeEnum',
    :'verification_kp' => :'String',
    :'signing_kp' => :'String',
    :'digest_algorithm' => :'DigestAlgorithmEnum',
    :'signature_algorithm' => :'SignatureAlgorithmEnum',
    :'temporary_user_delete_after' => :'String',
    :'encryption_kp' => :'String',
    :'signed_assertion' => :'Boolean',
    :'signed_response' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 454

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      slug == o.slug &&
      enabled == o.enabled &&
      promoted == o.promoted &&
      authentication_flow == o.authentication_flow &&
      enrollment_flow == o.enrollment_flow &&
      user_property_mappings == o.user_property_mappings &&
      group_property_mappings == o.group_property_mappings &&
      policy_engine_mode == o.policy_engine_mode &&
      user_matching_mode == o.user_matching_mode &&
      user_path_template == o.user_path_template &&
      icon == o.icon &&
      group_matching_mode == o.group_matching_mode &&
      pre_authentication_flow == o.pre_authentication_flow &&
      issuer == o.issuer &&
      sso_url == o.sso_url &&
      slo_url == o.slo_url &&
      allow_idp_initiated == o.allow_idp_initiated &&
      name_id_policy == o.name_id_policy &&
      binding_type == o.binding_type &&
      verification_kp == o.verification_kp &&
      signing_kp == o.signing_kp &&
      digest_algorithm == o.digest_algorithm &&
      signature_algorithm == o.signature_algorithm &&
      temporary_user_delete_after == o.temporary_user_delete_after &&
      encryption_kp == o.encryption_kp &&
      signed_assertion == o.signed_assertion &&
      signed_response == o.signed_response
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


489
490
491
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 489

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



495
496
497
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 495

def hash
  [name, slug, enabled, promoted, authentication_flow, enrollment_flow, user_property_mappings, group_property_mappings, policy_engine_mode, user_matching_mode, user_path_template, icon, group_matching_mode, pre_authentication_flow, issuer, sso_url, slo_url, allow_idp_initiated, name_id_policy, binding_type, verification_kp, signing_kp, digest_algorithm, signature_algorithm, temporary_user_delete_after, encryption_kp, signed_assertion, signed_response].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 333

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if !@name.nil? && @name.to_s.length < 1
    invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
  end

  if !@slug.nil? && @slug.to_s.length < 1
    invalid_properties.push('invalid value for "slug", the character length must be greater than or equal to 1.')
  end

  pattern = Regexp.new(/^[-a-zA-Z0-9_]+$/)
  if !@slug.nil? && @slug !~ pattern
    invalid_properties.push("invalid value for \"slug\", must conform to the pattern #{pattern}.")
  end

  if !@user_path_template.nil? && @user_path_template.to_s.length < 1
    invalid_properties.push('invalid value for "user_path_template", the character length must be greater than or equal to 1.')
  end

  if !@sso_url.nil? && @sso_url.to_s.length < 1
    invalid_properties.push('invalid value for "sso_url", the character length must be greater than or equal to 1.')
  end

  if !@temporary_user_delete_after.nil? && @temporary_user_delete_after.to_s.length < 1
    invalid_properties.push('invalid value for "temporary_user_delete_after", the character length must be greater than or equal to 1.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



524
525
526
527
528
529
530
531
532
533
534
535
536
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 524

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



366
367
368
369
370
371
372
373
374
375
# File 'lib/authentik/api/models/patched_saml_source_request.rb', line 366

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if !@name.nil? && @name.to_s.length < 1
  return false if !@slug.nil? && @slug.to_s.length < 1
  return false if !@slug.nil? && @slug !~ Regexp.new(/^[-a-zA-Z0-9_]+$/)
  return false if !@user_path_template.nil? && @user_path_template.to_s.length < 1
  return false if !@sso_url.nil? && @sso_url.to_s.length < 1
  return false if !@temporary_user_delete_after.nil? && @temporary_user_delete_after.to_s.length < 1
  true
end