opa

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 21 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(logger logger.Logger) middleware.Middleware

NewMiddleware returns a new Open Policy Agent middleware.

Types

type Middleware

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

Middleware is an OPA middleware.

func (*Middleware) GetComponentMetadata added in v1.11.0

func (m *Middleware) GetComponentMetadata() (metadataInfo contribMetadata.MetadataMap)

func (*Middleware) GetHandler

func (m *Middleware) GetHandler(parentCtx context.Context, metadata middleware.Metadata) (func(next http.Handler) http.Handler, error)

GetHandler returns the HTTP handler provided by the middleware.

type RegoResult

type RegoResult struct {
	Allow             bool              `json:"allow"`
	AdditionalHeaders map[string]string `json:"additional_headers,omitempty"`
	StatusCode        int               `json:"status_code,omitempty"`
}

RegoResult is the expected result from rego policy.

type Status added in v1.5.0

type Status int

func (*Status) UnmarshalJSON added in v1.5.0

func (s *Status) UnmarshalJSON(b []byte) error

func (*Status) Valid added in v1.5.0

func (s *Status) Valid() bool

Check status is in the correct range for RFC 2616 status codes [100-599].

Jump to

Keyboard shortcuts

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