[#148] [#149] add support for api token based authentication

This commit is contained in:
Cory Bennett
2018-03-08 10:57:45 -08:00
parent 161a68920d
commit edb06621f8
15 changed files with 125 additions and 45 deletions
+5
View File
@@ -46,6 +46,11 @@ func authCallback(req *http.Request, resp *http.Response) (*http.Response, error
// CmdLogin will attempt to login into jira server
func CmdLogin(o *oreo.Client, globals *jiracli.GlobalOptions, opts *jiracli.CommonOptions) error {
if globals.AuthMethod() == "api-token" {
log.Noticef("No need to login when using api-token authentication method")
return nil
}
ua := o.WithoutRedirect().WithRetries(0).WithoutCallbacks().WithPostCallback(authCallback)
for {
if session, err := jira.GetSession(o, globals.Endpoint.Value); err != nil {