Documentation
¶
Index ¶
Constants ¶
View Source
const ActionBits = 24
View Source
const PkgName = "security"
Variables ¶
View Source
var Actions = map[string]uint64{
"view": 1,
"edit": 1 << 1,
"delete": 1 << 2,
"disconnect": 1 << 3,
"restart": 1 << 4,
"rollback": 1 << 5,
"logs": 1 << 6,
"deploy": 1 << 7,
"shutdown": 1 << 8,
"execute": 1 << 9,
}
Actions holds all actions requiring authorization. Up to 24 actions are supported. WARN: DO NOT CHANGE VALUES!!!
View Source
var Perms = map[string][]string{
"registry": {"view", "edit", "delete"},
"node": {"view", "edit", "delete"},
"network": {"view", "edit", "delete", "disconnect"},
"service": {"view", "edit", "delete", "deploy", "restart", "rollback", "logs"},
"task": {"view", "logs"},
"stack": {"view", "edit", "delete", "deploy", "shutdown"},
"config": {"view", "edit", "delete"},
"secret": {"view", "edit", "delete"},
"image": {"view", "delete"},
"container": {"view", "delete", "logs", "execute"},
"volume": {"view", "edit", "delete"},
"user": {"view", "edit", "delete"},
"role": {"view", "edit", "delete"},
"chart": {"view", "edit", "delete"},
"dashboard": {"edit"},
"event": {"view"},
"setting": {"view", "edit"},
}
View Source
var Resources = map[string]uint64{
"registry": 1,
"node": 1 << 1,
"network": 1 << 2,
"service": 1 << 3,
"task": 1 << 4,
"stack": 1 << 5,
"config": 1 << 6,
"secret": 1 << 7,
"image": 1 << 8,
"container": 1 << 9,
"volume": 1 << 10,
"user": 1 << 11,
"role": 1 << 12,
"chart": 1 << 13,
"dashboard": 1 << 14,
"event": 1 << 15,
"setting": 1 << 16,
}
Resources holds all resources requiring authorization. Up to 40 resources are supported. WARN: DO NOT CHANGE VALUES!!!
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer struct {
}
func NewAuthorizer ¶
func NewAuthorizer() Authorizer
func (Authorizer) Apply ¶
func (p Authorizer) Apply(next web.HandlerFunc) web.HandlerFunc
Apply implements `web.Filter` interface.
type Identifier ¶
type Identifier struct {
// contains filtered or unexported fields
}
Identifier identifies the user.
func NewIdentifier ¶
func NewIdentifier(s *misc.Setting, ub biz.UserBiz, rb biz.RoleBiz, sb biz.SessionBiz) *Identifier
func (*Identifier) Apply ¶
func (c *Identifier) Apply(next web.HandlerFunc) web.HandlerFunc
type Identity ¶
type RealmFunc ¶
type User ¶
type User struct {
// contains filtered or unexported fields
}
type UserInfo ¶
type UserInfo struct {
// contains filtered or unexported fields
}
Source Files
¶
- auth.go
- perm.go
- security.go
Click to show internal directories.
Click to hide internal directories.