mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-01-07 23:01:48 +02:00
Deprecating auth service
This commit is contained in:
parent
57050f9f92
commit
02b410e02f
@ -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).
|
// 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
|
// 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) {
|
func (s *AuthenticationService) AcquireSessionCookie(username, password string) (bool, error) {
|
||||||
apiEndpoint := "rest/auth/1/session"
|
apiEndpoint := "rest/auth/1/session"
|
||||||
body := struct {
|
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.
|
// SetBasicAuth sets username and password for the basic auth against the JIRA instance.
|
||||||
|
//
|
||||||
|
// Deprecated: Use BasicAuthTransport instead
|
||||||
func (s *AuthenticationService) SetBasicAuth(username, password string) {
|
func (s *AuthenticationService) SetBasicAuth(username, password string) {
|
||||||
s.username = username
|
s.username = username
|
||||||
s.password = password
|
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.
|
// 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
|
// 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 {
|
func (s *AuthenticationService) Logout() error {
|
||||||
if s.authType != authTypeSession || s.client.session == nil {
|
if s.authType != authTypeSession || s.client.session == nil {
|
||||||
return fmt.Errorf("No user is authenticated yet.")
|
return fmt.Errorf("No user is authenticated yet.")
|
||||||
|
Loading…
Reference in New Issue
Block a user