Closed felixbuenemann closed 7 years ago
For now I've scripted around the issue with a small bash script (requires curl
and jq
):
#!/bin/bash
# Usage: deis-register-user <user> <pass> <email>
USER=$1
PASS=$2
EMAIL=$3
DEIS_PROFILE_PATH=~/.deis/${DEIS_PROFILE:-client}.json
DEIS_CONTROLLER=$(jq -r .controller < $DEIS_PROFILE_PATH)
DEIS_TOKEN=$(jq -r .token < $DEIS_PROFILE_PATH)
curl -fsS ${DEIS_CONTROLLER%/}/v2/auth/register/ \
-H "Authorization: token $DEIS_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$USER\",\"password\":\"$PASS\",\"email\":\"$EMAIL\"}"
If a cluster is run in admin_only registration mode, it would be great if
deis register
had a--skip-login
flag to allow creating users as an admin without logging into their account. Alternatively ausers:create
action would make sense, that does not require passing the controller url.