1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-04 15:54:48 +01:00

Merge remote-tracking branch 'fspoettel/admin-panel-2fa' into totp

# Conflicts:
#	management/auth.py
#	management/daemon.py
#	management/mailconfig.py
#	setup/mail-users.sh
This commit is contained in:
downtownallday
2020-09-28 23:25:16 -04:00
21 changed files with 602 additions and 366 deletions

View File

@@ -7,3 +7,4 @@
TEST_USER="totp_admin@$(email_domainpart "$EMAIL_ADDR")"
TEST_USER_PASS="$(static_qa_password)"
TEST_USER_TOTP_SECRET="6VXVWOSCY7JLU4VBZ6LQEJSBN6WYWECU"
TEST_USER_TOTP_LABEL="my phone"

View File

@@ -27,7 +27,8 @@ then
fi
# enable totp
if ! rest_urlencoded POST "${url%/}/admin/mfa/totp/enable" "$TEST_USER" "$TEST_USER_PASS" --insecure "secret=$TEST_USER_TOTP_SECRET" "token=$(totp_current_token "$TEST_USER_TOTP_SECRET")" 2>/dev/null; then
token="$(totp_current_token "$TEST_USER_TOTP_SECRET")"
if ! rest_urlencoded POST "${url%/}/admin/mfa/totp/enable" "$TEST_USER" "$TEST_USER_PASS" --insecure "secret=$TEST_USER_TOTP_SECRET" "token=$token" "label=$TEST_USER_TOTP_LABEL" 2>/dev/null; then
echo "Unable to enable TOTP. err=$REST_ERROR" 1>&2
exit 1
fi

View File

@@ -27,7 +27,7 @@ if [ -z "$ATTR_DN" ]; then
exit 1
fi
if [ "$ATTR_VALUE" != "$TEST_USER_TOTP_SECRET" ]; then
if [ "$ATTR_VALUE" != "{0}$TEST_USER_TOTP_SECRET" ]; then
echo "totpSecret mismatch"
exit 1
fi