Documentation ¶
Index ¶
- Constants
- func CleanEmbeddedEtcd(etcd *embed.Etcd, etcdDir string)
- func StartEmbeddedEtcd(dataDir string) (etcd *embed.Etcd, etcdDir string, err error)
- type Etcd3StoreBuilder
- type Store
- func (s *Store) CreateFunction(function *pms.Function) (*pms.Function, error)
- func (s *Store) CreatePolicy(serviceName string, policy *pms.Policy) (*pms.Policy, error)
- func (s *Store) CreateRolePolicy(serviceName string, rolePolicy *pms.RolePolicy) (*pms.RolePolicy, error)
- func (s *Store) CreateService(service *pms.Service) error
- func (s *Store) DeleteFunction(funcName string) error
- func (s *Store) DeleteFunctions() error
- func (s *Store) DeletePolicies(serviceName string) error
- func (s *Store) DeletePolicy(serviceName string, id string) error
- func (s *Store) DeleteRequests(keys []string) error
- func (s *Store) DeleteRolePolicies(serviceName string) error
- func (s *Store) DeleteRolePolicy(serviceName string, id string) error
- func (s *Store) DeleteService(serviceName string) error
- func (s *Store) DeleteServices() error
- func (d *Store) GeneratePolicies(serviceName, principalType, principalName, principalIDD string) (map[string]*pms.Service, int64, error)
- func (s *Store) GetDiscoverRequests(serviceName string) ([]*ads.RequestContext, int64, error)
- func (s *Store) GetDiscoverRequestsSinceRevision(serviceName string, revision int64) ([]*ads.RequestContext, int64, error)
- func (s *Store) GetFunction(funcName string) (*pms.Function, error)
- func (s *Store) GetFunctionCount() (int64, error)
- func (s *Store) GetLastDiscoverRequest(serviceName string) (*ads.RequestContext, int64, error)
- func (s *Store) GetPolicies(serviceName string, startID string, amount int) (policies []*pms.Policy, nextID string, err error)
- func (s *Store) GetPolicy(serviceName string, id string) (*pms.Policy, error)
- func (s *Store) GetPolicyAndRolePolicyCounts() (map[string]*pms.PolicyAndRolePolicyCount, error)
- func (s *Store) GetPolicyCount(serviceName string) (int64, error)
- func (s *Store) GetRequests(keyPrefix string, pageSize int64) ([]*ads.RequestContext, int64, error)
- func (s *Store) GetRolePolicies(serviceName string, startID string, amount int) (policies []*pms.RolePolicy, nextID string, err error)
- func (s *Store) GetRolePolicy(serviceName string, id string) (*pms.RolePolicy, error)
- func (s *Store) GetRolePolicyCount(serviceName string) (int64, error)
- func (s *Store) GetService(serviceName string) (*pms.Service, error)
- func (s *Store) GetServiceCount() (int64, error)
- func (s *Store) GetServiceItself(serviceName string) (*pms.Service, error)
- func (s *Store) GetServiceNames() (serviceNames []string, err error)
- func (s *Store) GetServices(startName string, amount int, retrivePolcies bool) ([]*pms.Service, string, error)
- func (s *Store) ListAllFunctions(filter string) ([]*pms.Function, error)
- func (s *Store) ListAllPolicies(serviceName string, filter string) ([]*pms.Policy, error)
- func (s *Store) ListAllRolePolicies(serviceName string, filter string) ([]*pms.RolePolicy, error)
- func (s *Store) ListAllServices() (services []*pms.Service, err error)
- func (s *Store) PutRequest(request *ads.RequestContext) (int64, error)
- func (s *Store) ReadPolicyStore() (*pms.PolicyStore, error)
- func (s *Store) ResetDiscoverRequests(serviceName string) error
- func (s *Store) SaveDiscoverRequest(request *ads.RequestContext) error
- func (s *Store) StopWatch()
- func (s *Store) Type() string
- func (s *Store) Watch() (pms.StorageChangeChannel, error)
- func (s *Store) WritePolicyStore(ps *pms.PolicyStore) error
Constants ¶
View Source
const ( DiscoverPrefix = "/isAllowedRequests/" DefaultPageSize = int64(1000) )
View Source
const ( KeySeparator = "/" PoliciesKey = "policies" RolePoliciesKey = "role_policies" ServicesKey = "services" FunctionsKey = "functions" ServiceTypeKey = "type" )
View Source
const ( StoreType = "etcd" //Following are keys of etcd store properties IsEmbeddedEtcdKey = "IsEmbeddedEtcd" EmbeddedEtcdDataDirKey = "EmbeddedEtcdDataDir" EtcdEndpointKey = "EtcdEndpoint" EtcdKeyPrefixKey = "EtcdKeyPrefix" EtcdTLSClientCertFileKey = "EtcdTLSCertFile" EtcdTLSClientKeyFileKey = "EtcdTLSKeyFile" EtcdTLSClientTrustedCAFileKey = "EtcdTLSTrustedCAFile" EtcdTLSAllowedCNKey = "EtcdTLSAllowedCN" EtcdTLSServerNameKey = "EtcdTLSServerName" EtcdTLSCRLFileKey = "EtcdTLSCRLFile" EtcdTLSInsecureSkipVerifyKey = "EtcdTLSInsecureSkipVerify" IsEmbeddedEtcdFlagName = "etcdstore-isembedded" EmbeddedEtcdDataDirFlagName = "etcdstore-embeddedDataDir" EtcdEndpointFlagName = "etcdstore-endpoint" EtcdKeyPrefixFlagName = "etcdstore-keyprefix" EtcdTLSClientCertFileFlagName = "etcdstore-tls-cert" EtcdTLSClientKeyFileFlagName = "etcdstore-tls-key" EtcdTLSClientTrustedCAFileFlagName = "etcdstore-tls-ca" EtcdTLSAllowedCNFlagName = "etcdstore-tls-allowedCN" EtcdTLSServerNameFlagName = "etcdstore-tls-serverName" EtcdTLSCRLFileFlagName = "etcdstore-tls-crlFile" EtcdTLSInsecureSkipVerifyFlagName = "etcdstore-tls-insecureSkipVerify" //default property values DefaultKeyPrefix = "/speedle_ps/" DefaultEtcdStoreEndpoint = "localhost:2379" DefaultEtcdStoreKeyPrefix = "/speedle_ps/" DefaultEtcdStoreIsEmbedded = false )
Variables ¶
This section is empty.
Functions ¶
func CleanEmbeddedEtcd ¶
CleanEmbedEtcd free the resource of embed etcd, and remove the tmp directory which is used to store data
Types ¶
type Etcd3StoreBuilder ¶
type Etcd3StoreBuilder struct{}
func (Etcd3StoreBuilder) GetStoreParams ¶
func (esb Etcd3StoreBuilder) GetStoreParams() map[string]string
func (Etcd3StoreBuilder) NewStore ¶
func (esb Etcd3StoreBuilder) NewStore(config map[string]interface{}) (pms.PolicyStoreManager, error)
type Store ¶
type Store struct { Config *clientv3.Config KeyPrefix string // contains filtered or unexported fields }
func (*Store) CreateFunction ¶
func (*Store) CreatePolicy ¶
func (*Store) CreateRolePolicy ¶
func (s *Store) CreateRolePolicy(serviceName string, rolePolicy *pms.RolePolicy) (*pms.RolePolicy, error)
func (*Store) DeleteFunction ¶
func (*Store) DeleteFunctions ¶
func (*Store) DeletePolicies ¶
func (*Store) DeleteRequests ¶
func (*Store) DeleteRolePolicies ¶
func (*Store) DeleteRolePolicy ¶
func (*Store) DeleteService ¶
delete application from etcd3
func (*Store) DeleteServices ¶
func (*Store) GeneratePolicies ¶
func (d *Store) GeneratePolicies(serviceName, principalType, principalName, principalIDD string) (map[string]*pms.Service, int64, error)
This method is implemented as common method at evaluator part
func (*Store) GetDiscoverRequests ¶
func (*Store) GetDiscoverRequestsSinceRevision ¶
func (*Store) GetFunctionCount ¶
func (*Store) GetLastDiscoverRequest ¶
func (*Store) GetPolicies ¶
func (s *Store) GetPolicies(serviceName string, startID string, amount int) (policies []*pms.Policy, nextID string, err error)
TODO: to be implemented
func (*Store) GetPolicyAndRolePolicyCounts ¶
func (s *Store) GetPolicyAndRolePolicyCounts() (map[string]*pms.PolicyAndRolePolicyCount, error)
func (*Store) GetRequests ¶
func (*Store) GetRolePolicies ¶
func (s *Store) GetRolePolicies(serviceName string, startID string, amount int) (policies []*pms.RolePolicy, nextID string, err error)
TODO: to be implemented
func (*Store) GetRolePolicy ¶
func (*Store) GetRolePolicyCount ¶
func (*Store) GetServiceCount ¶
func (*Store) GetServiceItself ¶
func (*Store) GetServiceNames ¶
func (*Store) GetServices ¶
func (s *Store) GetServices(startName string, amount int, retrivePolcies bool) ([]*pms.Service, string, error)
TODO: to be implemented
func (*Store) ListAllFunctions ¶
func (*Store) ListAllPolicies ¶
For policy manager
func (*Store) ListAllRolePolicies ¶
For role policy manager
func (*Store) ListAllServices ¶
func (*Store) PutRequest ¶
func (s *Store) PutRequest(request *ads.RequestContext) (int64, error)
func (*Store) ReadPolicyStore ¶
func (s *Store) ReadPolicyStore() (*pms.PolicyStore, error)
read policy store from etcd3
func (*Store) ResetDiscoverRequests ¶
func (*Store) SaveDiscoverRequest ¶
func (s *Store) SaveDiscoverRequest(request *ads.RequestContext) error
func (*Store) WritePolicyStore ¶
func (s *Store) WritePolicyStore(ps *pms.PolicyStore) error
write policy store to etcd3
Click to show internal directories.
Click to hide internal directories.