trireme-lib: Index | Files

package urisearch

import ""


Package Files


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

func (*APICache) MatchClaims Uses

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.

Package urisearch imports 1 packages (graph) and is imported by 6 packages. Updated 2019-01-23. Refresh now. Tools for package owners.