1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-01-05 22:53:53 +02:00

Deprecating auth service

This commit is contained in:
Bob Briski 2018-02-28 08:36:22 -08:00
parent 57050f9f92
commit 02b410e02f

View File

@ -54,6 +54,8 @@ type Session struct {
// However, this resource may be used to mimic the behaviour of JIRA's log-in page (e.g. to display log-in errors to a user).
//
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
//
// Deprecated: Use CookieAuthTransport instead
func (s *AuthenticationService) AcquireSessionCookie(username, password string) (bool, error) {
apiEndpoint := "rest/auth/1/session"
body := struct {
@ -90,6 +92,8 @@ func (s *AuthenticationService) AcquireSessionCookie(username, password string)
}
// SetBasicAuth sets username and password for the basic auth against the JIRA instance.
//
// Deprecated: Use BasicAuthTransport instead
func (s *AuthenticationService) SetBasicAuth(username, password string) {
s.username = username
s.password = password
@ -112,6 +116,9 @@ func (s *AuthenticationService) Authenticated() bool {
// Logout logs out the current user that has been authenticated and the session in the client is destroyed.
//
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#auth/1/session
//
// Deprecated: Use CookieAuthTransport to create base client. Logging out is as simple as not using the
// client anymore
func (s *AuthenticationService) Logout() error {
if s.authType != authTypeSession || s.client.session == nil {
return fmt.Errorf("No user is authenticated yet.")