Class: Authentik::Api::LDAPProviderRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Authentik::Api::LDAPProviderRequest
- Defined in:
- lib/authentik/api/models/ldap_provider_request.rb
Overview
LDAPProvider Serializer
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#authentication_flow ⇒ Object
Flow used for authentication when the associated application is accessed by an un-authenticated user.
-
#authorization_flow ⇒ Object
Flow used when authorizing this provider.
-
#base_dn ⇒ Object
DN under which objects are accessible.
-
#bind_mode ⇒ Object
Returns the value of attribute bind_mode.
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#gid_start_number ⇒ Object
The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren’t too low for POSIX groups.
-
#invalidation_flow ⇒ Object
Flow used ending the session from a provider.
-
#mfa_support ⇒ Object
When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password.
-
#name ⇒ Object
Returns the value of attribute name.
-
#property_mappings ⇒ Object
Returns the value of attribute property_mappings.
-
#search_mode ⇒ Object
Returns the value of attribute search_mode.
-
#tls_server_name ⇒ Object
Returns the value of attribute tls_server_name.
-
#uid_start_number ⇒ Object
The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren’t too low for POSIX users.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ LDAPProviderRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ LDAPProviderRequest
Initializes the object
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 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 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 126 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::LDAPProviderRequest` 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::LDAPProviderRequest`. 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'] else self.name = nil end if attributes.key?(:'authentication_flow') self.authentication_flow = attributes[:'authentication_flow'] end if attributes.key?(:'authorization_flow') self. = attributes[:'authorization_flow'] else self. = nil end if attributes.key?(:'invalidation_flow') self.invalidation_flow = attributes[:'invalidation_flow'] else self.invalidation_flow = nil end if attributes.key?(:'property_mappings') if (value = attributes[:'property_mappings']).is_a?(Array) self.property_mappings = value end end if attributes.key?(:'base_dn') self.base_dn = attributes[:'base_dn'] end if attributes.key?(:'certificate') self.certificate = attributes[:'certificate'] end if attributes.key?(:'tls_server_name') self.tls_server_name = attributes[:'tls_server_name'] end if attributes.key?(:'uid_start_number') self.uid_start_number = attributes[:'uid_start_number'] end if attributes.key?(:'gid_start_number') self.gid_start_number = attributes[:'gid_start_number'] end if attributes.key?(:'search_mode') self.search_mode = attributes[:'search_mode'] end if attributes.key?(:'bind_mode') self.bind_mode = attributes[:'bind_mode'] end if attributes.key?(:'mfa_support') self.mfa_support = attributes[:'mfa_support'] end end |
Instance Attribute Details
#authentication_flow ⇒ Object
Flow used for authentication when the associated application is accessed by an un-authenticated user.
16 17 18 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 16 def authentication_flow @authentication_flow end |
#authorization_flow ⇒ Object
Flow used when authorizing this provider.
19 20 21 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 19 def @authorization_flow end |
#base_dn ⇒ Object
DN under which objects are accessible.
27 28 29 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 27 def base_dn @base_dn end |
#bind_mode ⇒ Object
Returns the value of attribute bind_mode.
41 42 43 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 41 def bind_mode @bind_mode end |
#certificate ⇒ Object
Returns the value of attribute certificate.
29 30 31 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 29 def certificate @certificate end |
#gid_start_number ⇒ Object
The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren’t too low for POSIX groups. Default is 4000 to ensure that we don’t collide with local groups or users primary groups gidNumber
37 38 39 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 37 def gid_start_number @gid_start_number end |
#invalidation_flow ⇒ Object
Flow used ending the session from a provider.
22 23 24 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 22 def invalidation_flow @invalidation_flow end |
#mfa_support ⇒ Object
When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon.
44 45 46 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 44 def mfa_support @mfa_support end |
#name ⇒ Object
Returns the value of attribute name.
13 14 15 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 13 def name @name end |
#property_mappings ⇒ Object
Returns the value of attribute property_mappings.
24 25 26 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 24 def property_mappings @property_mappings end |
#search_mode ⇒ Object
Returns the value of attribute search_mode.
39 40 41 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 39 def search_mode @search_mode end |
#tls_server_name ⇒ Object
Returns the value of attribute tls_server_name.
31 32 33 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 31 def tls_server_name @tls_server_name end |
#uid_start_number ⇒ Object
The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren’t too low for POSIX users. Default is 2000 to ensure that we don’t collide with local users uidNumber
34 35 36 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 34 def uid_start_number @uid_start_number end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
88 89 90 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 88 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
93 94 95 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 93 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 69 def self.attribute_map { :'name' => :'name', :'authentication_flow' => :'authentication_flow', :'authorization_flow' => :'authorization_flow', :'invalidation_flow' => :'invalidation_flow', :'property_mappings' => :'property_mappings', :'base_dn' => :'base_dn', :'certificate' => :'certificate', :'tls_server_name' => :'tls_server_name', :'uid_start_number' => :'uid_start_number', :'gid_start_number' => :'gid_start_number', :'search_mode' => :'search_mode', :'bind_mode' => :'bind_mode', :'mfa_support' => :'mfa_support' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 380 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_nullable ⇒ Object
List of attributes with nullable: true
117 118 119 120 121 122 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 117 def self.openapi_nullable Set.new([ :'authentication_flow', :'certificate', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 98 def self.openapi_types { :'name' => :'String', :'authentication_flow' => :'String', :'authorization_flow' => :'String', :'invalidation_flow' => :'String', :'property_mappings' => :'Array<String>', :'base_dn' => :'String', :'certificate' => :'String', :'tls_server_name' => :'String', :'uid_start_number' => :'Integer', :'gid_start_number' => :'Integer', :'search_mode' => :'LDAPAPIAccessMode', :'bind_mode' => :'LDAPAPIAccessMode', :'mfa_support' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 347 def ==(o) return true if self.equal?(o) self.class == o.class && name == o.name && authentication_flow == o.authentication_flow && == o. && invalidation_flow == o.invalidation_flow && property_mappings == o.property_mappings && base_dn == o.base_dn && certificate == o.certificate && tls_server_name == o.tls_server_name && uid_start_number == o.uid_start_number && gid_start_number == o.gid_start_number && search_mode == o.search_mode && bind_mode == o.bind_mode && mfa_support == o.mfa_support end |
#eql?(o) ⇒ Boolean
367 368 369 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 367 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
373 374 375 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 373 def hash [name, authentication_flow, , invalidation_flow, property_mappings, base_dn, certificate, tls_server_name, uid_start_number, gid_start_number, search_mode, bind_mode, mfa_support].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 203 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @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 @authorization_flow.nil? invalid_properties.push('invalid value for "authorization_flow", authorization_flow cannot be nil.') end if @invalidation_flow.nil? invalid_properties.push('invalid value for "invalidation_flow", invalidation_flow cannot be nil.') end if !@base_dn.nil? && @base_dn.to_s.length < 1 invalid_properties.push('invalid value for "base_dn", the character length must be greater than or equal to 1.') end if !@uid_start_number.nil? && @uid_start_number > 2147483647 invalid_properties.push('invalid value for "uid_start_number", must be smaller than or equal to 2147483647.') end if !@uid_start_number.nil? && @uid_start_number < -2147483648 invalid_properties.push('invalid value for "uid_start_number", must be greater than or equal to -2147483648.') end if !@gid_start_number.nil? && @gid_start_number > 2147483647 invalid_properties.push('invalid value for "gid_start_number", must be smaller than or equal to 2147483647.') end if !@gid_start_number.nil? && @gid_start_number < -2147483648 invalid_properties.push('invalid value for "gid_start_number", must be greater than or equal to -2147483648.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 402 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
247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/authentik/api/models/ldap_provider_request.rb', line 247 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @name.nil? return false if @name.to_s.length < 1 return false if @authorization_flow.nil? return false if @invalidation_flow.nil? return false if !@base_dn.nil? && @base_dn.to_s.length < 1 return false if !@uid_start_number.nil? && @uid_start_number > 2147483647 return false if !@uid_start_number.nil? && @uid_start_number < -2147483648 return false if !@gid_start_number.nil? && @gid_start_number > 2147483647 return false if !@gid_start_number.nil? && @gid_start_number < -2147483648 true end |