Documentation
¶
Overview ¶
Package authorization defines protocol-neutral authorization contracts: a Request of principal, action and resource entities plus context, an Authorizer that returns a Decision, and the PolicySource and EntitySource interfaces an implementation reads from. Package cedar provides the Cedar implementation.
The package does not import package authentication; callers map an authenticated principal to a request entity themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidConfiguration reports invalid constructor options. ErrInvalidConfiguration = errors.New("authorization: invalid configuration") // ErrInvalidRequest reports a malformed or unbounded request. ErrInvalidRequest = errors.New("authorization: invalid request") // ErrSource reports that a policy or entity source failed. ErrSource = errors.New("authorization: source unavailable") // ErrInvalidSource reports policies or entities that are empty, oversized // or malformed. ErrInvalidSource = errors.New("authorization: invalid source") )
Sentinel errors returned by authorizers. A non-nil error always means the request is not authorized.
Functions ¶
This section is empty.
Types ¶
type Action ¶ added in v0.2.0
type Action struct {
ID string
}
Action identifies what the principal wants to do, for example "read". Its Cedar entity type is always Action, so Action{ID: "read"} is the Cedar entity Action::"read".
type Authorizer ¶
Authorizer evaluates an authorization request.
type EntitySource ¶
EntitySource supplies Cedar entity JSON for one request.
type PolicySource ¶
PolicySource supplies Cedar policy text.
type Principal ¶ added in v0.2.0
Principal identifies who makes a request, for example the Cedar entity User::"alice": Type "User", ID "alice". Type is a Cedar entity type such as "User" or "App::User"; ID is any non-empty UTF-8 string.