Documentation
¶
Overview ¶
Package policy is a generated GoMock package.
Index ¶
Constants ¶
const ModuleName = "policy"
ModuleName is the name of the policy module
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
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 (*LocalPDP) PresentationDefinitions ¶
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 ¶
func (m *MockPDPBackend) EXPECT() *MockPDPBackendMockRecorder
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