urisearch

package
v10.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

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

type APIStore

type APIStore struct {
	Scopes     map[string][]string
	RegEx      *regexp.Regexp
	RegExNames []string
}

APIStore is a database of API rules.

func NewAPIStore

func NewAPIStore(rules []*policy.HTTPRule) (*APIStore, error)

NewAPIStore creates a database of API rules based on the provided list.

func (*APIStore) Find

func (a *APIStore) Find(verb, api string) ([]string, error)

Find finds an API call in the database.

Jump to

Keyboard shortcuts

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