Documentation
¶
Index ¶
- type ProviderServer
- func (s *ProviderServer) Describe(_ context.Context, _ *provider.DescribeRequest) (*provider.DescribeResponse, error)
- func (s *ProviderServer) Generate(_ context.Context, req *provider.GenerateRequest) (*provider.GenerateResponse, error)
- func (s *ProviderServer) Scan(_ context.Context, req *provider.ScanRequest) (*provider.ScanResponse, error)
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderServer ¶
type ProviderServer struct {
// contains filtered or unexported fields
}
ProviderServer implements the provider.Provider interface for the OPA provider.
func New ¶
func New(opts ServerOptions) *ProviderServer
New returns a new ProviderServer with the given options. Zero-value fields in opts are replaced with production defaults.
func (*ProviderServer) Describe ¶
func (s *ProviderServer) Describe( _ context.Context, _ *provider.DescribeRequest, ) (*provider.DescribeResponse, error)
Describe returns the provider metadata and health status.
func (*ProviderServer) Generate ¶
func (s *ProviderServer) Generate( _ context.Context, req *provider.GenerateRequest, ) (*provider.GenerateResponse, error)
Generate reads the assessment plan's RequirementIDs, resolves the policy directory (preferring ComplypackContentPath from a cached complypack over opa_bundle_ref + conftest pull), loads the required mapping file, matches requirements to Rego namespaces, and writes a scan-config.json for Scan to consume. Returns {Success: false} if the mapping file is missing or invalid.
func (*ProviderServer) Scan ¶
func (s *ProviderServer) Scan( _ context.Context, req *provider.ScanRequest, ) (*provider.ScanResponse, error)
Scan evaluates configuration files against OPA policies using conftest.
type ServerOptions ¶
type ServerOptions struct {
Loader loader.DataLoader
Runner scan.CommandRunner
ToolChecker func() ([]string, error)
WorkspaceDir string
}
ServerOptions configures the ProviderServer dependencies. Zero-value fields receive sensible production defaults.