Skip to content

Commit

Permalink
Merge pull request #12 from Djuuu/curl-basic-auth
Browse files Browse the repository at this point in the history
Jira requests - Use `curl -u` instead of building authorization header manually
  • Loading branch information
Djuuu authored Jun 22, 2023
2 parents 6071ef3 + 866065c commit 341679d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions git-mr
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,13 @@ jira_request() {

local jira_base_url="https://${JIRA_INSTANCE}/rest/api/3"

local auth_token; auth_token=$(echo -n "${JIRA_USER}:${JIRA_TOKEN}" | base64 -w 0)

echo_debug "Jira - ${request_verb} ${request_url} ${request_data}"

[[ $request_verb != "GET" ]] && git_mr_readonly && return 0

curl -Ss \
-X "${request_verb}" \
-H "Authorization: Basic ${auth_token}" \
-u "${JIRA_USER}:${JIRA_TOKEN}" \
-H "Content-Type: application/json" \
--data "${request_data}" \
--max-time "${GIT_MR_TIMEOUT}" \
Expand Down

0 comments on commit 341679d

Please sign in to comment.