added script to add passwords to keycloak user list and moved user lists out of this repo w/ burnettk
This commit is contained in:
parent
884dcb3653
commit
38c748b0cf
|
@ -0,0 +1,51 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
function error_handler() {
|
||||
>&2 echo "Exited with BAD EXIT CODE '${2}' in ${0} script at line: ${1}."
|
||||
exit "$2"
|
||||
}
|
||||
trap 'error_handler ${LINENO} $?' ERR
|
||||
set -o errtrace -o errexit -o nounset -o pipefail
|
||||
|
||||
|
||||
user_file_with_one_email_per_line="${1:-}"
|
||||
if [[ -z "${1:-}" ]]; then
|
||||
>&2 echo "usage: $(basename "$0") [user_file_with_one_email_per_line] [--replace_all_passwords - optional]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
replace_all_passwords=""
|
||||
if grep -q '\-\-replace_all_passwords\>' <<<"$@" ; then
|
||||
replace_all_passwords='true'
|
||||
fi
|
||||
|
||||
first_line_processed="false"
|
||||
|
||||
generator_command=xkcdpass
|
||||
if ! command -v "$generator_command" >/dev/null; then
|
||||
generator_command=uuidgen
|
||||
fi
|
||||
|
||||
user_file_tmp="/tmp/$(basename "$user_file_with_one_email_per_line")"
|
||||
cp "$user_file_with_one_email_per_line" "$user_file_tmp"
|
||||
|
||||
while read -r input_line; do
|
||||
if ! grep -qE '^#' <<<"$input_line" ; then
|
||||
if [[ "$first_line_processed" == "false" ]]; then
|
||||
first_line_processed=true
|
||||
else
|
||||
user_email=$(awk -F ',' '{print $1}' <<<"$input_line")
|
||||
username=$(awk -F '@' '{print $1}' <<<"$user_email")
|
||||
password=$(awk -F ',' '{print $2}' <<<"$input_line")
|
||||
if [[ -z "$password" ]]; then
|
||||
new_password=$($generator_command)
|
||||
perl -pi -e "s/(${username}@[^,]+,)(,.*)/\1${new_password}\2/" "$user_file_tmp"
|
||||
elif [[ -n "$replace_all_passwords" ]]; then
|
||||
new_password=$($generator_command)
|
||||
perl -pi -e "s/(${username}@[^,]+,)[^,]+(,.*)/\1${new_password}\2/" "$user_file_tmp"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done <"$user_file_with_one_email_per_line"
|
||||
|
||||
mv "$user_file_tmp" "$user_file_with_one_email_per_line"
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +0,0 @@
|
|||
email,spiffworkflow-employeeid
|
||||
admin@spiffworkflow.org
|
||||
jason@sartography.com
|
||||
kevin@sartography.com
|
|
@ -0,0 +1,2 @@
|
|||
email,pass,custom_attribute_one
|
||||
admin@example.com,hot_fake_password,user_attribute_admin
|
|
@ -1,9 +0,0 @@
|
|||
email,pass,spiffworkflow-employeeid
|
||||
alex@sartography.com,,111
|
||||
dan@sartography.com,,115
|
||||
daniel@sartography.com,,
|
||||
elizabeth@sartography.com,,
|
||||
j@sartography.com,,
|
||||
jon@sartography.com,,
|
||||
kb@sartography.com,,
|
||||
madhurya@sartography.com,,160
|
|
@ -1,97 +0,0 @@
|
|||
email,pass,spiffworkflow-employeeid
|
||||
# admin@spiffworkflow.org
|
||||
amir@status.im
|
||||
app.program-lead@status.im,,121
|
||||
codex-a1.sme@status.im,,209
|
||||
codex.project-lead@status.im,,153
|
||||
codex.sme@status.im,,185
|
||||
codex1.sme@status.im,,186
|
||||
codex2.sme@status.im,,187
|
||||
codex3.sme@status.im,,188
|
||||
codex4.sme@status.im,,189
|
||||
codex5.sme@status.im,,190
|
||||
core-a1.contributor@status.im,,202
|
||||
core-a2.contributor@status.im,,203
|
||||
core1.contributor@status.im,,155
|
||||
core2.contributor@status.im,,156
|
||||
core3.contributor@status.im,,157
|
||||
core4.contributor@status.im,,158
|
||||
core5.contributor@status.im,,159
|
||||
core6.contributor@status.im,core6.contributorx,199
|
||||
core@status.im,,113
|
||||
dao.project.lead@status.im
|
||||
desktop-a1.sme@status.im,,210
|
||||
desktop.program.lead@status.im
|
||||
desktop.project-lead@status.im,,192
|
||||
desktop.project.lead@status.im
|
||||
desktop.sme@status.im,,193
|
||||
desktop1.sme@status.im,,194
|
||||
desktop2.sme@status.im,,195
|
||||
desktop3.sme@status.im,,196
|
||||
desktop4.sme@status.im,,197
|
||||
desktop5.sme@status.im,,198
|
||||
fin@status.im,,118
|
||||
finance_user1@status.im
|
||||
fluffy.project-lead@status.im,,162
|
||||
harmeet@status.im,,109
|
||||
infra-a1.sme@status.im,,204
|
||||
infra.project-lead@status.im,infra.project-leadx,130
|
||||
infra.sme@status.im,,119
|
||||
infra1.sme@status.im,,131
|
||||
infra2.sme@status.im,,132
|
||||
infra3.sme@status.im,,167
|
||||
infra4.sme@status.im,,175
|
||||
infra5.sme@status.im,,176
|
||||
infra6.sme@status.im,infra6.smex,212
|
||||
jakub@status.im
|
||||
jamescheung@status.im,,234
|
||||
jarrad@status.im
|
||||
lead@status.im,,114
|
||||
legal-a1.sme@status.im,,205
|
||||
legal.project-lead@status.im,legal.project-leadx,133
|
||||
legal.sme@status.im,,125
|
||||
legal1.sme@status.im,,134
|
||||
legal2.sme@status.im,,165
|
||||
legal3.sme@status.im,,166
|
||||
legal4.sme@status.im,,177
|
||||
legal5.sme@status.im,,178
|
||||
legal6.sme@status.im,legal6.smex,213
|
||||
logos.program-lead@status.im,,160
|
||||
manuchehr@status.im,,110
|
||||
nimbus.program-lead@status.im,,161
|
||||
peopleops.partner-a1.sme@status.im,,208
|
||||
peopleops.partner.sme@status.im,,148
|
||||
peopleops.partner1.sme@status.im,,149
|
||||
peopleops.partner2.sme@status.im,,173
|
||||
peopleops.partner3.sme@status.im,,174
|
||||
peopleops.partner4.sme@status.im,,181
|
||||
peopleops.partner5.sme@status.im,,182
|
||||
peopleops.partner6.sme@status.im,peopleops.partner6.smex,216
|
||||
peopleops.partner@status.im,,150
|
||||
peopleops.project-lead@status.im,peopleops.project-leadx,147
|
||||
peopleops.talent.sme@status.im,,143
|
||||
peopleops.talent1.sme@status.im,,142
|
||||
peopleops.talent@status.im,,141
|
||||
ppg.ba-a1.sme@status.im,,207
|
||||
ppg.ba.project-lead@status.im,,137
|
||||
ppg.ba.sme@status.im,,138
|
||||
ppg.ba1.sme@status.im,,170
|
||||
ppg.ba2.sme@status.im,,171
|
||||
ppg.ba3.sme@status.im,,172
|
||||
ppg.ba4.sme@status.im,,200
|
||||
ppg.ba5.sme@status.im,,201
|
||||
ppg.ba6.sme@status.im,ppg.ba6.smex,236
|
||||
ppg.ba@status.im,,127
|
||||
sasha@status.im,,112
|
||||
security-a1.sme@status.im,,206
|
||||
security.project-lead@status.im,,151
|
||||
security.sme@status.im,,123
|
||||
security1.sme@status.im,,135
|
||||
security2.sme@status.im,,168
|
||||
security3.sme@status.im,,169
|
||||
security4.sme@status.im,,179
|
||||
security5.sme@status.im,,180
|
||||
security6.sme@status.im,security6.smex,211
|
||||
services.lead@status.im,,122
|
||||
vac.program-lead@status.im,,163
|
||||
web.project-lead@status.im,web.project-leadx,235
|
Loading…
Reference in New Issue