Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { ID uuid.UUID `gorm:"type:uuid;primaryKey"` CreatedAt time.Time UpdatedAt time.Time }
Base is a base model which holds common fields for each model.
type BasicAuthToken ¶
type BasicAuthToken struct {
// contains filtered or unexported fields
}
BasicAuthToken represents object to store auth information related to Basic Auth.
func (BasicAuthToken) GetRoles ¶
func (p BasicAuthToken) GetRoles() map[string]struct{}
GetRoles returns User roles assigned to current Auth token.
func (BasicAuthToken) HasAdminAccess ¶
func (p BasicAuthToken) HasAdminAccess() bool
HasAdminAccess makes check that user has admin permissions to access to the requested resource.
func (BasicAuthToken) HasUserAccess ¶
func (p BasicAuthToken) HasUserAccess(namespace string) bool
HasUserAccess makes check that user has permission to access to the requested namespace.
type UserPermissions ¶
type UserPermissions struct {
// contains filtered or unexported fields
}
UserPermissions represents model to store user permissions data.
func NewUserPermissions ¶
func NewUserPermissions(data map[string]map[string]struct{}) *UserPermissions
NewUserPermissions creates new instance of UserPermissions object.
func (UserPermissions) GetData ¶
func (p UserPermissions) GetData() map[string]map[string]struct{}
GetData returns current permissions data.
func (UserPermissions) ValidateAuthToken ¶
func (p UserPermissions) ValidateAuthToken(authToken string) *BasicAuthToken
ValidateAuthToken makes basic validation of auth token.
Click to show internal directories.
Click to hide internal directories.