Documentation ¶
Overview ¶
Package actionlist is a Authorizer that looks at specific claims in a JWT token and allow requests based on the approved list of actions.
The JWT claims must have a "agents" claim that is a list of a strings with the following possible values:
Allow all requests to any agent and action
[]string{"*"}
Allow requests to all actions of rpcutil agent
[]string{"rpcutil.*"}
Allow requests only to rpcutil agent ping action
[]string{"rpcutil.ping"}
Multiple claims are parsed in a first match order, default is deny
[]string{"rpcutil.*", "package.status"}
Here we have 2 allow rules, it will keep looking till it finds a match and then default deny.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
Authorizer authorizes requests based on their agent and action
func New ¶
func New(log *logrus.Entry, site string) *Authorizer
New creates a new actionlist authorizer
func (*Authorizer) Authorize ¶
func (a *Authorizer) Authorize(req protocol.Request, claims *tokens.ClientIDClaims) (allowed bool, err error)
Authorize implements authorizers.Authorizer