urisearch

package
v10.358.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICache

type APICache struct {
	ID       string
	External bool
	// contains filtered or unexported fields
}

APICache represents an API cache.

func NewAPICache

func NewAPICache(rules []*policy.HTTPRule, id string, external bool) *APICache

NewAPICache creates a new API cache

func (*APICache) Find

func (c *APICache) Find(verb, uri string) (bool, interface{})

Find finds a URI in the cache and returns true and the data if found. If not found it returns false.

func (*APICache) FindAndMatchScope

func (c *APICache) FindAndMatchScope(verb, uri string, attributes []string) (bool, bool)

FindAndMatchScope finds the rule and returns true only if the scope matches as well. It also returns true of this was a public rule, allowing the callers to decide how to present the data or potentially what to do if authorization fails.

func (*APICache) FindRule

func (c *APICache) FindRule(verb, uri string) (bool, *policy.HTTPRule)

FindRule finds a rule in the APICache without validating scopes

func (*APICache) MatchClaims

func (c *APICache) MatchClaims(rules [][]string, claims []string) bool

MatchClaims receives a set of claim matchibg rules and a set of claims and returns true of the claims match the rules.

Jump to

Keyboard shortcuts

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