do not allow uploading a user to keycloak that matches admin user that the script is using w/ burnettk

This commit is contained in:
jasquat 2023-03-27 14:09:08 -04:00
parent c615dc82fa
commit 701ed928ad
No known key found for this signature in database
1 changed files with 6 additions and 0 deletions

View File

@ -89,6 +89,12 @@ while read -r input_line; do
echo "Importing: $input_line"
user_email=$(awk -F ',' '{print $1}' <<<"$input_line")
username=$(awk -F '@' '{print $1}' <<<"$user_email")
if [[ "$username" == "$ADMIN_USERNAME" || "$user_email" == "$ADMIN_USERNAME" ]]; then
>&2 echo "ERROR: The user used as the admin user matches a user in the current import list. This should not happen. Comment out that user from the list or use a different admin user: ${ADMIN_USERNAME}"
exit 1
fi
user_attribute_one=$(awk -F ',' '{print $2}' <<<"$input_line")
http_code=$(add_user "$user_email" "$username" "$user_attribute_one")