Documentation
¶
Index ¶
- Constants
- func TokenFromRequest(r *http.Request) string
- type HTTPWarden
- func (w *HTTPWarden) ActionAllowed(ctx context.Context, token string, a *ladon.Request, scopes ...string) (*Context, error)
- func (w *HTTPWarden) Authorized(ctx context.Context, token string, scopes ...string) (*Context, error)
- func (w *HTTPWarden) HTTPActionAllowed(ctx context.Context, r *http.Request, a *ladon.Request, scopes ...string) (*Context, error)
- func (w *HTTPWarden) HTTPAuthorized(ctx context.Context, r *http.Request, scopes ...string) (*Context, error)
- func (w *HTTPWarden) SetClient(c *clientcredentials.Config)
- type LocalWarden
- func (w *LocalWarden) ActionAllowed(ctx context.Context, token string, a *ladon.Request, scopes ...string) (*Context, error)
- func (w *LocalWarden) Authorized(ctx context.Context, token string, scopes ...string) (*Context, error)
- func (w *LocalWarden) HTTPActionAllowed(ctx context.Context, r *http.Request, a *ladon.Request, scopes ...string) (*Context, error)
- func (w *LocalWarden) HTTPAuthorized(ctx context.Context, r *http.Request, scopes ...string) (*Context, error)
- type WardenAccessRequest
- type WardenAuthorizedRequest
- type WardenHandler
- type WardenResponse
Constants ¶
View Source
const ( AuthorizedHandlerPath = "/warden/authorized" AllowedHandlerPath = "/warden/allowed" )
Variables ¶
This section is empty.
Functions ¶
func TokenFromRequest ¶
Types ¶
type HTTPWarden ¶
func (*HTTPWarden) ActionAllowed ¶
func (*HTTPWarden) Authorized ¶
func (*HTTPWarden) HTTPActionAllowed ¶
func (*HTTPWarden) HTTPAuthorized ¶
func (*HTTPWarden) SetClient ¶
func (w *HTTPWarden) SetClient(c *clientcredentials.Config)
type LocalWarden ¶
type LocalWarden struct { Warden ladon.Warden TokenValidator *core.CoreValidator Issuer string }
func (*LocalWarden) ActionAllowed ¶
func (*LocalWarden) Authorized ¶
func (*LocalWarden) HTTPActionAllowed ¶
func (*LocalWarden) HTTPAuthorized ¶
type WardenAccessRequest ¶
type WardenAccessRequest struct { *ladon.Request *WardenAuthorizedRequest }
type WardenAuthorizedRequest ¶
type WardenHandler ¶
func NewHandler ¶
func NewHandler(c *config.Config, router *httprouter.Router) *WardenHandler
func (*WardenHandler) Allowed ¶
func (h *WardenHandler) Allowed(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*WardenHandler) Authorized ¶
func (h *WardenHandler) Authorized(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
func (*WardenHandler) SetRoutes ¶
func (h *WardenHandler) SetRoutes(r *httprouter.Router)
type WardenResponse ¶
Click to show internal directories.
Click to hide internal directories.