diff --git a/expected/arenadata_password_check.out.o b/expected/arenadata_password_check.out.o new file mode 100644 index 0000000..f4a558d --- /dev/null +++ b/expected/arenadata_password_check.out.o @@ -0,0 +1,84 @@ +-- Load the extension to enable the tests +LOAD 'arenadata_password_check'; +-- Restrictive policy +SET arenadata_password_check.minimum_length TO 8; +SET arenadata_password_check.maximum_length TO 15; +SET arenadata_password_check.special_chars TO '%$?@'; +SET arenadata_password_check.restrict_lower TO true; +SET arenadata_password_check.restrict_upper TO true; +SET arenadata_password_check.restrict_numbers TO true; +-- Check password policy in place +-- Password too short +CREATE ROLE regress_pwd_foo PASSWORD '01234'; +ERROR: password is too short +-- Password too long +CREATE ROLE regress_pwd_foo PASSWORD '01234567890123456'; +ERROR: password is too long +-- Invalid characters +CREATE ROLE regress_pwd_foo PASSWORD '```````````````'; +ERROR: password contains invalid characters +-- Three categories missing +-- Lower-case, upper-case, special character missing +CREATE ROLE regress_pwd_foo PASSWORD '012345678901234'; +ERROR: Incorrect password format: lower-case character missing, upper-case character missing, special character missing (needs to be one listed in "%$?@") +-- Number, upper-case, special character missing +CREATE ROLE regress_pwd_foo PASSWORD 'abcdefghijklmno'; +ERROR: Incorrect password format: upper-case character missing, number missing, special character missing (needs to be one listed in "%$?@") +-- Number, lower-case, special character missing +CREATE ROLE regress_pwd_foo PASSWORD 'ABCDEFGHIJKLMNO'; +ERROR: Incorrect password format: lower-case character missing, number missing, special character missing (needs to be one listed in "%$?@") +-- Number, lower-case, upper-case character missing +CREATE ROLE regress_pwd_foo PASSWORD '%%%%%%%%%%%%%%%'; +ERROR: Incorrect password format: lower-case character missing, upper-case character missing, number missing +-- Two categories missing +-- Number, special character missing +CREATE ROLE regress_pwd_foo PASSWORD 'abcdefghijklmnA'; +ERROR: Incorrect password format: number missing, special character missing (needs to be one listed in "%$?@") +-- Upper-case character, special character missing +CREATE ROLE regress_pwd_foo PASSWORD '01234567890123a'; +ERROR: Incorrect password format: upper-case character missing, special character missing (needs to be one listed in "%$?@") +-- Lower-case character, special character missing +CREATE ROLE regress_pwd_foo PASSWORD '01234567890123A'; +ERROR: Incorrect password format: lower-case character missing, special character missing (needs to be one listed in "%$?@") +-- Number, upper case missing +CREATE ROLE regress_pwd_foo PASSWORD 'abcdefghijklmn%'; +ERROR: Incorrect password format: upper-case character missing, number missing +-- Number, lower-case missing +CREATE ROLE regress_pwd_foo PASSWORD 'ABCDEFGHIJKLMN%'; +ERROR: Incorrect password format: lower-case character missing, number missing +-- Upper-case, lower-case missing +CREATE ROLE regress_pwd_foo PASSWORD '01234567890123%'; +ERROR: Incorrect password format: lower-case character missing, upper-case character missing +-- One category missing +-- Special character missing +CREATE ROLE regress_pwd_foo PASSWORD '0123456789012aA'; +ERROR: Incorrect password format: special character missing (needs to be one listed in "%$?@") +-- Upper-case missing +CREATE ROLE regress_pwd_foo PASSWORD '0123456789012a%'; +ERROR: Incorrect password format: upper-case character missing +-- Lower-case missing +CREATE ROLE regress_pwd_foo PASSWORD '0123456789012A%'; +ERROR: Incorrect password format: lower-case character missing +-- Number missing +CREATE ROLE regress_pwd_foo PASSWORD 'ABCDEFGHIJKLMa%'; +ERROR: Incorrect password format: number missing +-- Valid password +CREATE ROLE regress_pwd_foo PASSWORD '012345678901Aa%'; +DROP ROLE regress_pwd_foo; +-- Policy less restrictive +SET arenadata_password_check.restrict_lower TO false; +SET arenadata_password_check.restrict_upper TO false; +SET arenadata_password_check.restrict_numbers TO false; +SET arenadata_password_check.minimum_length TO 1; +SET arenadata_password_check.maximum_length TO 100; +-- Special character missing +CREATE ROLE regress_pwd_foo PASSWORD '012345678901Aa'; +ERROR: Incorrect password format: special character missing (needs to be one listed in "%$?@") +-- Valid password +CREATE ROLE regress_pwd_foo PASSWORD '@%'; +DROP ROLE regress_pwd_foo; +-- Even less restrictive policy +SET arenadata_password_check.restrict_special TO false; +-- Valid password +CREATE ROLE regress_pwd_foo PASSWORD 'A'; +DROP ROLE regress_pwd_foo; \ No newline at end of file