filters

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2019 License: Apache-2.0, BSD-3-Clause, MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const BasicAuthnFilterName string = "BasicAuthnFilter"
View Source
const BearerAuthnFilterName string = "BearerAuthnFilter"

BearerAuthnFilterName is the name of the bearer authentication filter

View Source
const (
	// CriteriaFilterName is the name of the criteria filter
	CriteriaFilterName = "CriteriaFilter"
)
View Source
const (
	// LoggingFilterName is the name of the logging filter
	LoggingFilterName = "LoggingFilter"
)
View Source
const PatchOnlyLabelsFilterName = "PatchOnlyLabelsFilter"
View Source
const PlanVisibilityFilterName = "PlanFilterByVisibility"
View Source
const PlatformAwareVisibilityFilterName = "PlatformAwareVisibilityFilter"
View Source
const ProtectedLabelsFilterName = "ProtectedLabelsFilter"
View Source
const ServicesVisibilityFilterName = "ServicesFilterByVisibility"
View Source
const TenantCriteriaFilterName = "TenantCriteriaFilter"

sm-dev adopt and add new config properties in the dev en

View Source
const TenantLabelingFilterName = "TenantLabelingFilter"

Variables

This section is empty.

Functions

func NewBasicAuthnFilter added in v0.3.3

func NewBasicAuthnFilter(repository storage.Repository) *filters.AuthenticationFilter

func NewMultitenancyFilters added in v0.4.1

func NewMultitenancyFilters(labelKey string, extractTenantFunc func(request *web.Request) (string, error)) []web.Filter

NewMultitenancyFilters returns set of filters which applies multitenancy rules

func NewOIDCAuthnFilter added in v0.3.3

func NewOIDCAuthnFilter(ctx context.Context, tokenIssuer, clientID string) (*filters.AuthenticationFilter, error)

NewOIDCAuthnFilter returns a web.Filter for Bearer authentication

func NewRecoveryMiddleware

func NewRecoveryMiddleware() mux.MiddlewareFunc

NewRecoveryMiddleware returns a standard mux middleware that provides panic recovery

Types

type BasicAuthenticator added in v0.4.1

type BasicAuthenticator struct {
	Repository storage.Repository
}

BasicAuthenticator for basic security

func (*BasicAuthenticator) Authenticate added in v0.4.1

func (a *BasicAuthenticator) Authenticate(request *http.Request) (*web.UserContext, httpsec.Decision, error)

Authenticate authenticates by using the provided Basic credentials

type Logging

type Logging struct {
}

Logging is filter that configures logging per request.

func (*Logging) FilterMatchers

func (*Logging) FilterMatchers() []web.FilterMatcher

FilterMatchers implements the web.Filter interface and returns the conditions on which the filter should be executed.

func (*Logging) Name

func (*Logging) Name() string

Name implements the web.Filter interface and returns the identifier of the filter.

func (*Logging) Run

func (l *Logging) Run(req *web.Request, next web.Handler) (*web.Response, error)

Run represents the logging middleware function that processes the request and configures the request-scoped logging.

type PatchOnlyLabelsFilter added in v0.3.3

type PatchOnlyLabelsFilter struct {
}

PatchOnlyLabelsFilter checks patch request for service offerings and plans include only label changes

func (*PatchOnlyLabelsFilter) FilterMatchers added in v0.3.3

func (*PatchOnlyLabelsFilter) FilterMatchers() []web.FilterMatcher

func (*PatchOnlyLabelsFilter) Name added in v0.3.3

func (*PatchOnlyLabelsFilter) Name() string

func (*PatchOnlyLabelsFilter) Run added in v0.3.3

type PlanFilterByVisibility added in v0.6.0

type PlanFilterByVisibility struct {
	// contains filtered or unexported fields
}

func NewPlansFilterByVisibility added in v0.6.0

func NewPlansFilterByVisibility(repository storage.Repository) *PlanFilterByVisibility

func (*PlanFilterByVisibility) FilterMatchers added in v0.6.0

func (vf *PlanFilterByVisibility) FilterMatchers() []web.FilterMatcher

func (*PlanFilterByVisibility) Name added in v0.6.0

func (vf *PlanFilterByVisibility) Name() string

func (PlanFilterByVisibility) Run added in v0.6.0

func (m PlanFilterByVisibility) Run(req *web.Request, next web.Handler) (*web.Response, error)

type PlatformAwareVisibilityFilter added in v0.2.0

type PlatformAwareVisibilityFilter struct {
}

func (*PlatformAwareVisibilityFilter) FilterMatchers added in v0.2.0

func (*PlatformAwareVisibilityFilter) FilterMatchers() []web.FilterMatcher

func (*PlatformAwareVisibilityFilter) Name added in v0.2.0

func (*PlatformAwareVisibilityFilter) Run added in v0.2.0

type ProtectedLabelsFilter added in v0.4.1

type ProtectedLabelsFilter struct {
	// contains filtered or unexported fields
}

ProtectedLabelsFilter checks for forbidden labels being modified/added

func NewProtectedLabelsFilter added in v0.4.1

func NewProtectedLabelsFilter(forbiddenLabels []string) *ProtectedLabelsFilter

NewProtectedLabelsFilter creates new filter for forbidden labels

func (*ProtectedLabelsFilter) FilterMatchers added in v0.4.1

func (flo *ProtectedLabelsFilter) FilterMatchers() []web.FilterMatcher

func (*ProtectedLabelsFilter) Name added in v0.4.1

func (flo *ProtectedLabelsFilter) Name() string

func (*ProtectedLabelsFilter) Run added in v0.4.1

func (flo *ProtectedLabelsFilter) Run(req *web.Request, next web.Handler) (*web.Response, error)

type SelectionCriteria added in v0.1.8

type SelectionCriteria struct {
}

SelectionCriteria is filter that configures selection criteria per request.

func (*SelectionCriteria) FilterMatchers added in v0.1.8

func (*SelectionCriteria) FilterMatchers() []web.FilterMatcher

FilterMatchers implements the web.Filter interface and returns the conditions on which the filter should be executed.

func (*SelectionCriteria) Name added in v0.1.8

func (*SelectionCriteria) Name() string

Name implements the web.Filter interface and returns the identifier of the filter.

func (*SelectionCriteria) Run added in v0.1.8

func (l *SelectionCriteria) Run(req *web.Request, next web.Handler) (*web.Response, error)

Run represents the selection criteria middleware function that processes the request and configures the request-scoped selection criteria.

type ServicesFilterByVisibility added in v0.6.0

type ServicesFilterByVisibility struct {
	// contains filtered or unexported fields
}

func NewServicesFilterByVisibility added in v0.6.0

func NewServicesFilterByVisibility(repository storage.Repository) *ServicesFilterByVisibility

func (*ServicesFilterByVisibility) FilterMatchers added in v0.6.0

func (vf *ServicesFilterByVisibility) FilterMatchers() []web.FilterMatcher

func (*ServicesFilterByVisibility) Name added in v0.6.0

func (ServicesFilterByVisibility) Run added in v0.6.0

func (m ServicesFilterByVisibility) Run(req *web.Request, next web.Handler) (*web.Response, error)

type TenantFilter added in v0.4.1

type TenantFilter struct {
	// LabelKey is the key of the label, the value of which will be used to apply multitenancy rules
	LabelKey string

	ExtractTenant func(request *web.Request) (string, error)
	LabelingFunc  func(request *web.Request, labelKey, labelValue string) error

	FilterName string
	Methods    []string
}

TenantFilter applies multitenancy labeling on the resources based on extracted tenant

func (*TenantFilter) FilterMatchers added in v0.4.1

func (f *TenantFilter) FilterMatchers() []web.FilterMatcher

FilterMatchers implements web.Filter.FilterMatchers and specifies that the filter should run on configured method

func (*TenantFilter) Name added in v0.4.1

func (f *TenantFilter) Name() string

Name implements web.Named and returns the filter name

func (*TenantFilter) Run added in v0.4.1

func (f *TenantFilter) Run(request *web.Request, next web.Handler) (*web.Response, error)

Run implements web.Middleware and attempts to extract tenant and apply labeling function

Jump to

Keyboard shortcuts

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