Skip to content
Snippets Groups Projects
Verified Commit e571135f authored by Ira ¯\_(ツ)_/¯'s avatar Ira ¯\_(ツ)_/¯
Browse files

Fix formatting and linting

parent 0016fec6
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,6 @@ dependencies {
testImplementation("junit:junit:$junitVersion")
testImplementation("org.hamcrest:hamcrest:$hamcrestVersion")
testImplementation("com.palantir.docker.compose:docker-compose-rule-junit4:$dockerComposeRuleVersion")
}
tasks {
......
version: '3.8'
version: "3.8"
services:
postgres:
container_name: postgres
......
#!/bin/bash
export DIRECT_GRANT_RESPONSE=$(curl -i --request POST http://localhost:8080/auth/realms/master/protocol/openid-connect/token --header "Accept: application/json" --header "Content-Type: application/x-www-form-urlencoded" --data "grant_type=password&username=admin&password=admin&client_id=admin-cli")
DIRECT_GRANT_RESPONSE=$(curl -i --request POST http://localhost:8080/auth/realms/master/protocol/openid-connect/token --header "Accept: application/json" --header "Content-Type: application/x-www-form-urlencoded" --data "grant_type=password&username=admin&password=admin&client_id=admin-cli")
export DIRECT_GRANT_RESPONSE
echo -e "\n\nSENT RESOURCE-OWNER-PASSWORD-CREDENTIALS-REQUEST. OUTPUT IS:\n\n";
echo $DIRECT_GRANT_RESPONSE;
echo -e "\n\nSENT RESOURCE-OWNER-PASSWORD-CREDENTIALS-REQUEST. OUTPUT IS:\n\n"
echo "$DIRECT_GRANT_RESPONSE"
export ACCESS_TOKEN=$(echo $DIRECT_GRANT_RESPONSE | grep "access_token" | sed 's/.*\"access_token\":\"\([^\"]*\)\".*/\1/g');
echo -e "\n\nACCESS TOKEN IS \"$ACCESS_TOKEN\"";
ACCESS_TOKEN=$(echo "$DIRECT_GRANT_RESPONSE" | grep "access_token" | sed 's/.*\"access_token\":\"\([^\"]*\)\".*/\1/g')
export ACCESS_TOKEN
echo -e "\n\nACCESS TOKEN IS \"$ACCESS_TOKEN\""
echo -e "\n\nSENDING UN-AUTHENTICATED REQUEST. THIS SHOULD FAIL WITH 401: ";
echo -e "\n\nSENDING UN-AUTHENTICATED REQUEST. THIS SHOULD FAIL WITH 401: "
curl -i --request POST http://localhost:8080/auth/realms/master/mailpass/roleauth/compute-password-hash --data "{ \"password\": \"password\" }" --header "Content-type: application/json"
echo -e "\n\nSENDING AUTHENTICATED REQUEST. THIS SHOULD SUCCESSFULY CREATE PASSWORD HASH AND SUCCESS WITH 201: ";
curl -i --request POST http://localhost:8080/auth/realms/master/mailpass/roleauth/compute-password-hash --data "{ \"password\": \"#4e[LbY+n$yP~vmC\" }" --header "Content-type: application/json" --header "Authorization: Bearer $ACCESS_TOKEN";
echo -e "\n\nSENDING AUTHENTICATED REQUEST. THIS SHOULD SUCCESSFULY CREATE PASSWORD HASH AND SUCCESS WITH 201: "
curl -i --request POST http://localhost:8080/auth/realms/master/mailpass/roleauth/compute-password-hash --data "{ \"password\": \"#4e[LbY+n%yP~vmC\" }" --header "Content-type: application/json" --header "Authorization: Bearer $ACCESS_TOKEN"
version: '3.8'
version: "3.8"
services:
keycloak:
container_name: keycloak
......
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