filters

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 27 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ForceDeleteFilterName                = "ForceDeleteValidationFilter"
	FailOnNotAllowedUrlDescription       = "Couldn't delete this resource. You can only force-delete instances or bindings."
	FailOnBadFlagsCombinationDescription = "" /* 144-byte string literal not displayed */
)
View Source
const (
	RegeneratePlatformCredentialsFilterName = "RegeneratePlatformCredentialsFilter"
	RegenerateCredentialsQueryParam         = "regenerateCredentials"
)
View Source
const BearerAuthnFilterName string = "BearerAuthnFilter"

BearerAuthnFilterName is the name of the bearer authentication filter

View Source
const BrokersVisibilityFilterName = "BrokersFilterByVisibility"
View Source
const (
	CheckBrokerCredentialsFilterName = "CheckBrokerCredentialsFilter"
)
View Source
const CheckPlatformSuspendedFilterName = "CheckPlatformSuspendedFilter"
View Source
const (
	// ContextTimeoutFilterName is the name of the logging filter
	ContextTimeoutFilterName = "ContextTimeoutFilter"
)
View Source
const (
	// CriteriaFilterName is the name of the criteria filter
	CriteriaFilterName = "CriteriaFilter"
)
View Source
const DisabledQueryParametersName = "DisabledQueryParameter"
View Source
const ExtractPlanIDByServiceAndPlanName = "ExtractPlanIDByServiceAndPlanName"
View Source
const LabelCriteriaFilterNameSuffix = "CriteriaFilter"
View Source
const LabelName = "Tenant"

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

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 (
	PlatformIDInstanceValidationFilterName = "PlatformIDInstanceValidationFilter"
)
View Source
const (
	PlatformTerminationFilterName = "PlatformTerminationFilter"
)
View Source
const ProtectedLabelsFilterName = "ProtectedLabelsFilter"
View Source
const ProtectedSMPlatformFilterName = "ProtectedSMPlatformFilter"
View Source
const ReferenceInstanceFilterName = "ReferenceInstanceFilter"
View Source
const ResourceLabelingFilterNameSuffix = "LabelingFilter"
View Source
const ServiceBindingStripFilterName = "ServiceBindingStripFilter"
View Source
const ServiceBindingVisibilityFilterName = "ServiceBindingVisibilityFilter"
View Source
const ServiceInstanceStripFilterName = "ServiceInstanceStripFilter"
View Source
const ServiceInstanceTransferFilterName = "ServiceInstanceTransferFilter"
View Source
const ServiceInstanceVisibilityFilterName = "ServiceInstanceVisibilityFilter"
View Source
const ServicesVisibilityFilterName = "ServicesFilterByVisibility"
View Source
const SharedInstanceUpdateFilterName = "SharedInstanceUpdateFilter"
View Source
const (
	SupportedEncodingsFilterName = "SupportedEncodingsFilter"
)
View Source
const (
	TechnicalPlatformFilterName = "TechnicalPlatformFilter"
)

Variables

This section is empty.

Functions

func NewContextTimeoutFilter added in v0.19.2

func NewContextTimeoutFilter(timeout time.Duration) *contextTimeout

func NewExtractPlanIDByServiceAndPlanNameFilter added in v0.19.0

func NewExtractPlanIDByServiceAndPlanNameFilter(repository storage.Repository, getVisibilityMetadata func(req *web.Request, repository storage.Repository) (*VisibilityMetadata, error)) *extractPlanIDByServiceAndPlanNameFilter

NewExtractPlanIDByServiceAndPlanNameFilter creates a new extractPlanIDByServiceAndPlanNameFilter filter

func NewLabelingFilters added in v0.13.0

func NewLabelingFilters(labelName, labelKey string, basePaths []string, extractValueFunc func(request *web.Request) (string, error)) []web.Filter

NewLabelingFilters returns set of filters which applies resource labeling rules

func NewMultitenancyFilters added in v0.4.1

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

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 NewPlatformTerminationFilter added in v0.16.11

func NewPlatformTerminationFilter(repository storage.Repository) *platformTerminationFilter

func NewRecoveryMiddleware

func NewRecoveryMiddleware() mux.MiddlewareFunc

NewRecoveryMiddleware returns a standard mux middleware that provides panic recovery

func NewReferenceInstanceFilter added in v0.19.5

func NewReferenceInstanceFilter(repository storage.TransactionalRepository, tenantIdentifier string) *referenceInstanceFilter

func NewServiceBindingVisibilityFilter added in v0.10.0

func NewServiceBindingVisibilityFilter(repository storage.Repository, tenantIdentifier string) *serviceBindingVisibilityFilter

NewServiceBindingVisibilityFilter creates a new serviceInstanceVisibilityFilter filter

func NewServiceInstanceTransferFilter added in v0.13.0

func NewServiceInstanceTransferFilter(repository storage.Repository, enableInstanceTransfer bool) *serviceInstanceTransferFilter

func NewServiceInstanceVisibilityFilter added in v0.10.0

func NewServiceInstanceVisibilityFilter(repository storage.Repository, getInstanceVisibilityMetadata func(req *web.Request, repository storage.Repository) (*VisibilityMetadata, error)) *serviceInstanceVisibilityFilter

NewServiceInstanceVisibilityFilter creates a new serviceInstanceVisibilityFilter filter

func NewSharedInstanceUpdateFilter added in v0.19.5

func NewSharedInstanceUpdateFilter(storageRepository storage.Repository) *sharedInstanceUpdateFilter

func TenantLabelingFilterName added in v0.4.1

func TenantLabelingFilterName() string

TenantLabelingFilterName returns the name of the filter that is adding the tenant label to tenant-scoped resources

Types

type BrokersFilterByVisibility added in v0.16.8

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

func NewBrokersFilterByVisibility added in v0.16.8

func NewBrokersFilterByVisibility(repository storage.Repository) *BrokersFilterByVisibility

func (*BrokersFilterByVisibility) FilterMatchers added in v0.16.8

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

func (*BrokersFilterByVisibility) Name added in v0.16.8

func (vf *BrokersFilterByVisibility) Name() string

func (BrokersFilterByVisibility) Run added in v0.16.8

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

type CheckBrokerCredentialsFilter added in v0.9.10

type CheckBrokerCredentialsFilter struct {
}

CheckBrokerCredentialsFilter checks patch request for the broker basic credentials

func (*CheckBrokerCredentialsFilter) FilterMatchers added in v0.9.10

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

func (*CheckBrokerCredentialsFilter) Name added in v0.9.10

func (*CheckBrokerCredentialsFilter) Run added in v0.9.10

type CheckPlatformSuspendedFilter added in v0.19.0

type CheckPlatformSuspendedFilter struct {
}

ServiceBindingStripFilter checks post request body for unmodifiable properties

func (*CheckPlatformSuspendedFilter) FilterMatchers added in v0.19.0

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

func (*CheckPlatformSuspendedFilter) Name added in v0.19.0

func (*CheckPlatformSuspendedFilter) Run added in v0.19.0

type DisabledQueryParametersFilter added in v0.19.0

type DisabledQueryParametersFilter struct {
	DisabledQueryParameters []string
}

func (*DisabledQueryParametersFilter) FilterMatchers added in v0.19.0

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

func (*DisabledQueryParametersFilter) Name added in v0.19.0

func (*DisabledQueryParametersFilter) Run added in v0.19.0

type ForceDeleteValidationFilter added in v0.17.2

type ForceDeleteValidationFilter struct {
}

func (*ForceDeleteValidationFilter) FilterMatchers added in v0.17.2

func (s *ForceDeleteValidationFilter) FilterMatchers() []web.FilterMatcher

func (*ForceDeleteValidationFilter) Name added in v0.17.2

func (*ForceDeleteValidationFilter) Run added in v0.17.2

func (s *ForceDeleteValidationFilter) Run(request *web.Request, next web.Handler) (*web.Response, error)

type LabelingFilter added in v0.13.0

type LabelingFilter struct {
	// LabelKey is the key of the label
	LabelKey     string
	ExtractValue func(request *web.Request) (string, error)
	LabelingFunc func(request *web.Request, labelKey, labelValue string) error

	FilterName string
	BasePaths  []string
	Methods    []string
}

LabelingFilter applies labeling on the resources based on extracted values

func (*LabelingFilter) FilterMatchers added in v0.13.0

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

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

func (*LabelingFilter) Name added in v0.13.0

func (f *LabelingFilter) Name() string

Name implements web.Named and returns the filter name

func (*LabelingFilter) Run added in v0.13.0

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

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

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 PlatformIDInstanceValidationFilter added in v0.13.0

type PlatformIDInstanceValidationFilter struct {
}

PlatformIDInstanceValidationFilter ensures that if a platform is provided for provisioning request that it's the SM Platform. It also limits Patch and Delete requests to instances created in the SM platform. In addition PATCH requests that transfer instances to SM platform are also allowed.

func (*PlatformIDInstanceValidationFilter) FilterMatchers added in v0.13.0

func (*PlatformIDInstanceValidationFilter) Name added in v0.13.0

func (*PlatformIDInstanceValidationFilter) Run added in v0.13.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 ProtectedSMPlatformFilter added in v0.10.0

type ProtectedSMPlatformFilter struct {
}

ProtectedSMPlatformFilter disallows patching and deleting of the service manager platform

func (*ProtectedSMPlatformFilter) FilterMatchers added in v0.10.0

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

func (*ProtectedSMPlatformFilter) Name added in v0.10.0

func (*ProtectedSMPlatformFilter) Run added in v0.10.0

type RateLimiterFilter added in v0.16.11

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

func NewRateLimiterFilter added in v0.16.11

func NewRateLimiterFilter(middleware []RateLimiterMiddleware, excludeClients, excludePaths []string, usageLogThreshold int64, tenantLabelKey string) *RateLimiterFilter

func (*RateLimiterFilter) FilterMatchers added in v0.16.11

func (rl *RateLimiterFilter) FilterMatchers() []web.FilterMatcher

func (*RateLimiterFilter) Name added in v0.16.11

func (rl *RateLimiterFilter) Name() string

func (*RateLimiterFilter) Run added in v0.16.11

func (rl *RateLimiterFilter) Run(request *web.Request, next web.Handler) (*web.Response, error)

type RateLimiterMiddleware added in v0.17.2

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

func NewRateLimiterMiddleware added in v0.17.2

func NewRateLimiterMiddleware(middleware *stdlib.Middleware, pathPrefix string, method string, rate limiter.Rate) RateLimiterMiddleware

type RegeneratePlatformCredentialsFilter added in v0.16.10

type RegeneratePlatformCredentialsFilter struct {
}

RegeneratePlatformCredentialsFilter checks if regenerate credentials for platform was required

func (*RegeneratePlatformCredentialsFilter) FilterMatchers added in v0.16.10

func (*RegeneratePlatformCredentialsFilter) Name added in v0.16.10

func (*RegeneratePlatformCredentialsFilter) Run added in v0.16.10

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 ServiceBindingStripFilter added in v0.10.0

type ServiceBindingStripFilter struct {
}

ServiceBindingStripFilter checks post request body for unmodifiable properties

func (*ServiceBindingStripFilter) FilterMatchers added in v0.10.0

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

func (*ServiceBindingStripFilter) Name added in v0.10.0

func (*ServiceBindingStripFilter) Run added in v0.10.0

type ServiceInstanceStripFilter added in v0.10.0

type ServiceInstanceStripFilter struct {
}

ServiceInstanceStripFilter checks post/patch request body for unmodifiable properties

func (*ServiceInstanceStripFilter) FilterMatchers added in v0.10.0

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

func (*ServiceInstanceStripFilter) Name added in v0.10.0

func (*ServiceInstanceStripFilter) Run added in v0.10.0

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 SupportedEncodingsFilter added in v0.11.0

type SupportedEncodingsFilter struct {
}

func (*SupportedEncodingsFilter) FilterMatchers added in v0.11.0

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

func (*SupportedEncodingsFilter) Name added in v0.11.0

func (*SupportedEncodingsFilter) Run added in v0.11.0

* Allow to proxy only SM supported osb encodings (Identity/none are currently allowed)

type TechnicalPlatformFilter added in v0.18.2

type TechnicalPlatformFilter struct {
	Storage storage.Repository
}

PlatformFilter filters out technical platforms and marks it as active on creation

func (*TechnicalPlatformFilter) FilterMatchers added in v0.18.2

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

func (*TechnicalPlatformFilter) Name added in v0.18.2

func (f *TechnicalPlatformFilter) Name() string

func (*TechnicalPlatformFilter) Run added in v0.18.2

type VisibilityMetadata added in v0.13.4

type VisibilityMetadata struct {
	PlatformID   string
	PlatformType string
	LabelKey     string
	LabelValue   string
}

VisibilityMetadata contains metadata required for visibility checks

Jump to

Keyboard shortcuts

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