Skip to content

Instantly share code, notes, and snippets.

@al-maisan
Created December 15, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al-maisan/0ac5b90a84b4b43eb13b94b9e7aa3d3e to your computer and use it in GitHub Desktop.
Save al-maisan/0ac5b90a84b4b43eb13b94b9e7aa3d3e to your computer and use it in GitHub Desktop.
liam_i0() {
mysql --protocol=tcp -h localhost -P 13306 -u liamu -pliamu liam -e "UPDATE users SET status='created', acode='SIBEX rockz\!\!' WHERE email='admin@sibex.io'"
}
liam_i1() {
curl -v -F 'acode=SIBEX rockz!!' -F "email=admin@sibex.io" http://localhost:3340/liam/v1/users/activate | jq
}
liam_usrs() {
curl -b /tmp/cookies -v -G http://localhost:3340/liam/v1/users -H "accept: application/json" | jq
}
liam_orgs() {
curl -b /tmp/cookies -v -G http://localhost:3340/liam/v1/organizations -H "accept: application/json" | jq
}
liam_usr_activate() {
read -p 'acode: ' acode && read -p 'email : ' email && data='{"acode":"'$acode'","email":"'$email'"}' && curl -v --header "Content-Type: application/json" --data "$data" http://localhost:3340/liam/v1/users/activate | jq
}
liam_usr_passwd() {
read -p 'acode: ' acode && read -p 'eid: ' eid && curl -v --header "Content-Type: application/json" --data '{"eid": "'$eid'","acode": "'$acode'","passwd":"dG9wIHNlY3JldCEK"}' http://localhost:3340/liam/v1/users/password
}
liam_usr_login() {
read -p 'eid : ' eid && curl -v -c /tmp/cookies --header "Content-Type: application/json" --data '{"eid": "'$eid'","passwd":"dG9wIHNlY3JldCEK"}' http://localhost:3340/liam/v1/users/login
}
liam_usr_create() {
read -p 'name: ' name && read -p 'email : ' email && read -p 'organization_eid : ' organization_eid && data='{"name":"'$name'","email":"'$email'","organization_eid":"'$organization_eid'"}' && curl -v -b /tmp/cookies --header "Content-Type: application/json" --data "$data" http://localhost:3340/liam/v1/users | jq
}
liam_org_create() {
read -p 'name: ' name && read -p 'type: ' type && read -p 'max_users: ' max_users && read -p 'address1: ' address1 && read -p 'city: ' city && read -p 'country: ' country && data='{"name":"'$name'","type":"'$type'","max_users":'$max_users',"address1":"'$address1'","city":"'$city'","country":"'$country'"}' && curl -v -b /tmp/cookies --header "Content-Type: application/json" --data "$data" http://localhost:3340/liam/v1/organizations | jq
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment