Class: Authentik::Api::IdentificationStage
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Authentik::Api::IdentificationStage
- Defined in:
- lib/authentik/api/models/identification_stage.rb
Overview
IdentificationStage Serializer
Instance Attribute Summary collapse
-
#captcha_stage ⇒ Object
When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage.
-
#case_insensitive_matching ⇒ Object
When enabled, user fields are matched regardless of their casing.
-
#component ⇒ Object
Get object type so that we know how to edit the object.
-
#enable_remember_me ⇒ Object
Show the user the ‘Remember me on this device’ toggle, allowing repeat users to skip straight to entering their password.
-
#enrollment_flow ⇒ Object
Optional enrollment flow, which is linked at the bottom of the page.
-
#flow_set ⇒ Object
Returns the value of attribute flow_set.
-
#meta_model_name ⇒ Object
Return internal model name.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password_stage ⇒ Object
When set, shows a password field, instead of showing the password field as separate step.
-
#passwordless_flow ⇒ Object
Optional passwordless flow, which is linked at the bottom of the page.
-
#pk ⇒ Object
Returns the value of attribute pk.
-
#pretend_user_exists ⇒ Object
When enabled, the stage will succeed and continue even when incorrect user info is entered.
-
#recovery_flow ⇒ Object
Optional recovery flow, which is linked at the bottom of the page.
-
#show_matched_user ⇒ Object
When a valid username/email has been entered, and this option is enabled, the user’s username and avatar will be shown.
-
#show_source_labels ⇒ Object
Returns the value of attribute show_source_labels.
-
#sources ⇒ Object
Specify which sources should be shown.
-
#user_fields ⇒ Object
Fields of the user object to match against.
-
#verbose_name ⇒ Object
Return object’s verbose_name.
-
#verbose_name_plural ⇒ Object
Return object’s plural verbose_name.
-
#webauthn_stage ⇒ Object
When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor.
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 = {}) ⇒ IdentificationStage
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 = {}) ⇒ IdentificationStage
Initializes the object
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 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 |
# File 'lib/authentik/api/models/identification_stage.rb', line 145 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::IdentificationStage` 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::IdentificationStage`. 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?(:'component') self.component = attributes[:'component'] else self.component = nil end if attributes.key?(:'verbose_name') self.verbose_name = attributes[:'verbose_name'] else self.verbose_name = nil end if attributes.key?(:'verbose_name_plural') self.verbose_name_plural = attributes[:'verbose_name_plural'] else self.verbose_name_plural = nil end if attributes.key?(:'meta_model_name') self. = attributes[:'meta_model_name'] else self. = nil end if attributes.key?(:'flow_set') if (value = attributes[:'flow_set']).is_a?(Array) self.flow_set = value end else self.flow_set = nil end if attributes.key?(:'user_fields') if (value = attributes[:'user_fields']).is_a?(Array) self.user_fields = value end end if attributes.key?(:'password_stage') self.password_stage = attributes[:'password_stage'] end if attributes.key?(:'captcha_stage') self.captcha_stage = attributes[:'captcha_stage'] end if attributes.key?(:'case_insensitive_matching') self.case_insensitive_matching = attributes[:'case_insensitive_matching'] end if attributes.key?(:'show_matched_user') self.show_matched_user = attributes[:'show_matched_user'] end if attributes.key?(:'enrollment_flow') self.enrollment_flow = attributes[:'enrollment_flow'] end if attributes.key?(:'recovery_flow') self.recovery_flow = attributes[:'recovery_flow'] end if attributes.key?(:'passwordless_flow') self.passwordless_flow = attributes[:'passwordless_flow'] end if attributes.key?(:'sources') if (value = attributes[:'sources']).is_a?(Array) self.sources = value end end if attributes.key?(:'show_source_labels') self.show_source_labels = attributes[:'show_source_labels'] end if attributes.key?(:'pretend_user_exists') self.pretend_user_exists = attributes[:'pretend_user_exists'] end if attributes.key?(:'enable_remember_me') self.enable_remember_me = attributes[:'enable_remember_me'] end if attributes.key?(:'webauthn_stage') self.webauthn_stage = attributes[:'webauthn_stage'] end end |
Instance Attribute Details
#captcha_stage ⇒ Object
When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage.
38 39 40 |
# File 'lib/authentik/api/models/identification_stage.rb', line 38 def captcha_stage @captcha_stage end |
#case_insensitive_matching ⇒ Object
When enabled, user fields are matched regardless of their casing.
41 42 43 |
# File 'lib/authentik/api/models/identification_stage.rb', line 41 def case_insensitive_matching @case_insensitive_matching end |
#component ⇒ Object
Get object type so that we know how to edit the object
18 19 20 |
# File 'lib/authentik/api/models/identification_stage.rb', line 18 def component @component end |
#enable_remember_me ⇒ Object
Show the user the ‘Remember me on this device’ toggle, allowing repeat users to skip straight to entering their password.
64 65 66 |
# File 'lib/authentik/api/models/identification_stage.rb', line 64 def enable_remember_me @enable_remember_me end |
#enrollment_flow ⇒ Object
Optional enrollment flow, which is linked at the bottom of the page.
47 48 49 |
# File 'lib/authentik/api/models/identification_stage.rb', line 47 def enrollment_flow @enrollment_flow end |
#flow_set ⇒ Object
Returns the value of attribute flow_set.
29 30 31 |
# File 'lib/authentik/api/models/identification_stage.rb', line 29 def flow_set @flow_set end |
#meta_model_name ⇒ Object
Return internal model name
27 28 29 |
# File 'lib/authentik/api/models/identification_stage.rb', line 27 def @meta_model_name end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/authentik/api/models/identification_stage.rb', line 15 def name @name end |
#password_stage ⇒ Object
When set, shows a password field, instead of showing the password field as separate step.
35 36 37 |
# File 'lib/authentik/api/models/identification_stage.rb', line 35 def password_stage @password_stage end |
#passwordless_flow ⇒ Object
Optional passwordless flow, which is linked at the bottom of the page.
53 54 55 |
# File 'lib/authentik/api/models/identification_stage.rb', line 53 def passwordless_flow @passwordless_flow end |
#pk ⇒ Object
Returns the value of attribute pk.
13 14 15 |
# File 'lib/authentik/api/models/identification_stage.rb', line 13 def pk @pk end |
#pretend_user_exists ⇒ Object
When enabled, the stage will succeed and continue even when incorrect user info is entered.
61 62 63 |
# File 'lib/authentik/api/models/identification_stage.rb', line 61 def pretend_user_exists @pretend_user_exists end |
#recovery_flow ⇒ Object
Optional recovery flow, which is linked at the bottom of the page.
50 51 52 |
# File 'lib/authentik/api/models/identification_stage.rb', line 50 def recovery_flow @recovery_flow end |
#show_matched_user ⇒ Object
When a valid username/email has been entered, and this option is enabled, the user’s username and avatar will be shown. Otherwise, the text that the user entered will be shown
44 45 46 |
# File 'lib/authentik/api/models/identification_stage.rb', line 44 def show_matched_user @show_matched_user end |
#show_source_labels ⇒ Object
Returns the value of attribute show_source_labels.
58 59 60 |
# File 'lib/authentik/api/models/identification_stage.rb', line 58 def show_source_labels @show_source_labels end |
#sources ⇒ Object
Specify which sources should be shown.
56 57 58 |
# File 'lib/authentik/api/models/identification_stage.rb', line 56 def sources @sources end |
#user_fields ⇒ Object
Fields of the user object to match against. (Hold shift to select multiple options)
32 33 34 |
# File 'lib/authentik/api/models/identification_stage.rb', line 32 def user_fields @user_fields end |
#verbose_name ⇒ Object
Return object’s verbose_name
21 22 23 |
# File 'lib/authentik/api/models/identification_stage.rb', line 21 def verbose_name @verbose_name end |
#verbose_name_plural ⇒ Object
Return object’s plural verbose_name
24 25 26 |
# File 'lib/authentik/api/models/identification_stage.rb', line 24 def verbose_name_plural @verbose_name_plural end |
#webauthn_stage ⇒ Object
When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor.
67 68 69 |
# File 'lib/authentik/api/models/identification_stage.rb', line 67 def webauthn_stage @webauthn_stage end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
96 97 98 |
# File 'lib/authentik/api/models/identification_stage.rb', line 96 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
101 102 103 |
# File 'lib/authentik/api/models/identification_stage.rb', line 101 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/authentik/api/models/identification_stage.rb', line 70 def self.attribute_map { :'pk' => :'pk', :'name' => :'name', :'component' => :'component', :'verbose_name' => :'verbose_name', :'verbose_name_plural' => :'verbose_name_plural', :'meta_model_name' => :'meta_model_name', :'flow_set' => :'flow_set', :'user_fields' => :'user_fields', :'password_stage' => :'password_stage', :'captcha_stage' => :'captcha_stage', :'case_insensitive_matching' => :'case_insensitive_matching', :'show_matched_user' => :'show_matched_user', :'enrollment_flow' => :'enrollment_flow', :'recovery_flow' => :'recovery_flow', :'passwordless_flow' => :'passwordless_flow', :'sources' => :'sources', :'show_source_labels' => :'show_source_labels', :'pretend_user_exists' => :'pretend_user_exists', :'enable_remember_me' => :'enable_remember_me', :'webauthn_stage' => :'webauthn_stage' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/authentik/api/models/identification_stage.rb', line 422 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
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/authentik/api/models/identification_stage.rb', line 132 def self.openapi_nullable Set.new([ :'password_stage', :'captcha_stage', :'enrollment_flow', :'recovery_flow', :'passwordless_flow', :'webauthn_stage' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/authentik/api/models/identification_stage.rb', line 106 def self.openapi_types { :'pk' => :'String', :'name' => :'String', :'component' => :'String', :'verbose_name' => :'String', :'verbose_name_plural' => :'String', :'meta_model_name' => :'String', :'flow_set' => :'Array<FlowSet>', :'user_fields' => :'Array<UserFieldsEnum>', :'password_stage' => :'String', :'captcha_stage' => :'String', :'case_insensitive_matching' => :'Boolean', :'show_matched_user' => :'Boolean', :'enrollment_flow' => :'String', :'recovery_flow' => :'String', :'passwordless_flow' => :'String', :'sources' => :'Array<String>', :'show_source_labels' => :'Boolean', :'pretend_user_exists' => :'Boolean', :'enable_remember_me' => :'Boolean', :'webauthn_stage' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
# File 'lib/authentik/api/models/identification_stage.rb', line 382 def ==(o) return true if self.equal?(o) self.class == o.class && pk == o.pk && name == o.name && component == o.component && verbose_name == o.verbose_name && verbose_name_plural == o.verbose_name_plural && == o. && flow_set == o.flow_set && user_fields == o.user_fields && password_stage == o.password_stage && captcha_stage == o.captcha_stage && case_insensitive_matching == o.case_insensitive_matching && show_matched_user == o.show_matched_user && enrollment_flow == o.enrollment_flow && recovery_flow == o.recovery_flow && passwordless_flow == o.passwordless_flow && sources == o.sources && show_source_labels == o.show_source_labels && pretend_user_exists == o.pretend_user_exists && enable_remember_me == o.enable_remember_me && webauthn_stage == o.webauthn_stage end |
#eql?(o) ⇒ Boolean
409 410 411 |
# File 'lib/authentik/api/models/identification_stage.rb', line 409 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
415 416 417 |
# File 'lib/authentik/api/models/identification_stage.rb', line 415 def hash [pk, name, component, verbose_name, verbose_name_plural, , flow_set, user_fields, password_stage, captcha_stage, case_insensitive_matching, show_matched_user, enrollment_flow, recovery_flow, passwordless_flow, sources, show_source_labels, pretend_user_exists, enable_remember_me, webauthn_stage].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/authentik/api/models/identification_stage.rb', line 262 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 @component.nil? invalid_properties.push('invalid value for "component", component cannot be nil.') end if @verbose_name.nil? invalid_properties.push('invalid value for "verbose_name", verbose_name cannot be nil.') end if @verbose_name_plural.nil? invalid_properties.push('invalid value for "verbose_name_plural", verbose_name_plural cannot be nil.') end if @meta_model_name.nil? invalid_properties.push('invalid value for "meta_model_name", meta_model_name cannot be nil.') end if @flow_set.nil? invalid_properties.push('invalid value for "flow_set", flow_set cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/authentik/api/models/identification_stage.rb', line 444 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
298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/authentik/api/models/identification_stage.rb', line 298 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @pk.nil? return false if @name.nil? return false if @component.nil? return false if @verbose_name.nil? return false if @verbose_name_plural.nil? return false if @meta_model_name.nil? return false if @flow_set.nil? true end |