Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_test_team_scim.sh script: fix arg parsing and invite #1321

Merged
merged 1 commit into from
Jan 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions deploy/services-demo/create_test_team_scim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ USAGE: $0

# Option parsing:
# https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/
while getopts ":n:h:c" opt; do
while getopts ":h:s:" opt; do
case ${opt} in
h ) BRIG_HOST="$OPTARG"
;;
Expand Down Expand Up @@ -182,9 +182,13 @@ REGISTER_ACCEPT=$(cat <<EOF
EOF
)

SCIM_USER_REGISTER_TEAM=$(curl -XPOST "$BRIG_HOST/register" \
--header 'Content-Type: application/json' \
-d "$REGISTER_ACCEPT" | jq -r .team)
# Create the user using that code
CURL_OUT=$(curl \
-XPOST "$BRIG_HOST/i/users" \
-H'Content-type: application/json' \
-d'{"email":"'"$scimUserEmail"'","password":"'"$scimUserPassword"'","name":"'"$scimUserDisplayName"'","team_code":"'"$SCIM_USER_INVITATION_CODE"'"}')

SCIM_USER_REGISTER_TEAM=$(echo "$CURL_OUT" | jq -r .team)

if [ "$SCIM_USER_REGISTER_TEAM" != "$TEAM_UUID" ]; then
echo "unexpected error: user got assigned to no / the wrong team?!"
Expand Down