Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoAuthenticationMiddleware = errors.New("unable to extract user id from context, missing authentication middleware?")
)
Functions ¶
This section is empty.
Types ¶
type ActionResourcePolicy ¶
type ActionResourcePolicy struct { Action string ResourceExtractor ResourceExtractor }
func (ActionResourcePolicy) Authorize ¶
func (p ActionResourcePolicy) Authorize(ctx context.Context, userID string, authorizer AuthorizerClient, r *http.Request) error
type AuthorizerClient ¶
type Middleware ¶
type Middleware struct { Tracer middleware.Tracer // contains filtered or unexported fields }
func New ¶
func New(opts ...Option) *Middleware
func (*Middleware) Middleware ¶
func (m *Middleware) Middleware() func(http.Handler) http.Handler
func (*Middleware) SetPolicy ¶
func (m *Middleware) SetPolicy(route *mux.Route, policy Policy) *Middleware
type MultiPolicy ¶
type MultiPolicy []Policy
func (MultiPolicy) Authorize ¶
func (policies MultiPolicy) Authorize(ctx context.Context, userID string, authorizer AuthorizerClient, r *http.Request) error
type Option ¶
type Option func(*Middleware)
func WithAuthorizerClient ¶
func WithAuthorizerClient(client AuthorizerClient) Option
Click to show internal directories.
Click to hide internal directories.