Documentation ¶
Index ¶
- Constants
- Variables
- func GRPC(ctx context.Context, addr string, l logger.Logger, ...) error
- func InputValidationInterceptor() grpc.UnaryServerInterceptor
- func NewAuthzServer(l logger.Logger, e engine.Authorizer, p api.ProjectsServiceServer, ...) (api.AuthorizationServiceServer, error)
- func NewGRPCServer(ctx context.Context, connFactory *secureconn.Factory, l logger.Logger, ...) (*grpc.Server, error)
- func NewMemstoreProjectsServer(ctx context.Context, l logger.Logger, ...) (api.ProjectsServiceServer, error)
- func NewPostgresAuthzServer(l logger.Logger, e engine.Authorizer, p api.ProjectsServiceServer) (api.AuthorizationServiceServer, error)
- func NewPostgresProjectsServer(ctx context.Context, l logger.Logger, ...) (api.ProjectsServiceServer, error)
- func NewProjectsServer(ctx context.Context, l logger.Logger, s storage.Storage, ...) (api.ProjectsServiceServer, error)
- func NewWorkflowExecutor() (*patterns.ChainWorkflowExecutor, error)
- func SystemPolicies() []*storage.Policy
- type ApplyStagedRulesParams
- type ApplyStagedRulesResult
- type ApplyStagedRulesTaskExecutor
- type CerealProjectUpdateManager
- type EmptyProjectUpdateStatus
- func (*EmptyProjectUpdateStatus) Cancelled() bool
- func (*EmptyProjectUpdateStatus) EstimatedTimeComplete() time.Time
- func (*EmptyProjectUpdateStatus) Failed() bool
- func (*EmptyProjectUpdateStatus) FailureMessage() string
- func (*EmptyProjectUpdateStatus) PercentageComplete() float64
- func (*EmptyProjectUpdateStatus) Stage() ProjectUpdateStage
- func (*EmptyProjectUpdateStatus) State() ProjectUpdateState
- type PolicyRefresher
- type PolicyServer
- func NewMemstorePolicyServer(ctx context.Context, l logger.Logger, pr PolicyRefresher, e engine.Writer) (PolicyServer, error)
- func NewPoliciesServer(ctx context.Context, l logger.Logger, pr PolicyRefresher, s storage.Storage, ...) (PolicyServer, error)
- func NewPostgresPolicyServer(ctx context.Context, l logger.Logger, pr PolicyRefresher, e engine.Writer) (PolicyServer, error)
- type ProjectState
- func (s *ProjectState) ApplyRulesCancel(context.Context, *api.ApplyRulesCancelReq) (*api.ApplyRulesCancelResp, error)
- func (s *ProjectState) ApplyRulesStart(ctx context.Context, _ *api.ApplyRulesStartReq) (*api.ApplyRulesStartResp, error)
- func (s *ProjectState) ApplyRulesStatus(context.Context, *api.ApplyRulesStatusReq) (*api.ApplyRulesStatusResp, error)
- func (s *ProjectState) CreateProject(ctx context.Context, req *api.CreateProjectReq) (*api.CreateProjectResp, error)
- func (s *ProjectState) CreateRule(ctx context.Context, req *api.CreateRuleReq) (*api.CreateRuleResp, error)
- func (s *ProjectState) DeleteProject(ctx context.Context, req *api.DeleteProjectReq) (*api.DeleteProjectResp, error)
- func (s *ProjectState) DeleteRule(ctx context.Context, req *api.DeleteRuleReq) (*api.DeleteRuleResp, error)
- func (s *ProjectState) GetProject(ctx context.Context, req *api.GetProjectReq) (*api.GetProjectResp, error)
- func (s *ProjectState) GetRule(ctx context.Context, req *api.GetRuleReq) (*api.GetRuleResp, error)
- func (s *ProjectState) ListProjects(ctx context.Context, _ *api.ListProjectsReq) (*api.ListProjectsResp, error)
- func (s *ProjectState) ListProjectsForIntrospection(ctx context.Context, req *api.ListProjectsReq) (*api.ListProjectsResp, error)
- func (s *ProjectState) ListRules(ctx context.Context, req *api.ListRulesReq) (*api.ListRulesResp, error)
- func (s *ProjectState) ListRulesForAllProjects(ctx context.Context, req *api.ListRulesForAllProjectsReq) (*api.ListRulesForAllProjectsResp, error)
- func (s *ProjectState) ListRulesForProject(ctx context.Context, req *api.ListRulesForProjectReq) (*api.ListRulesForProjectResp, error)
- func (s *ProjectState) UpdateProject(ctx context.Context, req *api.UpdateProjectReq) (*api.UpdateProjectResp, error)
- func (s *ProjectState) UpdateRule(ctx context.Context, req *api.UpdateRuleReq) (*api.UpdateRuleResp, error)
- type ProjectUpdateMgr
- type ProjectUpdateStage
- type ProjectUpdateState
- type ProjectUpdateStatus
Constants ¶
const ( ProjectUpdateRunningState ProjectUpdateState = "running" ProjectUpdateNotRunningState ProjectUpdateState = "not_running" ProjectUpdateStageApplyStagedRules ProjectUpdateStage = "apply_staged_rules" ProjectUpdateStageUpdateDomainServices ProjectUpdateStage = "update_domain_services" ProjectUpdateStageUpdateDone ProjectUpdateStage = "done" ProjectUpdateStageUpdateNone ProjectUpdateStage = "none" )
Variables ¶
var ( ProjectUpdateWorkflowName = cereal.NewWorkflowName("ProjectUpdate") ProjectUpdateInstanceName = "SingletonV1" ApplyStagedRulesTaskName = cereal.NewTaskName("authz/ApplyStagedRules") )
var ErrMessageBoxFull = errors.New("Message box full")
var ParallelProjectUpdateDomainServices = []string{}
var SerializedProjectUpdateDomainServices = []string{
"compliance",
"ingest",
"nodemanager",
"feed",
}
Functions ¶
func GRPC ¶
func GRPC(ctx context.Context, addr string, l logger.Logger, connFactory *secureconn.Factory, e engine.Engine, migrationsConfig migration.Config, dataMigrationsConfig datamigration.Config, cerealAddress string, projectLimit int) error
GRPC creates and listens on grpc server.
func InputValidationInterceptor ¶
func InputValidationInterceptor() grpc.UnaryServerInterceptor
InputValidationInterceptor is a middleware for running the protobuf validation.
func NewAuthzServer ¶
func NewAuthzServer(l logger.Logger, e engine.Authorizer, p api.ProjectsServiceServer, s storage.Storage) (api.AuthorizationServiceServer, error)
func NewGRPCServer ¶
func NewGRPCServer(ctx context.Context, connFactory *secureconn.Factory, l logger.Logger, e engine.Engine, migrationsConfig migration.Config, dataMigrationsConfig datamigration.Config, cerealAddress string, projectLimit int) (*grpc.Server, error)
NewGRPCServer creates a grpc server.
func NewMemstoreProjectsServer ¶
func NewMemstoreProjectsServer( ctx context.Context, l logger.Logger, projectUpdateCerealManager *cereal.Manager, pr PolicyRefresher, ) (api.ProjectsServiceServer, error)
NewMemstoreProjectsServer returns an instance of api.ProjectsServer
func NewPostgresAuthzServer ¶
func NewPostgresAuthzServer(l logger.Logger, e engine.Authorizer, p api.ProjectsServiceServer) (api.AuthorizationServiceServer, error)
NewPostgresAuthzServer returns a new Authz server.
func NewPostgresProjectsServer ¶
func NewPostgresProjectsServer( ctx context.Context, l logger.Logger, projectUpdateCerealManager *cereal.Manager, pr PolicyRefresher, ) (api.ProjectsServiceServer, error)
NewPostgresProjectsServer instantiates a ProjectsServer using a PG store
func NewProjectsServer ¶
func NewProjectsServer( ctx context.Context, l logger.Logger, s storage.Storage, projectUpdateManager ProjectUpdateMgr, projectPurger project_purger_workflow.ProjectPurger, pr PolicyRefresher, ) (api.ProjectsServiceServer, error)
func NewWorkflowExecutor ¶
func NewWorkflowExecutor() (*patterns.ChainWorkflowExecutor, error)
func SystemPolicies ¶
SystemPolicies returns a list of system policies that should always exist by default. These should not be visible to the enduser and therefore exist outside of the database.
Types ¶
type ApplyStagedRulesParams ¶
type ApplyStagedRulesParams struct { }
type ApplyStagedRulesResult ¶
type ApplyStagedRulesResult struct { }
type ApplyStagedRulesTaskExecutor ¶
type ApplyStagedRulesTaskExecutor struct {
// contains filtered or unexported fields
}
type CerealProjectUpdateManager ¶
type CerealProjectUpdateManager struct {
// contains filtered or unexported fields
}
func (*CerealProjectUpdateManager) Cancel ¶
func (m *CerealProjectUpdateManager) Cancel() error
func (*CerealProjectUpdateManager) Start ¶
func (m *CerealProjectUpdateManager) Start() error
func (*CerealProjectUpdateManager) Status ¶
func (m *CerealProjectUpdateManager) Status() (ProjectUpdateStatus, error)
type EmptyProjectUpdateStatus ¶
type EmptyProjectUpdateStatus struct{}
func (*EmptyProjectUpdateStatus) Cancelled ¶
func (*EmptyProjectUpdateStatus) Cancelled() bool
func (*EmptyProjectUpdateStatus) EstimatedTimeComplete ¶
func (*EmptyProjectUpdateStatus) EstimatedTimeComplete() time.Time
func (*EmptyProjectUpdateStatus) Failed ¶
func (*EmptyProjectUpdateStatus) Failed() bool
func (*EmptyProjectUpdateStatus) FailureMessage ¶
func (*EmptyProjectUpdateStatus) FailureMessage() string
func (*EmptyProjectUpdateStatus) PercentageComplete ¶
func (*EmptyProjectUpdateStatus) PercentageComplete() float64
func (*EmptyProjectUpdateStatus) Stage ¶
func (*EmptyProjectUpdateStatus) Stage() ProjectUpdateStage
func (*EmptyProjectUpdateStatus) State ¶
func (*EmptyProjectUpdateStatus) State() ProjectUpdateState
type PolicyServer ¶
type PolicyServer interface { api.PoliciesServiceServer EngineUpdateInterceptor() grpc.UnaryServerInterceptor }
PolicyServer is the server interface for policies: what we defined via protobuf + the update interceptor
func NewMemstorePolicyServer ¶
func NewMemstorePolicyServer( ctx context.Context, l logger.Logger, pr PolicyRefresher, e engine.Writer) (PolicyServer, error)
NewMemstorePolicyServer returns an instance of server.Server
func NewPoliciesServer ¶
func NewPoliciesServer( ctx context.Context, l logger.Logger, pr PolicyRefresher, s storage.Storage, e engine.Writer) (PolicyServer, error)
NewPoliciesServer returns a new IAM Policy server.
func NewPostgresPolicyServer ¶
func NewPostgresPolicyServer( ctx context.Context, l logger.Logger, pr PolicyRefresher, e engine.Writer) (PolicyServer, error)
NewPostgresPolicyServer instantiates a server.Server that connects to a postgres backend
type ProjectState ¶
type ProjectState struct { ProjectUpdateManager ProjectUpdateMgr ProjectPurger project_purger_workflow.ProjectPurger // contains filtered or unexported fields }
ProjectState holds the server state for projects
func (*ProjectState) ApplyRulesCancel ¶
func (s *ProjectState) ApplyRulesCancel( context.Context, *api.ApplyRulesCancelReq) (*api.ApplyRulesCancelResp, error)
func (*ProjectState) ApplyRulesStart ¶
func (s *ProjectState) ApplyRulesStart( ctx context.Context, _ *api.ApplyRulesStartReq) (*api.ApplyRulesStartResp, error)
func (*ProjectState) ApplyRulesStatus ¶
func (s *ProjectState) ApplyRulesStatus( context.Context, *api.ApplyRulesStatusReq) (*api.ApplyRulesStatusResp, error)
func (*ProjectState) CreateProject ¶
func (s *ProjectState) CreateProject(ctx context.Context, req *api.CreateProjectReq) (*api.CreateProjectResp, error)
func (*ProjectState) CreateRule ¶
func (s *ProjectState) CreateRule(ctx context.Context, req *api.CreateRuleReq) (*api.CreateRuleResp, error)
func (*ProjectState) DeleteProject ¶
func (s *ProjectState) DeleteProject(ctx context.Context, req *api.DeleteProjectReq) (*api.DeleteProjectResp, error)
func (*ProjectState) DeleteRule ¶
func (s *ProjectState) DeleteRule(ctx context.Context, req *api.DeleteRuleReq) (*api.DeleteRuleResp, error)
func (*ProjectState) GetProject ¶
func (s *ProjectState) GetProject(ctx context.Context, req *api.GetProjectReq) (*api.GetProjectResp, error)
func (*ProjectState) GetRule ¶
func (s *ProjectState) GetRule(ctx context.Context, req *api.GetRuleReq) (*api.GetRuleResp, error)
func (*ProjectState) ListProjects ¶
func (s *ProjectState) ListProjects( ctx context.Context, _ *api.ListProjectsReq) (*api.ListProjectsResp, error)
func (*ProjectState) ListProjectsForIntrospection ¶
func (s *ProjectState) ListProjectsForIntrospection( ctx context.Context, req *api.ListProjectsReq) (*api.ListProjectsResp, error)
func (*ProjectState) ListRules ¶
func (s *ProjectState) ListRules(ctx context.Context, req *api.ListRulesReq) (*api.ListRulesResp, error)
func (*ProjectState) ListRulesForAllProjects ¶
func (s *ProjectState) ListRulesForAllProjects(ctx context.Context, req *api.ListRulesForAllProjectsReq) (*api.ListRulesForAllProjectsResp, error)
func (*ProjectState) ListRulesForProject ¶
func (s *ProjectState) ListRulesForProject(ctx context.Context, req *api.ListRulesForProjectReq) (*api.ListRulesForProjectResp, error)
func (*ProjectState) UpdateProject ¶
func (s *ProjectState) UpdateProject(ctx context.Context, req *api.UpdateProjectReq) (*api.UpdateProjectResp, error)
func (*ProjectState) UpdateRule ¶
func (s *ProjectState) UpdateRule(ctx context.Context, req *api.UpdateRuleReq) (*api.UpdateRuleResp, error)
type ProjectUpdateMgr ¶
type ProjectUpdateMgr interface { Cancel() error Start() error Status() (ProjectUpdateStatus, error) }
func RegisterCerealProjectUpdateManager ¶
func RegisterCerealProjectUpdateManager(manager *cereal.Manager, log logger.Logger, s storage.Storage, pr PolicyRefresher) (ProjectUpdateMgr, error)
type ProjectUpdateStage ¶
type ProjectUpdateStage string
type ProjectUpdateState ¶
type ProjectUpdateState string
type ProjectUpdateStatus ¶
type ProjectUpdateStatus interface { Failed() bool Cancelled() bool FailureMessage() string PercentageComplete() float64 EstimatedTimeComplete() time.Time State() ProjectUpdateState Stage() ProjectUpdateStage }