Documentation
¶
Overview ¶
Package mongo provides a MongoDB implementation of the Shield composite store using grove ORM with index-based migrations.
Index ¶
- Variables
- type Store
- func (s *Store) AssignToTenant(ctx context.Context, tenantID string, polID id.PolicyID) error
- func (s *Store) Close() error
- func (s *Store) CreateAwareness(ctx context.Context, a *awareness.Awareness) error
- func (s *Store) CreateBoundary(ctx context.Context, b *boundary.Boundary) error
- func (s *Store) CreateInstinct(ctx context.Context, inst *instinct.Instinct) error
- func (s *Store) CreateJudgment(ctx context.Context, j *judgment.Judgment) error
- func (s *Store) CreatePolicy(ctx context.Context, pol *policy.Policy) error
- func (s *Store) CreateProfile(ctx context.Context, p *profile.SafetyProfile) error
- func (s *Store) CreateReflex(ctx context.Context, r *reflex.Reflex) error
- func (s *Store) CreateReport(ctx context.Context, report *compliance.Report) error
- func (s *Store) CreateScan(ctx context.Context, result *scan.Result) error
- func (s *Store) CreateValues(ctx context.Context, v *values.Values) error
- func (s *Store) DashboardAssign(ctx context.Context, scope store.Scope, key string, assigned bool) error
- func (s *Store) DashboardAssigned(ctx context.Context, scope store.Scope, key string) (bool, error)
- func (s *Store) DashboardCreate(ctx context.Context, scope store.Scope, kind string, raw json.RawMessage) (json.RawMessage, error)
- func (s *Store) DashboardDelete(ctx context.Context, scope store.Scope, kind, key string) error
- func (s *Store) DashboardDeleteTokens(ctx context.Context, scope store.Scope, cutoff time.Time, keys []string) (int64, error)
- func (s *Store) DashboardGet(ctx context.Context, scope store.Scope, kind, key string) (json.RawMessage, error)
- func (s *Store) DashboardList(ctx context.Context, scope store.Scope, kind string, f store.Filter) (store.Page, error)
- func (s *Store) DashboardTokenStats(ctx context.Context, scope store.Scope) (store.TokenStats, error)
- func (s *Store) DashboardTokens(ctx context.Context, scope store.Scope, scanID string, cutoff *time.Time, ...) (store.Page, error)
- func (s *Store) DashboardUpdate(ctx context.Context, scope store.Scope, kind, key string, raw json.RawMessage) (json.RawMessage, error)
- func (s *Store) DeleteAwareness(ctx context.Context, aID id.AwarenessID) error
- func (s *Store) DeleteBoundary(ctx context.Context, bID id.BoundaryID) error
- func (s *Store) DeleteInstinct(ctx context.Context, instID id.InstinctID) error
- func (s *Store) DeleteJudgment(ctx context.Context, jID id.JudgmentID) error
- func (s *Store) DeletePIITokens(ctx context.Context, tokenIDs []id.PIITokenID) error
- func (s *Store) DeletePIITokensByTenant(ctx context.Context, tenantID string) error
- func (s *Store) DeletePolicy(ctx context.Context, polID id.PolicyID) error
- func (s *Store) DeleteProfile(ctx context.Context, pID id.SafetyProfileID) error
- func (s *Store) DeleteReflex(ctx context.Context, rID id.ReflexID) error
- func (s *Store) DeleteValues(ctx context.Context, vID id.ValueID) error
- func (s *Store) GetAwareness(ctx context.Context, aID id.AwarenessID) (*awareness.Awareness, error)
- func (s *Store) GetAwarenessByName(ctx context.Context, appID, name string) (*awareness.Awareness, error)
- func (s *Store) GetBoundary(ctx context.Context, bID id.BoundaryID) (*boundary.Boundary, error)
- func (s *Store) GetBoundaryByName(ctx context.Context, appID, name string) (*boundary.Boundary, error)
- func (s *Store) GetInstinct(ctx context.Context, instID id.InstinctID) (*instinct.Instinct, error)
- func (s *Store) GetInstinctByName(ctx context.Context, appID, name string) (*instinct.Instinct, error)
- func (s *Store) GetJudgment(ctx context.Context, jID id.JudgmentID) (*judgment.Judgment, error)
- func (s *Store) GetJudgmentByName(ctx context.Context, appID, name string) (*judgment.Judgment, error)
- func (s *Store) GetPoliciesForScope(ctx context.Context, scopeKey string, level policy.ScopeLevel) ([]*policy.Policy, error)
- func (s *Store) GetPolicy(ctx context.Context, polID id.PolicyID) (*policy.Policy, error)
- func (s *Store) GetPolicyByName(ctx context.Context, scopeKey, name string) (*policy.Policy, error)
- func (s *Store) GetProfile(ctx context.Context, pID id.SafetyProfileID) (*profile.SafetyProfile, error)
- func (s *Store) GetProfileByName(ctx context.Context, appID, name string) (*profile.SafetyProfile, error)
- func (s *Store) GetReflex(ctx context.Context, rID id.ReflexID) (*reflex.Reflex, error)
- func (s *Store) GetReflexByName(ctx context.Context, appID, name string) (*reflex.Reflex, error)
- func (s *Store) GetReport(ctx context.Context, reportID id.ComplianceReportID) (*compliance.Report, error)
- func (s *Store) GetScan(ctx context.Context, scanID id.ScanID) (*scan.Result, error)
- func (s *Store) GetValues(ctx context.Context, vID id.ValueID) (*values.Values, error)
- func (s *Store) GetValuesByName(ctx context.Context, appID, name string) (*values.Values, error)
- func (s *Store) ListAwareness(ctx context.Context, filter *awareness.ListFilter) ([]*awareness.Awareness, error)
- func (s *Store) ListBoundaries(ctx context.Context, filter *boundary.ListFilter) ([]*boundary.Boundary, error)
- func (s *Store) ListInstincts(ctx context.Context, filter *instinct.ListFilter) ([]*instinct.Instinct, error)
- func (s *Store) ListJudgments(ctx context.Context, filter *judgment.ListFilter) ([]*judgment.Judgment, error)
- func (s *Store) ListPolicies(ctx context.Context, filter *policy.ListFilter) ([]*policy.Policy, error)
- func (s *Store) ListProfiles(ctx context.Context, filter *profile.ListFilter) ([]*profile.SafetyProfile, error)
- func (s *Store) ListReflexes(ctx context.Context, filter *reflex.ListFilter) ([]*reflex.Reflex, error)
- func (s *Store) ListReports(ctx context.Context, filter *compliance.ListFilter) ([]*compliance.Report, error)
- func (s *Store) ListScans(ctx context.Context, filter *scan.ListFilter) ([]*scan.Result, error)
- func (s *Store) ListValues(ctx context.Context, filter *values.ListFilter) ([]*values.Values, error)
- func (s *Store) LoadPIITokens(ctx context.Context, tokenIDs []id.PIITokenID) ([]*pii.Token, error)
- func (s *Store) LoadPIITokensByScan(ctx context.Context, scanID id.ScanID) ([]*pii.Token, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) PIIStats(ctx context.Context, tenantID string) (*pii.Stats, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) PurgePIITokens(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *Store) ScanStats(ctx context.Context, filter *scan.StatsFilter) (*scan.Stats, error)
- func (s *Store) StorePIITokens(ctx context.Context, tokens []*pii.Token) error
- func (s *Store) UnassignFromTenant(ctx context.Context, tenantID string, polID id.PolicyID) error
- func (s *Store) UpdateAwareness(ctx context.Context, a *awareness.Awareness) error
- func (s *Store) UpdateBoundary(ctx context.Context, b *boundary.Boundary) error
- func (s *Store) UpdateInstinct(ctx context.Context, inst *instinct.Instinct) error
- func (s *Store) UpdateJudgment(ctx context.Context, j *judgment.Judgment) error
- func (s *Store) UpdatePolicy(ctx context.Context, pol *policy.Policy) error
- func (s *Store) UpdateProfile(ctx context.Context, p *profile.SafetyProfile) error
- func (s *Store) UpdateReflex(ctx context.Context, r *reflex.Reflex) error
- func (s *Store) UpdateValues(ctx context.Context, v *values.Values) error
Constants ¶
This section is empty.
Variables ¶
var Migrations = migrate.NewGroup("shield")
Migrations is the grove migration group for the Shield mongo store.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements store.Store using MongoDB via Grove ORM.
func (*Store) AssignToTenant ¶
func (*Store) CreateAwareness ¶
func (*Store) CreateBoundary ¶
func (*Store) CreateInstinct ¶
func (*Store) CreateJudgment ¶
func (*Store) CreatePolicy ¶
func (*Store) CreateProfile ¶
func (*Store) CreateReflex ¶
func (*Store) CreateReport ¶
func (*Store) CreateScan ¶
func (*Store) CreateValues ¶
func (*Store) DashboardAssign ¶
func (s *Store) DashboardAssign(ctx context.Context, scope store.Scope, key string, assigned bool) error
DashboardAssign assigns an app-level policy to scope.TenantID. Only an app-scope actor assigns; to a tenant actor policies are read-only.
func (*Store) DashboardAssigned ¶
func (*Store) DashboardCreate ¶
func (*Store) DashboardDelete ¶
func (*Store) DashboardDeleteTokens ¶
func (*Store) DashboardGet ¶
func (*Store) DashboardList ¶
func (*Store) DashboardTokenStats ¶
func (*Store) DashboardTokens ¶
func (*Store) DashboardUpdate ¶
func (*Store) DeleteAwareness ¶
func (*Store) DeleteBoundary ¶
func (*Store) DeleteInstinct ¶
func (*Store) DeleteJudgment ¶
func (*Store) DeletePIITokens ¶
func (*Store) DeletePIITokensByTenant ¶
func (*Store) DeletePolicy ¶
DeletePolicy is idempotent: a missing policy and one the context cannot see both return nil, and the second is left in place. A visible policy the context may not write (an app-level policy under a tenant) is refused with ErrTenantMismatch rather than skipped.
func (*Store) DeleteProfile ¶
func (*Store) DeleteReflex ¶
func (*Store) DeleteValues ¶
func (*Store) GetAwareness ¶
func (*Store) GetAwarenessByName ¶
func (*Store) GetBoundary ¶
func (*Store) GetBoundaryByName ¶
func (*Store) GetInstinct ¶
func (*Store) GetInstinctByName ¶
func (*Store) GetJudgment ¶
func (*Store) GetJudgmentByName ¶
func (*Store) GetPoliciesForScope ¶
func (*Store) GetPolicyByName ¶
func (*Store) GetProfile ¶
func (s *Store) GetProfile(ctx context.Context, pID id.SafetyProfileID) (*profile.SafetyProfile, error)
func (*Store) GetProfileByName ¶
func (*Store) GetReflexByName ¶
func (*Store) GetReport ¶
func (s *Store) GetReport(ctx context.Context, reportID id.ComplianceReportID) (*compliance.Report, error)
func (*Store) GetValuesByName ¶
func (*Store) ListAwareness ¶
func (*Store) ListBoundaries ¶
func (*Store) ListInstincts ¶
func (*Store) ListJudgments ¶
func (*Store) ListPolicies ¶
func (*Store) ListProfiles ¶
func (s *Store) ListProfiles(ctx context.Context, filter *profile.ListFilter) ([]*profile.SafetyProfile, error)
func (*Store) ListReflexes ¶
func (*Store) ListReports ¶
func (s *Store) ListReports(ctx context.Context, filter *compliance.ListFilter) ([]*compliance.Report, error)
func (*Store) ListValues ¶
func (*Store) LoadPIITokens ¶
func (*Store) LoadPIITokensByScan ¶
func (*Store) PurgePIITokens ¶
PurgePIITokens is an operator retention sweep: it removes expired tokens in every tenant and so takes no tenant.