1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-12-21 23:47:34 +02:00

Moved Authentication() test into AuthenticationService, and add test case to validate it operates correctly

This commit is contained in:
Jason O'Broin
2016-05-19 22:00:13 -07:00
parent 2bc0c88214
commit bc5e20fe93
3 changed files with 30 additions and 8 deletions

View File

@@ -63,6 +63,15 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string)
return true, nil
}
// Authenticated reports if the current Client has an authenticated session with JIRA
func (s *AuthenticationService) Authenticated() bool {
if s != nil {
return s.client.session != nil
} else {
return false
}
}
// TODO Missing API Call GET (Returns information about the currently authenticated user's session)
// See https://docs.atlassian.com/jira/REST/latest/#auth/1/session
// TODO Missing API Call DELETE (Logs the current user out of JIRA, destroying the existing session, if any.)