mirror of
				https://github.com/taigrr/wtf
				synced 2025-01-18 04:03:14 -08:00 
			
		
		
		
	Clean up the Jira client code a bit
This commit is contained in:
		
							parent
							
								
									da9b863625
								
							
						
					
					
						commit
						54d82408f9
					
				| @ -54,20 +54,21 @@ func buildJql(key string, value string) string { | |||||||
| 
 | 
 | ||||||
| /* -------------------- Unexported Functions -------------------- */ | /* -------------------- Unexported Functions -------------------- */ | ||||||
| 
 | 
 | ||||||
| func jiraRequest(path string) (*http.Response, error) { | func apiKey() string { | ||||||
| 	url := fmt.Sprintf("%s%s", wtf.Config.UString("wtf.mods.jira.domain"), path) | 	return wtf.Config.UString( | ||||||
| 
 |  | ||||||
| 	apiKey := wtf.Config.UString( |  | ||||||
| 		"wtf.mods.jira.apiKey", | 		"wtf.mods.jira.apiKey", | ||||||
| 		os.Getenv("WTF_JIRA_API_KEY"), | 		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) | 	req, err := http.NewRequest("GET", url, nil) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, err | 		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) | 	verifyServerCertificate := wtf.Config.UBool("wtf.mods.jira.verifyServerCertificate", true) | ||||||
| 	httpClient := &http.Client{Transport: &http.Transport{ | 	httpClient := &http.Client{Transport: &http.Transport{ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user