Documentation ¶
Index ¶
Constants ¶
View Source
const (
// AuthTokenHeader is the key of auth token header
AuthTokenHeader = "x-xenon-auth-token"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthContext ¶
type AuthContext struct { PrincipalID string `json:"id"` Name string `json:"name"` Email string `json:"email"` Roles []string `json:"roles"` Projects []*project `json:"projects"` }
AuthContext ...
func GetAuthCtx ¶
func GetAuthCtx(client *http.Client, url, token string) (*AuthContext, error)
GetAuthCtx returns the auth context of the current user
func Login ¶
func Login(client *http.Client, url, username, password, token string) (*AuthContext, error)
Login with credential and returns auth context and error
func (*AuthContext) GetMyProjects ¶
func (a *AuthContext) GetMyProjects() []*models.Project
GetMyProjects returns all projects which the user is a member of
func (*AuthContext) GetProjectRoles ¶
func (a *AuthContext) GetProjectRoles(projectIDOrName interface{}) []int
GetProjectRoles ...
Click to show internal directories.
Click to hide internal directories.