Skip to content
Snippets Groups Projects
Verified Commit 5ee76d3d authored by Mark's avatar Mark
Browse files

Add helper scripts to create users

parent e87d7ea1
No related branches found
No related tags found
1 merge request!1Integration
Pipeline #353 passed with stages
in 4 minutes and 6 seconds
#!/bin/bash
APPLICATION=$1
SERVER=$2
PORT=$3
if [[ $APPLICATION == "" ]]; then
echo "Please specify an application name"
exit 1
fi
if [[ $SERVER == "" ]]; then
SERVER=localhost
fi
if [[ $PORT == "" ]]; then
PORT=5000
fi
echo "Creating application $APPLICATION"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"query\": \"mutation {createApplication(name: \\\"$APPLICATION\\\"){application{name}}}\" }" \
http://$SERVER:$PORT/graphql
#!/bin/bash
USERNAME=$1
PASSWORD=$2
EMAIL=$3
SERVER=$4
PORT=$5
if [[ $USERNAME == "" ]] || [[ $PASSWORD == "" ]] || [[ $EMAIL == "" ]]; then
echo "Please specify username, password and email address"
exit 1
fi
if [[ $SERVER == "" ]]; then
SERVER=localhost
fi
if [[ $PORT == "" ]]; then
PORT=5000
fi
echo "Creating admin user"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"query\": \"mutation {createUser(username: \\\"$USERNAME\\\", password: \\\"$PASSWORD\\\", email: \\\"$EMAIL\\\"){user{username}}}\" }" \
http://$SERVER:$PORT/graphql
#!/bin/bash
USERNAME=$1
APPLICATION=$2
SERVER=$3
PORT=$4
if [[ $USERNAME == "" ]] || [[ $APPLICATION == "" ]]; then
echo "Please specify username and application"
exit 1
fi
if [[ $SERVER == "" ]]; then
SERVER=localhost
fi
if [[ $PORT == "" ]]; then
PORT=5000
fi
echo "Granting access to application $APPLICATION to User $USERNAME"
curl --header "Content-Type: application/json" \
--request POST \
--data "{\"query\": \"mutation {addApplicationToUser(username: \\\"$USERNAME\\\", application: \\\"$APPLICATION\\\"){user{username, applications{edges{node{name}}}}}}\" }" \
http://$SERVER:$PORT/graphql
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment