warden

package
v0.0.0-...-e62b3d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2016 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthorizedHandlerPath = "/warden/authorized"
	AllowedHandlerPath    = "/warden/allowed"
)

Variables

This section is empty.

Functions

func TokenFromRequest

func TokenFromRequest(r *http.Request) string

Types

type HTTPWarden

type HTTPWarden struct {
	Client *http.Client

	Endpoint *url.URL
}

func (*HTTPWarden) ActionAllowed

func (w *HTTPWarden) ActionAllowed(ctx context.Context, token string, a *ladon.Request, scopes ...string) (*Context, error)

func (*HTTPWarden) Authorized

func (w *HTTPWarden) Authorized(ctx context.Context, token string, scopes ...string) (*Context, error)

func (*HTTPWarden) HTTPActionAllowed

func (w *HTTPWarden) HTTPActionAllowed(ctx context.Context, r *http.Request, a *ladon.Request, scopes ...string) (*Context, error)

func (*HTTPWarden) HTTPAuthorized

func (w *HTTPWarden) HTTPAuthorized(ctx context.Context, r *http.Request, scopes ...string) (*Context, error)

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 (w *LocalWarden) ActionAllowed(ctx context.Context, token string, a *ladon.Request, scopes ...string) (*Context, error)

func (*LocalWarden) Authorized

func (w *LocalWarden) Authorized(ctx context.Context, token string, scopes ...string) (*Context, error)

func (*LocalWarden) HTTPActionAllowed

func (w *LocalWarden) HTTPActionAllowed(ctx context.Context, r *http.Request, a *ladon.Request, scopes ...string) (*Context, error)

func (*LocalWarden) HTTPAuthorized

func (w *LocalWarden) HTTPAuthorized(ctx context.Context, r *http.Request, scopes ...string) (*Context, error)

type WardenAccessRequest

type WardenAccessRequest struct {
	*ladon.Request
	*WardenAuthorizedRequest
}

type WardenAuthorizedRequest

type WardenAuthorizedRequest struct {
	Scopes    []string `json:"scopes"`
	Assertion string   `json:"assertion"`
}

type WardenHandler

type WardenHandler struct {
	H      herodot.Herodot
	Warden firewall.Firewall
	Ladon  ladon.Warden
}

func NewHandler

func NewHandler(c *config.Config, router *httprouter.Router) *WardenHandler

func (*WardenHandler) Allowed

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

type WardenResponse struct {
	*firewall.Context
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL