github.com/go-chef/chef@v0.30.1/authenticate.go (about)

     1  package chef
     2  
     3  type AuthenticateUserService struct {
     4  	client *Client
     5  }
     6  
     7  // Authenticate represents the body of the /authenticate_user request
     8  type Authenticate struct {
     9  	UserName string `json:"username"`
    10  	Password string `json:"password"`
    11  }
    12  
    13  // Authenticate performs an authentication attempt.
    14  //
    15  // https://docs.chef.io/api_chef_server.html#authenticate-user
    16  func (e *AuthenticateUserService) Authenticate(authenticate_request Authenticate) (err error) {
    17  	body, err := JSONReader(authenticate_request)
    18  	err = e.client.magicRequestDecoder("POST", "authenticate_user", body, nil)
    19  	return
    20  }