handlers

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_REQ_BODY_SIZE = 10 << 20 // 10 MB
View Source
const TokenDataKey = Key("tokenData")

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator struct {
	Client        UAAClient
	Scopes        []string
	ErrorResponse errorResponse
	ScopeChecking bool
}

func (*Authenticator) Wrap

func (a *Authenticator) Wrap(handle http.Handler) http.Handler

type CheckVersionWrapper added in v1.4.0

type CheckVersionWrapper struct {
	ErrorResponse errorResponse
}

func (*CheckVersionWrapper) CheckVersion added in v1.4.0

func (c *CheckVersionWrapper) CheckVersion(handlers map[string]http.Handler) http.Handler

type Health added in v1.0.0

type Health struct {
	Store         dataStore
	ErrorResponse errorResponse
}

func NewHealth added in v1.4.0

func NewHealth(store dataStore, errorResponse errorResponse) *Health

func (*Health) ServeHTTP added in v1.0.0

func (h *Health) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Key added in v1.4.0

type Key string

type PoliciesCleanup added in v0.7.0

type PoliciesCleanup struct {
	Mapper        api.PolicyMapper
	PolicyCleaner policyCleaner
	ErrorResponse errorResponse
}

func NewPoliciesCleanup added in v1.4.0

func NewPoliciesCleanup(mapper api.PolicyMapper, policyCleaner policyCleaner, errorResponse errorResponse) *PoliciesCleanup

func (*PoliciesCleanup) ServeHTTP added in v0.7.0

func (h *PoliciesCleanup) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PoliciesCreate

type PoliciesCreate struct {
	Store         dataStore
	Mapper        api.PolicyMapper
	PolicyGuard   policyGuard
	QuotaGuard    quotaGuard
	ErrorResponse errorResponse
}

func NewPoliciesCreate added in v1.4.0

func NewPoliciesCreate(store dataStore, mapper api.PolicyMapper,
	policyGuard policyGuard, quotaGuard quotaGuard, errorResponse errorResponse) *PoliciesCreate

func (*PoliciesCreate) ServeHTTP

func (h *PoliciesCreate) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PoliciesDelete

type PoliciesDelete struct {
	Store         dataStore
	Mapper        api.PolicyMapper
	PolicyGuard   policyGuard
	ErrorResponse errorResponse
}

func NewPoliciesDelete added in v1.4.0

func NewPoliciesDelete(store dataStore, mapper api.PolicyMapper,
	policyGuard policyGuard, errorResponse errorResponse) *PoliciesDelete

func (*PoliciesDelete) ServeHTTP

func (h *PoliciesDelete) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PoliciesIndex

type PoliciesIndex struct {
	Store         dataStore
	Mapper        api.PolicyMapper
	PolicyFilter  policyFilter
	ErrorResponse errorResponse
}

func NewPoliciesIndex added in v1.4.0

func NewPoliciesIndex(store dataStore, mapper api.PolicyMapper, policyFilter policyFilter,
	errorResponse errorResponse) *PoliciesIndex

func (*PoliciesIndex) ServeHTTP

func (h *PoliciesIndex) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PoliciesIndexInternal

type PoliciesIndexInternal struct {
	Logger        lager.Logger
	Store         dataStore
	Mapper        api.PolicyMapper
	ErrorResponse errorResponse
}

func NewPoliciesIndexInternal added in v1.4.0

func NewPoliciesIndexInternal(logger lager.Logger, store dataStore,
	mapper api.PolicyMapper, errorResponse errorResponse) *PoliciesIndexInternal

func (*PoliciesIndexInternal) ServeHTTP

func (h *PoliciesIndexInternal) ServeHTTP(w http.ResponseWriter, req *http.Request)

type PolicyFilter added in v0.13.0

type PolicyFilter struct {
	CCClient  ccClient
	UAAClient uaaClient
	ChunkSize int
}

func NewPolicyFilter added in v1.4.0

func NewPolicyFilter(uaaClient uaaClient, ccClient ccClient, chunkSize int) *PolicyFilter

func (*PolicyFilter) FilterPolicies added in v0.13.0

func (f *PolicyFilter) FilterPolicies(policies []store.Policy, userToken uaa_client.CheckTokenResponse) ([]store.Policy, error)

type PolicyGuard added in v0.12.0

type PolicyGuard struct {
	CCClient  ccClient
	UAAClient uaaClient
}

func NewPolicyGuard added in v1.4.0

func NewPolicyGuard(uaaClient uaaClient, ccClient ccClient) *PolicyGuard

func (*PolicyGuard) CheckAccess added in v0.12.0

func (g *PolicyGuard) CheckAccess(policies []store.Policy, userToken uaa_client.CheckTokenResponse) (bool, error)

type QuotaGuard added in v1.1.0

type QuotaGuard struct {
	Store       dataStore
	MaxPolicies int
}

func NewQuotaGuard added in v1.4.0

func NewQuotaGuard(store dataStore, maxPolicies int) *QuotaGuard

func (*QuotaGuard) CheckAccess added in v1.1.0

func (g *QuotaGuard) CheckAccess(policies []store.Policy, userToken uaa_client.CheckTokenResponse) (bool, error)

type TagsIndex

type TagsIndex struct {
	Store         dataStore
	Marshaler     marshal.Marshaler
	ErrorResponse errorResponse
}

func NewTagsIndex added in v1.4.0

func NewTagsIndex(store dataStore, marshaler marshal.Marshaler, errorResponse errorResponse) *TagsIndex

func (*TagsIndex) ServeHTTP

func (h *TagsIndex) ServeHTTP(w http.ResponseWriter, req *http.Request)

type UAAClient

type UAAClient interface {
	CheckToken(token string) (uaa_client.CheckTokenResponse, error)
}

type UptimeHandler

type UptimeHandler struct {
	StartTime time.Time
}

func (*UptimeHandler) ServeHTTP

func (h *UptimeHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type WhoAmIHandler

type WhoAmIHandler struct {
	Marshaler     marshal.Marshaler
	ErrorResponse errorResponse
}

func (*WhoAmIHandler) ServeHTTP

func (h *WhoAmIHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type WhoAmIResponse

type WhoAmIResponse struct {
	UserName string `json:"user_name"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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