Class: AWSCDK::Cognito::PasswordPolicy
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Cognito::PasswordPolicy
- Defined in:
- cognito/password_policy.rb
Overview
Password policy for User Pools.
Instance Attribute Summary collapse
-
#min_length ⇒ Numeric?
readonly
Minimum length required for a user's password.
-
#password_history_size ⇒ Numeric?
readonly
The number of previous passwords that you want Amazon Cognito to restrict each user from reusing.
-
#require_digits ⇒ Boolean?
readonly
Whether the user is required to have digits in their password.
-
#require_lowercase ⇒ Boolean?
readonly
Whether the user is required to have lowercase characters in their password.
-
#require_symbols ⇒ Boolean?
readonly
Whether the user is required to have symbols in their password.
-
#require_uppercase ⇒ Boolean?
readonly
Whether the user is required to have uppercase characters in their password.
-
#temp_password_validity ⇒ AWSCDK::Duration?
readonly
The length of time the temporary password generated by an admin is valid.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(min_length: nil, password_history_size: nil, require_digits: nil, require_lowercase: nil, require_symbols: nil, require_uppercase: nil, temp_password_validity: nil) ⇒ PasswordPolicy
constructor
A new instance of PasswordPolicy.
- #to_jsii ⇒ Object
Constructor Details
#initialize(min_length: nil, password_history_size: nil, require_digits: nil, require_lowercase: nil, require_symbols: nil, require_uppercase: nil, temp_password_validity: nil) ⇒ PasswordPolicy
Returns a new instance of PasswordPolicy.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'cognito/password_policy.rb', line 14 def initialize(min_length: nil, password_history_size: nil, require_digits: nil, require_lowercase: nil, require_symbols: nil, require_uppercase: nil, temp_password_validity: nil) @min_length = min_length Jsii::Type.check_type(@min_length, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "minLength") unless @min_length.nil? @password_history_size = password_history_size Jsii::Type.check_type(@password_history_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "passwordHistorySize") unless @password_history_size.nil? @require_digits = require_digits Jsii::Type.check_type(@require_digits, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "requireDigits") unless @require_digits.nil? @require_lowercase = require_lowercase Jsii::Type.check_type(@require_lowercase, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "requireLowercase") unless @require_lowercase.nil? @require_symbols = require_symbols Jsii::Type.check_type(@require_symbols, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "requireSymbols") unless @require_symbols.nil? @require_uppercase = require_uppercase Jsii::Type.check_type(@require_uppercase, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "requireUppercase") unless @require_uppercase.nil? @temp_password_validity = temp_password_validity Jsii::Type.check_type(@temp_password_validity, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "tempPasswordValidity") unless @temp_password_validity.nil? end |
Instance Attribute Details
#min_length ⇒ Numeric? (readonly)
Default: 8
Minimum length required for a user's password.
35 36 37 |
# File 'cognito/password_policy.rb', line 35 def min_length @min_length end |
#password_history_size ⇒ Numeric? (readonly)
Default: undefined - Cognito default setting is no restriction
The number of previous passwords that you want Amazon Cognito to restrict each user from reusing.
password_history_size cannot be set when feature_plan is FeaturePlan.LITE.
42 43 44 |
# File 'cognito/password_policy.rb', line 42 def password_history_size @password_history_size end |
#require_digits ⇒ Boolean? (readonly)
Default: true
Whether the user is required to have digits in their password.
47 48 49 |
# File 'cognito/password_policy.rb', line 47 def require_digits @require_digits end |
#require_lowercase ⇒ Boolean? (readonly)
Default: true
Whether the user is required to have lowercase characters in their password.
52 53 54 |
# File 'cognito/password_policy.rb', line 52 def require_lowercase @require_lowercase end |
#require_symbols ⇒ Boolean? (readonly)
Default: true
Whether the user is required to have symbols in their password.
57 58 59 |
# File 'cognito/password_policy.rb', line 57 def require_symbols @require_symbols end |
#require_uppercase ⇒ Boolean? (readonly)
Default: true
Whether the user is required to have uppercase characters in their password.
62 63 64 |
# File 'cognito/password_policy.rb', line 62 def require_uppercase @require_uppercase end |
#temp_password_validity ⇒ AWSCDK::Duration? (readonly)
Default: Duration.days(7)
The length of time the temporary password generated by an admin is valid.
This must be provided as whole days, like Duration.days(3) or Duration.hours(48). Fractional days, such as Duration.hours(20), will generate an error.
70 71 72 |
# File 'cognito/password_policy.rb', line 70 def temp_password_validity @temp_password_validity end |
Class Method Details
.jsii_properties ⇒ Object
72 73 74 75 76 77 78 79 80 81 82 |
# File 'cognito/password_policy.rb', line 72 def self.jsii_properties { :min_length => "minLength", :password_history_size => "passwordHistorySize", :require_digits => "requireDigits", :require_lowercase => "requireLowercase", :require_symbols => "requireSymbols", :require_uppercase => "requireUppercase", :temp_password_validity => "tempPasswordValidity", } end |
Instance Method Details
#to_jsii ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'cognito/password_policy.rb', line 84 def to_jsii result = {} result.merge!({ "minLength" => @min_length, "passwordHistorySize" => @password_history_size, "requireDigits" => @require_digits, "requireLowercase" => @require_lowercase, "requireSymbols" => @require_symbols, "requireUppercase" => @require_uppercase, "tempPasswordValidity" => @temp_password_validity, }) result.compact end |