Documentation
¶
Index ¶
- Constants
- type FileStoreBuilder
- type RequestItem
- 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) 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 (s *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) 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) 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) GetServiceNames() ([]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() ([]*pms.Service, error)
- func (s *Store) ReadPolicyStore() (*pms.PolicyStore, error)
- func (s *Store) ResetDiscoverRequests(serviceName string) error
- func (s *Store) SaveDiscoverRequest(discoverRequest *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
- func (s *Store) WriteService(service *pms.Service) error
- type StoreContent
Constants ¶
const ( StoreType = "file" //following are keys of file store properties FileLocationKey = "FileLocation" FileLocationFlagName = "filestore-loc" DefaultFileStoreLocation = "/tmp/speedle-test-file-store.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStoreBuilder ¶
type FileStoreBuilder struct{}
func (FileStoreBuilder) GetStoreParams ¶
func (fs FileStoreBuilder) GetStoreParams() map[string]string
func (FileStoreBuilder) NewStore ¶
func (fs FileStoreBuilder) NewStore(config map[string]interface{}) (pms.PolicyStoreManager, error)
type RequestItem ¶
type RequestItem struct { Index int64 `json:"index"` Request *ads.RequestContext `json:"request"` }
type Store ¶
type Store struct { FileLocation 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) CreateService ¶
CreateService creates a new service
func (*Store) DeleteFunction ¶
func (*Store) DeleteFunctions ¶
func (*Store) DeletePolicies ¶
func (*Store) DeleteRolePolicies ¶
func (*Store) DeleteRolePolicy ¶
func (*Store) DeleteService ¶
DeleteService deletes a service named ${serviceName} from a file
func (*Store) DeleteServices ¶
DeleteServices deletes all services from a file
func (*Store) GeneratePolicies ¶
func (s *Store) GeneratePolicies(serviceName, principalType, principalName, principalIDD string) (map[string]*pms.Service, int64, error)
Generate policies for principal based on existing request logs. Generate policies for all principals when principalXXX are empty.
func (*Store) GetDiscoverRequests ¶
GetDiscoverRequests gets request logs for a service. Get all requests when serviceName is empty.
func (*Store) GetDiscoverRequestsSinceRevision ¶
func (s *Store) GetDiscoverRequestsSinceRevision(serviceName string, revision int64) ([]*ads.RequestContext, int64, error)
GetDiscoverRequestsSinceRevision gets request logs since a revision.
func (*Store) GetFunctionCount ¶
func (*Store) GetLastDiscoverRequest ¶
GetLastDiscoverRequest gets last request log
func (*Store) GetPolicyAndRolePolicyCounts ¶
func (s *Store) GetPolicyAndRolePolicyCounts() (map[string]*pms.PolicyAndRolePolicyCount, error)
GetPolicyAndRolePolicyCounts returns a map, in which the key is the service name, and the value is the count of both policies and role policies in the service.
func (*Store) GetRolePolicy ¶
func (*Store) GetRolePolicyCount ¶
func (*Store) GetService ¶
GetService gets the detailed info of a service
func (*Store) GetServiceCount ¶
GetServiceCount gets the service count
func (*Store) GetServiceNames ¶
GetServiceNames reads all the service names
func (*Store) ListAllFunctions ¶
func (*Store) ListAllPolicies ¶
For policy manager
func (*Store) ListAllRolePolicies ¶
For role policy manager
func (*Store) ListAllServices ¶
ListAllServices lists all the services
func (*Store) ReadPolicyStore ¶
func (s *Store) ReadPolicyStore() (*pms.PolicyStore, error)
ReadPolicyStore reads policy store from a file
func (*Store) ResetDiscoverRequests ¶
ResetDiscoverRequests cleans request logs for a service. Clean all request logs when serviceName is empty.
func (*Store) SaveDiscoverRequest ¶
func (s *Store) SaveDiscoverRequest(discoverRequest *ads.RequestContext) error
SaveDiscoverRequest saves discover request
func (*Store) WritePolicyStore ¶
func (s *Store) WritePolicyStore(ps *pms.PolicyStore) error
WritePolicyStore writes policies to a file
type StoreContent ¶
type StoreContent struct {
Requests []*RequestItem `json:"requests"`
}