Class: OCI::IdentityDomains::Models::AuthenticationFactorSettingsTotpSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb

Overview

Settings related to Time-Based One-Time Passcodes (TOTP), such as hashing algo, totp time step, passcode length, and so on

SCIM++ Properties: - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: complex - uniqueness: none

Constant Summary collapse

HASHING_ALGORITHM_ENUM =
[
  HASHING_ALGORITHM_SHA1 = 'SHA1'.freeze,
  HASHING_ALGORITHM_SHA256 = 'SHA256'.freeze,
  HASHING_ALGORITHM_SHA384 = 'SHA384'.freeze,
  HASHING_ALGORITHM_SHA512 = 'SHA512'.freeze,
  HASHING_ALGORITHM_MD5 = 'MD5'.freeze,
  HASHING_ALGORITHM_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AuthenticationFactorSettingsTotpSettings

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 234

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.hashing_algorithm = attributes[:'hashingAlgorithm'] if attributes[:'hashingAlgorithm']

  raise 'You cannot provide both :hashingAlgorithm and :hashing_algorithm' if attributes.key?(:'hashingAlgorithm') && attributes.key?(:'hashing_algorithm')

  self.hashing_algorithm = attributes[:'hashing_algorithm'] if attributes[:'hashing_algorithm']

  self.passcode_length = attributes[:'passcodeLength'] if attributes[:'passcodeLength']

  raise 'You cannot provide both :passcodeLength and :passcode_length' if attributes.key?(:'passcodeLength') && attributes.key?(:'passcode_length')

  self.passcode_length = attributes[:'passcode_length'] if attributes[:'passcode_length']

  self.key_refresh_interval_in_days = attributes[:'keyRefreshIntervalInDays'] if attributes[:'keyRefreshIntervalInDays']

  raise 'You cannot provide both :keyRefreshIntervalInDays and :key_refresh_interval_in_days' if attributes.key?(:'keyRefreshIntervalInDays') && attributes.key?(:'key_refresh_interval_in_days')

  self.key_refresh_interval_in_days = attributes[:'key_refresh_interval_in_days'] if attributes[:'key_refresh_interval_in_days']

  self.time_step_in_secs = attributes[:'timeStepInSecs'] if attributes[:'timeStepInSecs']

  raise 'You cannot provide both :timeStepInSecs and :time_step_in_secs' if attributes.key?(:'timeStepInSecs') && attributes.key?(:'time_step_in_secs')

  self.time_step_in_secs = attributes[:'time_step_in_secs'] if attributes[:'time_step_in_secs']

  self.time_step_tolerance = attributes[:'timeStepTolerance'] if attributes[:'timeStepTolerance']

  raise 'You cannot provide both :timeStepTolerance and :time_step_tolerance' if attributes.key?(:'timeStepTolerance') && attributes.key?(:'time_step_tolerance')

  self.time_step_tolerance = attributes[:'time_step_tolerance'] if attributes[:'time_step_tolerance']

  self.sms_otp_validity_duration_in_mins = attributes[:'smsOtpValidityDurationInMins'] if attributes[:'smsOtpValidityDurationInMins']

  raise 'You cannot provide both :smsOtpValidityDurationInMins and :sms_otp_validity_duration_in_mins' if attributes.key?(:'smsOtpValidityDurationInMins') && attributes.key?(:'sms_otp_validity_duration_in_mins')

  self.sms_otp_validity_duration_in_mins = attributes[:'sms_otp_validity_duration_in_mins'] if attributes[:'sms_otp_validity_duration_in_mins']

  self.jwt_validity_duration_in_secs = attributes[:'jwtValidityDurationInSecs'] if attributes[:'jwtValidityDurationInSecs']

  raise 'You cannot provide both :jwtValidityDurationInSecs and :jwt_validity_duration_in_secs' if attributes.key?(:'jwtValidityDurationInSecs') && attributes.key?(:'jwt_validity_duration_in_secs')

  self.jwt_validity_duration_in_secs = attributes[:'jwt_validity_duration_in_secs'] if attributes[:'jwt_validity_duration_in_secs']

  self.sms_passcode_length = attributes[:'smsPasscodeLength'] if attributes[:'smsPasscodeLength']

  raise 'You cannot provide both :smsPasscodeLength and :sms_passcode_length' if attributes.key?(:'smsPasscodeLength') && attributes.key?(:'sms_passcode_length')

  self.sms_passcode_length = attributes[:'sms_passcode_length'] if attributes[:'sms_passcode_length']

  self.email_otp_validity_duration_in_mins = attributes[:'emailOtpValidityDurationInMins'] if attributes[:'emailOtpValidityDurationInMins']

  raise 'You cannot provide both :emailOtpValidityDurationInMins and :email_otp_validity_duration_in_mins' if attributes.key?(:'emailOtpValidityDurationInMins') && attributes.key?(:'email_otp_validity_duration_in_mins')

  self.email_otp_validity_duration_in_mins = attributes[:'email_otp_validity_duration_in_mins'] if attributes[:'email_otp_validity_duration_in_mins']

  self.email_passcode_length = attributes[:'emailPasscodeLength'] if attributes[:'emailPasscodeLength']

  raise 'You cannot provide both :emailPasscodeLength and :email_passcode_length' if attributes.key?(:'emailPasscodeLength') && attributes.key?(:'email_passcode_length')

  self.email_passcode_length = attributes[:'email_passcode_length'] if attributes[:'email_passcode_length']
end

Instance Attribute Details

#email_otp_validity_duration_in_minsInteger

[Required] The period of time (in minutes) that a one-time passcode remains valid that the system sends by email.

Added In: 18.1.2

SCIM++ Properties: - idcsMaxValue: 60 - idcsMinValue: 2 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


163
164
165
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 163

def email_otp_validity_duration_in_mins
  @email_otp_validity_duration_in_mins
end

#email_passcode_lengthInteger

[Required] Exact length of the email one-time passcode.

Added In: 18.1.2

SCIM++ Properties: - idcsMaxValue: 10 - idcsMinValue: 4 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


180
181
182
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 180

def email_passcode_length
  @email_passcode_length
end

#hashing_algorithmString

[Required] The hashing algorithm to be used to calculate a One-Time Passcode. By default, the system uses SHA1.

SCIM++ Properties: - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: string - uniqueness: none

Returns:

  • (String)


41
42
43
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 41

def hashing_algorithm
  @hashing_algorithm
end

#jwt_validity_duration_in_secsInteger

[Required] The period of time (in seconds) that a JSON Web Token (JWT) is valid

SCIM++ Properties: - idcsMaxValue: 99999 - idcsMinValue: 30 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


131
132
133
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 131

def jwt_validity_duration_in_secs
  @jwt_validity_duration_in_secs
end

#key_refresh_interval_in_daysInteger

[Required] The duration of time (in days) after which the shared secret has to be refreshed

SCIM++ Properties: - idcsMaxValue: 999 - idcsMinValue: 30 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


71
72
73
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 71

def key_refresh_interval_in_days
  @key_refresh_interval_in_days
end

#passcode_lengthInteger

[Required] Exact length of the One-Time Passcode that the system should generate

SCIM++ Properties: - idcsMaxValue: 10 - idcsMinValue: 4 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


56
57
58
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 56

def passcode_length
  @passcode_length
end

#sms_otp_validity_duration_in_minsInteger

[Required] The period of time (in minutes) for which a One-Time Passcode that the system sends by Short Message Service (SMS) or by voice remains valid

SCIM++ Properties: - idcsMaxValue: 60 - idcsMinValue: 2 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


116
117
118
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 116

def sms_otp_validity_duration_in_mins
  @sms_otp_validity_duration_in_mins
end

#sms_passcode_lengthInteger

[Required] Exact length of the Short Message Service (SMS) One-Time Passcode

SCIM++ Properties: - idcsMaxValue: 10 - idcsMinValue: 4 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


146
147
148
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 146

def sms_passcode_length
  @sms_passcode_length
end

#time_step_in_secsInteger

[Required] Time (in secs) to be used as the time step

SCIM++ Properties: - idcsMaxValue: 300 - idcsMinValue: 30 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


86
87
88
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 86

def time_step_in_secs
  @time_step_in_secs
end

#time_step_toleranceInteger

[Required] The tolerance/step-size that the system should use when validating a One-Time Passcode

SCIM++ Properties: - idcsMaxValue: 3 - idcsMinValue: 2 - idcsSearchable: false - multiValued: false - mutability: readWrite - required: true - returned: default - type: integer - uniqueness: none

Returns:

  • (Integer)


101
102
103
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 101

def time_step_tolerance
  @time_step_tolerance
end

Class Method Details

.attribute_mapObject

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



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 183

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'hashing_algorithm': :'hashingAlgorithm',
    'passcode_length': :'passcodeLength',
    'key_refresh_interval_in_days': :'keyRefreshIntervalInDays',
    'time_step_in_secs': :'timeStepInSecs',
    'time_step_tolerance': :'timeStepTolerance',
    'sms_otp_validity_duration_in_mins': :'smsOtpValidityDurationInMins',
    'jwt_validity_duration_in_secs': :'jwtValidityDurationInSecs',
    'sms_passcode_length': :'smsPasscodeLength',
    'email_otp_validity_duration_in_mins': :'emailOtpValidityDurationInMins',
    'email_passcode_length': :'emailPasscodeLength'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 201

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'hashing_algorithm': :'String',
    'passcode_length': :'Integer',
    'key_refresh_interval_in_days': :'Integer',
    'time_step_in_secs': :'Integer',
    'time_step_tolerance': :'Integer',
    'sms_otp_validity_duration_in_mins': :'Integer',
    'jwt_validity_duration_in_secs': :'Integer',
    'sms_passcode_length': :'Integer',
    'email_otp_validity_duration_in_mins': :'Integer',
    'email_passcode_length': :'Integer'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 321

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    hashing_algorithm == other.hashing_algorithm &&
    passcode_length == other.passcode_length &&
    key_refresh_interval_in_days == other.key_refresh_interval_in_days &&
    time_step_in_secs == other.time_step_in_secs &&
    time_step_tolerance == other.time_step_tolerance &&
    sms_otp_validity_duration_in_mins == other.sms_otp_validity_duration_in_mins &&
    jwt_validity_duration_in_secs == other.jwt_validity_duration_in_secs &&
    sms_passcode_length == other.sms_passcode_length &&
    email_otp_validity_duration_in_mins == other.email_otp_validity_duration_in_mins &&
    email_passcode_length == other.email_passcode_length
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



360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 360

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


340
341
342
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 340

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



349
350
351
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 349

def hash
  [hashing_algorithm, passcode_length, key_refresh_interval_in_days, time_step_in_secs, time_step_tolerance, sms_otp_validity_duration_in_mins, jwt_validity_duration_in_secs, sms_passcode_length, email_otp_validity_duration_in_mins, email_passcode_length].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



393
394
395
396
397
398
399
400
401
402
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 393

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



387
388
389
# File 'lib/oci/identity_domains/models/authentication_factor_settings_totp_settings.rb', line 387

def to_s
  to_hash.to_s
end