Documentation ¶
Overview ¶
Package store defines the storage interface for authzserver.
Package store is a generated GoMock package.
Package store is a generated GoMock package.
Index ¶
- Variables
- type GRPCClient
- type MockCacheClient
- func (m *MockCacheClient) EXPECT() *MockCacheClientMockRecorder
- func (m *MockCacheClient) ListPolicies(arg0 context.Context, arg1 *v1.ListPoliciesRequest, arg2 ...grpc.CallOption) (*v1.ListPoliciesResponse, error)
- func (m *MockCacheClient) ListSecrets(arg0 context.Context, arg1 *v1.ListSecretsRequest, arg2 ...grpc.CallOption) (*v1.ListSecretsResponse, error)
- type MockCacheClientMockRecorder
- type MockStoreClient
- type MockStoreClientMockRecorder
- type Store
- type StoreClient
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSecretNotFound defines secret not found error. ErrSecretNotFound = errors.New("secret not found") // ErrPolicyNotFound defines policy not found error. ErrPolicyNotFound = errors.New("policy not found") )
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient defines a grpc client used to get all secrets and policies.
func (*GRPCClient) GetPolicies ¶
func (c *GRPCClient) GetPolicies() (map[string][]*ladon.DefaultPolicy, error)
GetPolicies returns all the authorization policies.
func (*GRPCClient) GetSecrets ¶
func (c *GRPCClient) GetSecrets() (map[string]*pb.SecretInfo, error)
GetSecrets returns all the authorization secrets.
type MockCacheClient ¶
type MockCacheClient struct {
// contains filtered or unexported fields
}
MockCacheClient is a mock of CacheClient interface.
func NewMockCacheClient ¶
func NewMockCacheClient(ctrl *gomock.Controller) *MockCacheClient
NewMockCacheClient creates a new mock instance.
func (*MockCacheClient) EXPECT ¶
func (m *MockCacheClient) EXPECT() *MockCacheClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCacheClient) ListPolicies ¶
func (m *MockCacheClient) ListPolicies(arg0 context.Context, arg1 *v1.ListPoliciesRequest, arg2 ...grpc.CallOption) (*v1.ListPoliciesResponse, error)
ListPolicies mocks base method.
func (*MockCacheClient) ListSecrets ¶
func (m *MockCacheClient) ListSecrets(arg0 context.Context, arg1 *v1.ListSecretsRequest, arg2 ...grpc.CallOption) (*v1.ListSecretsResponse, error)
ListSecrets mocks base method.
type MockCacheClientMockRecorder ¶
type MockCacheClientMockRecorder struct {
// contains filtered or unexported fields
}
MockCacheClientMockRecorder is the mock recorder for MockCacheClient.
func (*MockCacheClientMockRecorder) ListPolicies ¶
func (mr *MockCacheClientMockRecorder) ListPolicies(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
ListPolicies indicates an expected call of ListPolicies.
func (*MockCacheClientMockRecorder) ListSecrets ¶
func (mr *MockCacheClientMockRecorder) ListSecrets(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call
ListSecrets indicates an expected call of ListSecrets.
type MockStoreClient ¶
type MockStoreClient struct {
// contains filtered or unexported fields
}
MockStoreClient is a mock of StoreClient interface.
func NewMockStoreClient ¶
func NewMockStoreClient(ctrl *gomock.Controller) *MockStoreClient
NewMockStoreClient creates a new mock instance.
func (*MockStoreClient) EXPECT ¶
func (m *MockStoreClient) EXPECT() *MockStoreClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStoreClient) GetPolicies ¶
func (m *MockStoreClient) GetPolicies() (map[string][]*ladon.DefaultPolicy, error)
GetPolicies mocks base method.
func (*MockStoreClient) GetSecrets ¶
func (m *MockStoreClient) GetSecrets() (map[string]*v1.SecretInfo, error)
GetSecrets mocks base method.
type MockStoreClientMockRecorder ¶
type MockStoreClientMockRecorder struct {
// contains filtered or unexported fields
}
MockStoreClientMockRecorder is the mock recorder for MockStoreClient.
func (*MockStoreClientMockRecorder) GetPolicies ¶
func (mr *MockStoreClientMockRecorder) GetPolicies() *gomock.Call
GetPolicies indicates an expected call of GetPolicies.
func (*MockStoreClientMockRecorder) GetSecrets ¶
func (mr *MockStoreClientMockRecorder) GetSecrets() *gomock.Call
GetSecrets indicates an expected call of GetSecrets.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is used to store secrets and policies.
func GetStoreInsOr ¶
func GetStoreInsOr(cli StoreClient) (*Store, error)
GetStoreInsOr return store instance.
func (*Store) GetPolicy ¶
func (s *Store) GetPolicy(key string) ([]*ladon.DefaultPolicy, error)
GetPolicy return user's ladon policies for the given user.
type StoreClient ¶
type StoreClient interface { GetSecrets() (map[string]*pb.SecretInfo, error) GetPolicies() (map[string][]*ladon.DefaultPolicy, error) }
StoreClient defines functions used to get all secrets and policies.
func GetGRPCClientOrDie ¶
func GetGRPCClientOrDie(address string, clientCA string) StoreClient
GetGRPCClientOrDie return cache instance and panics on any error.