Skip to content

Commit

Permalink
Clean up the Jira client code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Cummer committed Jul 31, 2018
1 parent da9b863 commit 54d8240
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions jira/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ func buildJql(key string, value string) string {

/* -------------------- Unexported Functions -------------------- */

func jiraRequest(path string) (*http.Response, error) {
url := fmt.Sprintf("%s%s", wtf.Config.UString("wtf.mods.jira.domain"), path)

apiKey := wtf.Config.UString(
func apiKey() string {
return wtf.Config.UString(
"wtf.mods.jira.apiKey",
os.Getenv("WTF_JIRA_API_KEY"),
)
}

func jiraRequest(path string) (*http.Response, error) {
url := fmt.Sprintf("%s%s", wtf.Config.UString("wtf.mods.jira.domain"), path)

req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, err
}
//req.SetBasicAuth(wtf.Config.UString("wtf.mods.jira.email"), os.Getenv("WTF_JIRA_API_KEY"))
req.SetBasicAuth(wtf.Config.UString("wtf.mods.jira.email"), apiKey)
req.SetBasicAuth(wtf.Config.UString("wtf.mods.jira.email"), apiKey())

verifyServerCertificate := wtf.Config.UBool("wtf.mods.jira.verifyServerCertificate", true)
httpClient := &http.Client{Transport: &http.Transport{
Expand Down

0 comments on commit 54d8240

Please sign in to comment.