-
Notifications
You must be signed in to change notification settings - Fork 325
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
More scripts #801
More scripts #801
Conversation
... rather than creating them without valid email or their consent.
I am going to tests these later (unless somebody will be faster than me), but this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try all the scripts yet, just fixed a parse problem in one of them. I wonder if we could write a test for these scripts (so we notice if they become broken in the future)?
echo "Created the invitation, sleeping 1 second..." 1>&2 | ||
sleep 1 | ||
|
||
ERR='{"code":409,"message":"The given e-mail address is in use.","label":"email-exists"}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the only error case; the team ID or the user ID could also be incorrect, or the permissions for that admin_userid could not be sufficient. Perhaps you could abort the script on any 4xx, not just this particular 409.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like this?: 311c13c
@@ -0,0 +1,81 @@ | |||
#!/usr/bin/env bash | |||
|
|||
set -ex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is -x
verbosity necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. If you don't let me know and I'll remove it.
tried this on staging:
with
mailinator doesn't work any more without registration, but seeing pending users is good enough for me. |
-a <admin uuid>: User ID of the inviting admin. default: ${ADMIN_UUID} | ||
-t <team uuid>: ID of the inviting team. default: ${TEAM_UUID} | ||
-h <host>: Base URI of brig. default: ${BRIG_HOST} | ||
-c: input file containing info on the invitees in format 'Email,UserName'. default: ${CSV_FILE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps "-c <input_file>: file containing ...
END=$((COUNT + START - 1)) | ||
for i in $(seq "$START" "$END") | ||
do | ||
EMAIL='w'$(printf "%03d" "$i")"@example.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps a comment or something to tell the user the emails start with 'w'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that we should be careful about is that we actually send out emails with this request.
Sending emails to example.com will trigger an email being sent out and may lower our reputation.
Perhaps make the domain configurable and explain that, currently, we effectively send out the emails (and perhaps we need an extra endpoint/flag that prevents sending it over the Wire?)
@fisx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, only saw that after I merged... I'll make another PR and ping you.
TEAM=$(echo "$CURL_OUT" | tail -1 | sed 's/.*\"team\":\"\([a-z0-9-]*\)\".*/\1/') | ||
|
||
if [ "$TEAM" != "$TEAM_UUID" ]; then | ||
echo "unexpected error: user got assigned to no / the wrong team?!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps dump the curl_out here?
No description provided.