opa

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: LGPL-3.0 Imports: 10 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

This section is empty.

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 {
	Compiler *ast.Compiler
	ResErr   reserr.ResErr
}

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.

func (Policy) Ready

func (opa Policy) Ready() bool

Ready returns true if the Policy compiler contains rules.

Jump to

Keyboard shortcuts

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