opa

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package opa manages the Open Policy Agent. see https://www.openpolicyagent.org/docs/edge/integration/#integrating-with-the-go-api

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyFilename = errors.New("OPA: missing filename")

Functions

func Load

func Load(filenames []string) (*ast.Compiler, error)

Load check the Rego filenames and loads them to build the OPA compiler.

Types

type Policy

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

func New

func New(filenames []string, resErr reserr.ResErr) (Policy, error)

New creates a new Policy by loading rego files.

func (Policy) Auth

func (opa Policy) Auth(next http.Handler) http.Handler

Auth is the HTTP middleware to check endpoint authorization.

Jump to

Keyboard shortcuts

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