decisionsupportproviders

package
v0.64.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Decision Support Providers

This directory contains providers for the Demo app (Hexa Industry) to call for access decisions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProvider

type DefaultProvider struct {
}

func (DefaultProvider) Allow

func (d DefaultProvider) Allow(_ interface{}) (bool, error)

func (DefaultProvider) BuildInput

func (d DefaultProvider) BuildInput(_ *http.Request) (any interface{}, err error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MockDecisionProvider

type MockDecisionProvider struct {
	mock.Mock
	BuildErr error
	Decision bool
	AllowErr error
}

func (*MockDecisionProvider) Allow

func (m *MockDecisionProvider) Allow(_ interface{}) (bool, error)

func (*MockDecisionProvider) BuildInput

func (m *MockDecisionProvider) BuildInput(r *http.Request) (interface{}, error)

type OpaDecisionProvider

type OpaDecisionProvider struct {
	Client    HTTPClient
	Url       string
	Principal string
}

func (OpaDecisionProvider) Allow

func (o OpaDecisionProvider) Allow(any interface{}) (bool, error)

func (OpaDecisionProvider) BuildInput

func (o OpaDecisionProvider) BuildInput(r *http.Request, actionUris []string, resourceUris []string) (any interface{}, err error)

type OpaQuery

type OpaQuery struct {
	Input *opaTools.OpaInfo `json:"input"`
}

type OpaResponse

type OpaResponse struct {
	Result bool
}

Jump to

Keyboard shortcuts

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