Documentation
¶
Index ¶
- Constants
- type Conf
- type HTTPSAuth
- type SSHAuth
- type Store
- func (s *Store) Driver() string
- func (s *Store) GetAll(ctx context.Context) ([]*policy.CompilationUnit, error)
- func (s *Store) GetAllMatching(_ context.Context, modIDs []namer.ModuleID) ([]*policy.CompilationUnit, error)
- func (s *Store) GetCompilationUnits(_ context.Context, ids ...namer.ModuleID) (map[namer.ModuleID]*policy.CompilationUnit, error)
- func (s *Store) GetDependents(_ context.Context, ids ...namer.ModuleID) (map[namer.ModuleID][]namer.ModuleID, error)
- func (s *Store) GetFirstMatch(_ context.Context, candidates []namer.ModuleID) (*policy.CompilationUnit, error)
- func (s *Store) InspectPolicies(ctx context.Context, params storage.ListPolicyIDsParams) (map[string]*responsev1.InspectPoliciesResponse_Result, error)
- func (s *Store) ListPolicyIDs(ctx context.Context, params storage.ListPolicyIDsParams) ([]string, error)
- func (s *Store) ListSchemaIDs(ctx context.Context) ([]string, error)
- func (s *Store) LoadPolicy(ctx context.Context, file ...string) ([]*policy.Wrapper, error)
- func (s *Store) LoadSchema(ctx context.Context, url string) (io.ReadCloser, error)
- func (s *Store) Reload(ctx context.Context) error
- func (s *Store) RepoStats(ctx context.Context) storage.RepoStats
- func (s *Store) Source() *auditv1.PolicySource
Constants ¶
View Source
const DriverName = "git"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct {
// SSH holds auth details for the SSH protocol.
SSH *SSHAuth `yaml:"ssh,omitempty"`
// HTTPS holds auth details for the HTTPS protocol.
HTTPS *HTTPSAuth `yaml:"https,omitempty"`
// OperationTimeout specifies the timeout for git operations.
OperationTimeout *time.Duration `yaml:"operationTimeout,omitempty" conf:",example=60s"`
// Protocol is the Git protocol to use. Valid values are https, ssh, and file.
Protocol string `yaml:"protocol" conf:"required,example=file"`
// URL is the URL to the Git repo.
URL string `yaml:"url" conf:"required,example=file://${HOME}/tmp/cerbos/policies"`
// Branch is the branch to checkout.
Branch string `yaml:"branch" conf:",example=policies"`
// SubDir is the path under the checked-out Git repo where the policies are stored.
SubDir string `yaml:"subDir,omitempty" conf:",example=policies"`
// CheckoutDir is the local path to checkout the Git repo to.
CheckoutDir string `yaml:"checkoutDir" conf:",example=${HOME}/tmp/cerbos/work"`
// [DEPRECATED] ScratchDir is the directory to use for holding temporary data.
ScratchDir string `yaml:"scratchDir" conf:",ignore"`
// UpdatePollInterval specifies the interval to poll the Git repository for changes. Set to 0 to disable.
UpdatePollInterval time.Duration `yaml:"updatePollInterval" conf:",example=60s"`
}
Conf is required (if driver is set to 'git') configuration for Git storage driver. +desc=This section is required only if storage.driver is git.
type HTTPSAuth ¶
type HTTPSAuth struct {
// The username to use for authentication.
Username string `yaml:"username" conf:",example=cerbos"`
// The password (or token) to use for authentication.
Password string `yaml:"password" conf:",example=${GITHUB_TOKEN}"`
}
HTTPSAuth holds auth details for the HTTPS protocol.
type SSHAuth ¶
type SSHAuth struct {
// The git user. Defaults to git.
User string `yaml:"user" conf:",example=git"`
// The path to the SSH private key file.
PrivateKeyFile string `yaml:"privateKeyFile" conf:",example=${HOME}/.ssh/id_rsa"`
// The password to the SSH private key.
Password string `yaml:"password" conf:",example=pw"`
}
SSHAuth holds auth details for the SSH protocol.
type Store ¶
type Store struct {
*storage.SubscriptionManager
// contains filtered or unexported fields
}
func (*Store) GetAllMatching ¶ added in v0.41.0
func (*Store) GetCompilationUnits ¶
func (*Store) GetDependents ¶
func (*Store) GetFirstMatch ¶ added in v0.29.0
func (*Store) InspectPolicies ¶ added in v0.35.0
func (s *Store) InspectPolicies(ctx context.Context, params storage.ListPolicyIDsParams) (map[string]*responsev1.InspectPoliciesResponse_Result, error)
func (*Store) ListPolicyIDs ¶ added in v0.12.0
func (*Store) ListSchemaIDs ¶ added in v0.11.0
func (*Store) LoadPolicy ¶ added in v0.12.0
func (*Store) LoadSchema ¶ added in v0.11.0
func (*Store) Source ¶ added in v0.46.0
func (s *Store) Source() *auditv1.PolicySource
Click to show internal directories.
Click to hide internal directories.