From 8cc1ea8f4c2c69dd18118c5d97ef931e857b7c0d Mon Sep 17 00:00:00 2001 From: Francisco Barros <francisco.borges.aurindo.barros@cern.ch> Date: Fri, 4 Mar 2022 11:22:19 +0100 Subject: [PATCH] Fix: URL typo for POST on Add/remove Group from role --- scripts/addGroupToDrupalAdmins.sh | 2 +- scripts/removeGroupFromDrupalAdmins.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/addGroupToDrupalAdmins.sh b/scripts/addGroupToDrupalAdmins.sh index a64aa86..0175043 100755 --- a/scripts/addGroupToDrupalAdmins.sh +++ b/scripts/addGroupToDrupalAdmins.sh @@ -41,7 +41,7 @@ if [[ $GROUP_EXISTS != "200" ]]; then fi # Add group ${GROUP_NAME} to ${ROLE_ID} (administrator) in ${APPLICATION_ID}, as per https://authorization-service-api.web.cern.ch/swagger/index.html#operations-Application-post_api_v1_0_Application__id__roles__roleid__groups__groupid_ -SUCCESS=$(curl --silent -X POST "https://${AUTHZAPI_URL}/${AUTHZAPI_VERSION}/Application/${APPLICATION_ID}/roles/${ROLE_ID}/groups/${GROUP_NAME}" -H "accept: text/plain" -H "Authorization: Bearer ${BEARER_TOKEN}" -d "" -o /dev/null -w "%{http_code}") +SUCCESS=$(curl --silent -X POST "${AUTHZAPI_URL}/${AUTHZAPI_VERSION}/Application/${APPLICATION_ID}/roles/${ROLE_ID}/groups/${GROUP_NAME}" -H "accept: text/plain" -H "Authorization: Bearer ${BEARER_TOKEN}" -d "" -o /dev/null -w "%{http_code}") if [[ $SUCCESS != "200" ]]; then echo "Error binding group to admin role, error code: ${SUCCESS}" exit 1 diff --git a/scripts/removeGroupFromDrupalAdmins.sh b/scripts/removeGroupFromDrupalAdmins.sh index 5d70d49..d380fc8 100755 --- a/scripts/removeGroupFromDrupalAdmins.sh +++ b/scripts/removeGroupFromDrupalAdmins.sh @@ -41,7 +41,7 @@ if [[ $GROUP_EXISTS != "200" ]]; then fi # Remove ${GROUP_NAME} of ${ROLE_ID} (administrator) from ${APPLICATION_ID}, as per https://authorization-service-api.web.cern.ch/swagger/index.html#operations-Application-delete_api_v1_0_Application__id__roles__roleid__groups__groupid_ -SUCCESS=$(curl --silent -X DELETE "https://${AUTHZAPI_URL}/${AUTHZAPI_VERSION}/Application/${APPLICATION_ID}/roles/${ROLE_ID}/groups/${GROUP_NAME}" -H "accept: text/plain" -H "Authorization: Bearer ${BEARER_TOKEN}" -d "" -o /dev/null -w "%{http_code}") +SUCCESS=$(curl --silent -X DELETE "${AUTHZAPI_URL}/${AUTHZAPI_VERSION}/Application/${APPLICATION_ID}/roles/${ROLE_ID}/groups/${GROUP_NAME}" -H "accept: text/plain" -H "Authorization: Bearer ${BEARER_TOKEN}" -d "" -o /dev/null -w "%{http_code}") if [[ $SUCCESS != "200" ]]; then echo "Error binding group to admin role, error code: ${SUCCESS}" exit 1 -- GitLab