Skip to content

Commit

Permalink
Clean up the Jira module's API credentials loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Cummer committed Jul 31, 2018
1 parent 0a019ff commit ddd3eb9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jira/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ func buildJql(key string, value string) string {
func jiraRequest(path string) (*http.Response, error) {
url := fmt.Sprintf("%s%s", wtf.Config.UString("wtf.mods.jira.domain"), path)

apiKey := wtf.Config.UString(
"wtf.mods.jira.apiKey",
os.Getenv("WTF_JIRA_API_KEY"),
)

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"), os.Getenv("WTF_JIRA_API_KEY"))
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 ddd3eb9

Please sign in to comment.