decisionsupport

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

README

Hexa Policy-OPA Decision Support Middleware

This package is a middleware component that can be installed to call the HexaOPA PDP for decisions.

Documentation

Overview

Package decisionsupport provides a Middleware function for integrating the hexa opa provider (OpaDecisionProvider).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecisionProvider

type DecisionProvider interface {
	BuildInput(r *http.Request, actionUris []string, resourceUris []string) (any interface{}, err error)
	Allow(any interface{}) (bool, error)
}

type DecisionSupport

type DecisionSupport struct {
	Provider     DecisionProvider
	Unauthorized http.HandlerFunc
	Skip         []string
	ActionMap    map[string]string // ActionMap converts a path into an actionUri (map[path]=uri value
	ResourceMap  map[string]string // ResourceMap converts a path into an resourceUri (map[path]=uri value
	ResourceId   string            // ResourceId if set is passed as part of buildInput overriding ResourceMap
}

func (*DecisionSupport) Middleware

func (d *DecisionSupport) Middleware(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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