Documentation
¶
Index ¶
- Variables
- func DeniedMessage(principal, action, resource *fencev1.UID) string
- func UIDToString(u *fencev1.UID) string
- type CachedProvider
- type FenceAuthzError
- type FenceProvider
- type FileProvider
- type MockFenceProvider
- type MockFenceProvider_Expecter
- type MockFenceProvider_IsAllowed_Call
- func (_c *MockFenceProvider_IsAllowed_Call) Return(isAllowedResponse *fencev1.IsAllowedResponse, err error) *MockFenceProvider_IsAllowed_Call
- func (_c *MockFenceProvider_IsAllowed_Call) Run(...) *MockFenceProvider_IsAllowed_Call
- func (_c *MockFenceProvider_IsAllowed_Call) RunAndReturn(...) *MockFenceProvider_IsAllowed_Call
- type MockFenceProvider_Refresh_Call
- func (_c *MockFenceProvider_Refresh_Call) Return(err error) *MockFenceProvider_Refresh_Call
- func (_c *MockFenceProvider_Refresh_Call) Run(run func(context1 context.Context)) *MockFenceProvider_Refresh_Call
- func (_c *MockFenceProvider_Refresh_Call) RunAndReturn(run func(context1 context.Context) error) *MockFenceProvider_Refresh_Call
- type RemoteServerConfig
- type RemoteServerProvider
- type TestingProvider
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidPrincipal = errors.New("invalid principal")
)
Functions ¶
func DeniedMessage ¶
func UIDToString ¶
Types ¶
type CachedProvider ¶
type CachedProvider struct {
// contains filtered or unexported fields
}
func NewCachedProvider ¶
func NewCachedProvider(provider FenceProvider, refreshDuration time.Duration) (*CachedProvider, error)
func (*CachedProvider) IsAllowed ¶
func (cfs *CachedProvider) IsAllowed(ctx context.Context, principal, action, resource *fencev1.UID) (*fencev1.IsAllowedResponse, error)
type FenceAuthzError ¶
type FenceAuthzError struct {
// contains filtered or unexported fields
}
func NewAuthzError ¶
func NewAuthzError(principal, action, resource *fencev1.UID, internal error) FenceAuthzError
func (FenceAuthzError) Error ¶
func (az FenceAuthzError) Error() string
type FenceProvider ¶
type FileProvider ¶
type FileProvider struct {
// contains filtered or unexported fields
}
func NewFileProvider ¶
func NewFileProvider(fs afero.Fs, policyPath, entityPath string) (*FileProvider, error)
type MockFenceProvider ¶
MockFenceProvider is an autogenerated mock type for the FenceProvider type
func NewMockFenceProvider ¶
func NewMockFenceProvider(t interface {
mock.TestingT
Cleanup(func())
}) *MockFenceProvider
NewMockFenceProvider creates a new instance of MockFenceProvider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockFenceProvider) EXPECT ¶
func (_m *MockFenceProvider) EXPECT() *MockFenceProvider_Expecter
type MockFenceProvider_Expecter ¶
type MockFenceProvider_Expecter struct {
// contains filtered or unexported fields
}
func (*MockFenceProvider_Expecter) IsAllowed ¶
func (_e *MockFenceProvider_Expecter) IsAllowed(ctx interface{}, principal interface{}, action interface{}, resource interface{}) *MockFenceProvider_IsAllowed_Call
IsAllowed is a helper method to define mock.On call
- ctx context.Context
- principal *fencev1.UID
- action *fencev1.UID
- resource *fencev1.UID
func (*MockFenceProvider_Expecter) Refresh ¶
func (_e *MockFenceProvider_Expecter) Refresh(context1 interface{}) *MockFenceProvider_Refresh_Call
Refresh is a helper method to define mock.On call
- context1 context.Context
type MockFenceProvider_IsAllowed_Call ¶
MockFenceProvider_IsAllowed_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsAllowed'
func (*MockFenceProvider_IsAllowed_Call) Return ¶
func (_c *MockFenceProvider_IsAllowed_Call) Return(isAllowedResponse *fencev1.IsAllowedResponse, err error) *MockFenceProvider_IsAllowed_Call
func (*MockFenceProvider_IsAllowed_Call) Run ¶
func (_c *MockFenceProvider_IsAllowed_Call) Run(run func(ctx context.Context, principal *fencev1.UID, action *fencev1.UID, resource *fencev1.UID)) *MockFenceProvider_IsAllowed_Call
func (*MockFenceProvider_IsAllowed_Call) RunAndReturn ¶
func (_c *MockFenceProvider_IsAllowed_Call) RunAndReturn(run func(ctx context.Context, principal *fencev1.UID, action *fencev1.UID, resource *fencev1.UID) (*fencev1.IsAllowedResponse, error)) *MockFenceProvider_IsAllowed_Call
type MockFenceProvider_Refresh_Call ¶
MockFenceProvider_Refresh_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Refresh'
func (*MockFenceProvider_Refresh_Call) Return ¶
func (_c *MockFenceProvider_Refresh_Call) Return(err error) *MockFenceProvider_Refresh_Call
func (*MockFenceProvider_Refresh_Call) Run ¶
func (_c *MockFenceProvider_Refresh_Call) Run(run func(context1 context.Context)) *MockFenceProvider_Refresh_Call
func (*MockFenceProvider_Refresh_Call) RunAndReturn ¶
func (_c *MockFenceProvider_Refresh_Call) RunAndReturn(run func(context1 context.Context) error) *MockFenceProvider_Refresh_Call
type RemoteServerConfig ¶
type RemoteServerProvider ¶
type RemoteServerProvider struct {
// contains filtered or unexported fields
}
func NewRemoteServerProvider ¶
func NewRemoteServerProvider(cfg RemoteServerConfig) *RemoteServerProvider
type TestingProvider ¶
type TestingProvider struct {
AllowCall bool
}
func (*TestingProvider) IsAllowed ¶
func (ts *TestingProvider) IsAllowed(ctx context.Context, principal, action, resource *fencev1.UID) (*fencev1.IsAllowedResponse, error)
Click to show internal directories.
Click to hide internal directories.