github.com/naphatkrit/deis@v1.12.3/client/controller/api/auth.go (about)

     1  package api
     2  
     3  // AuthRegisterRequest is the definition of POST /v1/auth/register/.
     4  type AuthRegisterRequest struct {
     5  	Username  string `json:"username"`
     6  	Password  string `json:"password"`
     7  	Email     string `json:"email"`
     8  	FirstName string `json:"first_name,omitempty"`
     9  	LastName  string `json:"last_name,omitempty"`
    10  }
    11  
    12  // AuthLoginRequest is the definition of POST /v1/auth/login/.
    13  type AuthLoginRequest struct {
    14  	Username string `json:"username"`
    15  	Password string `json:"password"`
    16  }
    17  
    18  // AuthLoginResponse is the definition of /v1/auth/login/.
    19  type AuthLoginResponse tokenResponse
    20  
    21  // AuthPasswdRequest is the definition of POST /v1/auth/passwd/.
    22  type AuthPasswdRequest struct {
    23  	Username    string `json:"username,omitempty"`
    24  	Password    string `json:"password,omitempty"`
    25  	NewPassword string `json:"new_password"`
    26  }
    27  
    28  // AuthRegenerateRequest is the definition of POST /v1/auth/tokens/.
    29  type AuthRegenerateRequest struct {
    30  	Name string `json:"username,omitempty"`
    31  	All  bool   `json:"all,omitempty"`
    32  }
    33  
    34  // AuthCancelRequest is the definition of POST /v1/auth/cancel/.
    35  type AuthCancelRequest struct {
    36  	Username string `json:"username"`
    37  }
    38  
    39  // AuthRegenerateResponse is the definition of /v1/auth/tokens/.
    40  type AuthRegenerateResponse tokenResponse
    41  
    42  // A generic defenition of a token response.
    43  type tokenResponse struct {
    44  	Token string `json:"token"`
    45  }