Documentation
¶
Index ¶
- Constants
- Variables
- func Metrics() []xmetrics.Metric
- func NewCapabilityChecker(m *AuthCapabilityCheckMeasures, prefix string, acceptAllMethod string, ...) (*capabilityCheck, error)
- func NewCapabilityCheckerFromStrings(m *AuthCapabilityCheckMeasures, prefix string, acceptAllMethod string, ...) (*capabilityCheck, error)
- func ProvideMetrics() fx.Option
- type AuthCapabilityCheckMeasures
Constants ¶
View Source
const ( CapabilityKey = "capabilities" PartnerKey = "allowedResources.allowedPartners" )
View Source
const ( OutcomeLabel = "outcome" ReasonLabel = "reason" ClientIDLabel = "clientid" EndpointLabel = "endpoint" PartnerIDLabel = "partnerid" )
labels
View Source
const ( RejectedOutcome = "rejected" AcceptedOutcome = "accepted" // reasons TokenMissing = "auth_missing" UndeterminedPartnerID = "undetermined_partner_ID" UndeterminedCapabilities = "undetermined_capabilities" EmptyCapabilitiesList = "empty_capabilities_list" NoCapabilitiesMatch = "no_capabilities_match" )
outcomes
View Source
const (
AuthCapabilityCheckOutcome = "auth_capability_check"
)
Names for our metrics
Variables ¶
View Source
var ( ErrNoVals = errors.New("expected at least one value") ErrNoAuth = errors.New("couldn't get request info: authorization not found") ErrNonstringVal = errors.New("expected value to be a string") ErrNoValidCapabilityFound = errors.New("no valid capability for endpoint") ErrNilAttributes = fmt.Errorf("nil attributes interface") )
Functions ¶
func NewCapabilityChecker ¶ added in v1.6.2
func NewCapabilityChecker(m *AuthCapabilityCheckMeasures, prefix string, acceptAllMethod string, endpoints []*regexp.Regexp) (*capabilityCheck, error)
NewCapabilityChecker creates an object that produces a check on capabilities in bascule tokens, to be run by the bascule enforcer middleware.
func NewCapabilityCheckerFromStrings ¶ added in v1.10.2
func NewCapabilityCheckerFromStrings(m *AuthCapabilityCheckMeasures, prefix string, acceptAllMethod string, endpoints []string, logger log.Logger) (*capabilityCheck, error)
NewCapabilityCheckerFromStrings creates the capability checker, and allows consumers to provide a list of string endpoints to be compiled into regular expressions. Only expressions that compile successfully are included in the checker.
func ProvideMetrics ¶ added in v1.10.2
Types ¶
type AuthCapabilityCheckMeasures ¶ added in v1.6.2
type AuthCapabilityCheckMeasures struct {
fx.In
CapabilityCheckOutcome metrics.Counter `name:"auth_capability_check"`
}
AuthCapabilityCheckMeasures describes the defined metrics that will be used by clients
func NewAuthCapabilityCheckMeasures ¶ added in v1.6.2
func NewAuthCapabilityCheckMeasures(p provider.Provider) *AuthCapabilityCheckMeasures
NewAuthCapabilityCheckMeasures realizes desired metrics
Click to show internal directories.
Click to hide internal directories.