zedcache

package module
v0.0.0-...-746e214 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

zedcache

A transparent cache for authzed's zedtokens.

Motivation

To boost performance while still avoiding security pitfalls like the New Enemy Problem authzed requires the use of zedtokens. zedtokens are supposed to be saved along the resource itself, forcing developers to create new database rows. zedcache tries to transparently cache zedtokens and boost performance.

Cache

The kind of cache used is crucial. An inconsistent cache can lead to the New Enemy Problem.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *authzed.Client, ca cache.Cache, opts ...Option) *authzed.Client

New is a helper function to add a cache to the authzed.Client's PermissionsServiceClient implementation.

func NewPermissionServiceClient

func NewPermissionServiceClient(c pb.PermissionsServiceClient, ca cache.Cache, opts ...Option) pb.PermissionsServiceClient

NewPermissionServiceClient add a cache to the given PermissionsServiceClient. Note that unlike the original interface the default Consistency is FullyConsistent.

Types

type Option

type Option func(*permissionClient)

Options allows to pass extra options to the PermissionsServiceClient implementation.

func WithLogger

func WithLogger(l log.Logger) Option

WithLogger can overwrite the default Noop logger. The logger implements "github.com/go-kit/log"'s Logger interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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