policy

package
v6.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package policy is a generated GoMock package.

Index

Constants

View Source
const ModuleName = "policy"

ModuleName is the name of the policy module

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func FlagSet

func FlagSet() *pflag.FlagSet

FlagSet contains flags relevant for policy

Types

type Config

type Config struct {
	// Directory is the directory where the policy files are stored
	// policy files include a scope to presentation definition mapping
	Directory string `koanf:"directory"`
}

type LocalPDP

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

LocalPDP is a backend for presentation definitions It loads a file with the mapping from oauth scope to PEX Policy. It allows access when the requester can present a submission according to the Presentation Definition.

func New

func New() *LocalPDP

New creates a new local policy backend

func (*LocalPDP) Config

func (b *LocalPDP) Config() interface{}

func (*LocalPDP) Configure

func (b *LocalPDP) Configure(_ core.ServerConfig) error

func (*LocalPDP) Name

func (b *LocalPDP) Name() string

func (*LocalPDP) PresentationDefinitions

func (b *LocalPDP) PresentationDefinitions(_ context.Context, scope string) (pe.WalletOwnerMapping, error)

type MockPDPBackend

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

MockPDPBackend is a mock of PDPBackend interface.

func NewMockPDPBackend

func NewMockPDPBackend(ctrl *gomock.Controller) *MockPDPBackend

NewMockPDPBackend creates a new mock instance.

func (*MockPDPBackend) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPDPBackend) PresentationDefinitions

func (m *MockPDPBackend) PresentationDefinitions(ctx context.Context, scope string) (pe.WalletOwnerMapping, error)

PresentationDefinitions mocks base method.

type MockPDPBackendMockRecorder

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

MockPDPBackendMockRecorder is the mock recorder for MockPDPBackend.

func (*MockPDPBackendMockRecorder) PresentationDefinitions

func (mr *MockPDPBackendMockRecorder) PresentationDefinitions(ctx, scope any) *gomock.Call

PresentationDefinitions indicates an expected call of PresentationDefinitions.

type PDPBackend

type PDPBackend interface {
	// PresentationDefinitions returns the PresentationDefinitions (mapped to a WalletOwnerType) for the given scope
	// scopes are space delimited. It's up to the backend to decide how to handle this
	PresentationDefinitions(ctx context.Context, scope string) (pe.WalletOwnerMapping, error)
}

PDPBackend is the interface for the policy backend Both the remote and local policy backend implement this interface

Jump to

Keyboard shortcuts

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