feature/sso-hardening #9

Merged
bstein merged 685 commits from feature/sso-hardening into main 2026-01-13 20:23:26 +00:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 5f7ea4544d - Show all commits

View File

@ -181,7 +181,7 @@ def main():
if not app_pw: if not app_pw:
app_pw = random_password() app_pw = random_password()
attrs["mailu_app_password"] = app_pw attrs["mailu_app_password"] = [app_pw]
kc_update_attributes(token, user, attrs) kc_update_attributes(token, user, attrs)
log(f"Set mailu_app_password for {email}") log(f"Set mailu_app_password for {email}")

View File

@ -46,7 +46,7 @@ users=$(curl -s -H "Authorization: Bearer ${token}" \
echo "${users}" | jq -c '.[]' | while read -r user; do echo "${users}" | jq -c '.[]' | while read -r user; do
username=$(echo "${user}" | jq -r '.username') username=$(echo "${user}" | jq -r '.username')
email=$(echo "${user}" | jq -r '.email // empty') email=$(echo "${user}" | jq -r '.email // empty')
app_pw=$(echo "${user}" | jq -r '.attributes.mailu_app_password[0] // empty') app_pw=$(echo "${user}" | jq -r '(.attributes.mailu_app_password[0] // .attributes.mailu_app_password // empty)')
[[ -z "${email}" || -z "${app_pw}" ]] && continue [[ -z "${email}" || -z "${app_pw}" ]] && continue
if account_exists "${username}" "${email}"; then if account_exists "${username}" "${email}"; then
echo "Skipping ${email}, already exists" echo "Skipping ${email}, already exists"