trireme-lib: Index | Files

package urisearch

import ""


Package Files

uriregex.go urisearch.go

type APICache Uses

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

APICache represents an API cache.

func NewAPICache Uses

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

NewAPICache creates a new API cache

func (*APICache) Find Uses

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 Uses

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 Uses

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

FindRule finds a rule in the APICache without validating scopes

type APIStore Uses

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

APIStore is a database of API rules.

func NewAPIStore Uses

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

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

func (*APIStore) Find Uses

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

Find finds an API call in the database.

Package urisearch imports 4 packages (graph) and is imported by 6 packages. Updated 2018-11-15. Refresh now. Tools for package owners.