store

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 13 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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

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

func (*MockCacheClient) ListPolicies

ListPolicies mocks base method.

func (*MockCacheClient) ListSecrets

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

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.

func (*Store) GetSecret

func (s *Store) GetSecret(key string) (*pb.SecretInfo, error)

GetSecret return secret detail for the given key.

func (*Store) Reload

func (s *Store) Reload() error

Reload reload secrets and policies.

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.

Directories

Path Synopsis
Package load loads pump plugins.
Package load loads pump plugins.

Jump to

Keyboard shortcuts

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