auth

package
v0.0.0-...-ce9dbdb Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package auth handles authorizing HTTP requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New() *Server

New creates a new evaluation engine. It is safe to use all operations concurrently from multiple goroutines.

func (*Server) AddData

func (s *Server) AddData(ctx context.Context, rawPath string, value interface{}) error

AddData adds or replaces data used to make policy decisions.

func (*Server) Eval

func (s *Server) Eval(ctx context.Context, input interface{}) (bool, error)

Eval returns an authorization decision based on the input, policy, and stored data. An error indicates a technical problem evaluting the policy. The result is only valid if an error did not occur.

func (*Server) LoadPolicy

func (s *Server) LoadPolicy(ctx context.Context, code string) error

LoadPolicy replaces the authorization policy with the provided rego code.

Jump to

Keyboard shortcuts

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