Documentation
¶
Overview ¶
Package httpauth provides fail-closed net/http authorization integration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DecisionFromContext ¶
func DecisionFromContext(ctx context.Context) (authorization.Decision, bool)
func NewHandler ¶
func NewHandler( authorizer Authorizer, mapper RequestMapper, next http.Handler, handlerOptions ...Option, ) (http.Handler, error)
NewHandler maps each HTTP request, evaluates it, and invokes next only for explicit allow decisions. Mapper and evaluation failures use the error handler; deny and not-applicable outcomes use the denial handler.
Types ¶
type Authorizer ¶
type Authorizer interface {
Decide(context.Context, authorization.Request) (authorization.Decision, error)
}
type RequestMapper ¶
type RequestMapper func(*http.Request) (authorization.Request, error)
Click to show internal directories.
Click to hide internal directories.