Documentation ¶
Index ¶
- Variables
- func BaseTokenPermission(t Token) ([]permission.Permission, error)
- func ConvertOldUser(u *User, err error) (*authTypes.User, error)
- func ParseToken(header string) (string, error)
- func QuotaService() (quotaTypes.QuotaService, error)
- func RegisterScheme(name string, scheme Scheme)
- func RemoveRoleFromAllUsers(roleName string) error
- func TeamService() (authTypes.TeamService, error)
- func TeamTokenService() (authTypes.TeamTokenService, error)
- func UnregisterScheme(name string)
- func UpdateRoleFromAllUsers(roleName, newRoleName, ctx, desc string) error
- type APIToken
- type AuthenticationFailure
- type ManagedScheme
- type Scheme
- type SchemeInfo
- type Token
- type User
- func (u *User) AddKey(key repository.Key, force bool) error
- func (u *User) AddRole(roleName string, contextValue string) error
- func (u *User) AddRolesForEvent(roleEvent *permTypes.RoleEvent, contextValue string) error
- func (u *User) Create() error
- func (u *User) Delete() error
- func (u *User) ListKeys() (map[string]string, error)
- func (u *User) Permissions() ([]permission.Permission, error)
- func (u *User) RegenerateAPIKey() (string, error)
- func (u *User) Reload() error
- func (u *User) RemoveKey(key repository.Key) error
- func (u *User) RemoveRole(roleName string, contextValue string) error
- func (u *User) ShowAPIKey() (string, error)
- func (u *User) Update() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidToken = errors.New("Invalid token")
Functions ¶
func BaseTokenPermission ¶
func BaseTokenPermission(t Token) ([]permission.Permission, error)
func ParseToken ¶
ParseToken extracts token from a header: 'type token' or 'token'
func QuotaService ¶
func QuotaService() (quotaTypes.QuotaService, error)
func RegisterScheme ¶
func RemoveRoleFromAllUsers ¶
func TeamService ¶
func TeamService() (authTypes.TeamService, error)
func TeamTokenService ¶
func TeamTokenService() (authTypes.TeamTokenService, error)
func UnregisterScheme ¶
func UnregisterScheme(name string)
func UpdateRoleFromAllUsers ¶
Types ¶
type APIToken ¶
type APIToken struct { Token string `json:"token" bson:"apikey"` UserEmail string `json:"email" bson:"email"` }
func (*APIToken) GetAppName ¶
func (*APIToken) GetUserName ¶
func (*APIToken) IsAppToken ¶
func (*APIToken) Permissions ¶
func (t *APIToken) Permissions() ([]permission.Permission, error)
type AuthenticationFailure ¶
type AuthenticationFailure struct {
Message string
}
func (AuthenticationFailure) Error ¶
func (a AuthenticationFailure) Error() string
type ManagedScheme ¶
type Scheme ¶
type Scheme interface { AppLogin(appName string) (Token, error) AppLogout(token string) error Login(params map[string]string) (Token, error) Logout(token string) error Auth(token string) (Token, error) Info() (SchemeInfo, error) Name() string Create(user *User) (*User, error) Remove(user *User) error }
type SchemeInfo ¶
type SchemeInfo map[string]interface{}
type Token ¶
Token type alias exists to ease refactoring while we move auth types to types/auth package. Both this type alias and the Convert*User funcs should be eliminated once we convert everyone to use authTypes.User.
type User ¶
type User struct { Quota quota.Quota Email string Password string APIKey string Roles []authTypes.RoleInstance `bson:",omitempty"` }
func GetUserByEmail ¶
func ListUsersWithPermissions ¶
func ListUsersWithPermissions(wantedPerms ...permission.Permission) ([]User, error)
func ListUsersWithRole ¶
func (*User) AddRolesForEvent ¶
func (*User) Permissions ¶
func (u *User) Permissions() ([]permission.Permission, error)
func (*User) RegenerateAPIKey ¶
func (*User) ShowAPIKey ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.