Documentation ¶
Index ¶
- Constants
- func DefaultServiceSpec() launcher.ServiceSpec
- func WithAuthorizationStrategy(authz service.AuthorizationStrategy) service.Option[*Service]
- func WithAuthorizer(auth api.Authorizer) service.Option[*Service]
- func WithEvidenceStoreAddress(address string, opts ...grpc.DialOption) service.Option[*Service]
- func WithOAuth2Authorizer(config *clientcredentials.Config) service.Option[*Service]
- func WithOrchestratorAddress(target string, opts ...grpc.DialOption) service.Option[*Service]
- func WithRegoPackageName(pkg string) service.Option[*Service]
- func WithoutEvidenceStore() service.Option[*Service]
- type Service
- func (svc *Service) AssessEvidence(ctx context.Context, req *assessment.AssessEvidenceRequest) (res *assessment.AssessEvidenceResponse, err error)
- func (svc *Service) AssessEvidences(stream assessment.Assessment_AssessEvidencesServer) (err error)
- func (svc *Service) Init()
- func (svc *Service) MetricConfiguration(CertificationTargetID string, metric *assessment.Metric) (config *assessment.MetricConfiguration, err error)
- func (svc *Service) MetricImplementation(lang assessment.MetricImplementation_Language, metric *assessment.Metric) (impl *assessment.MetricImplementation, err error)
- func (svc *Service) Metrics() (metrics []*assessment.Metric, err error)
- func (svc *Service) RegisterAssessmentResultHook(...)
- func (svc *Service) Shutdown()
Constants ¶
const ( // DefaultEvidenceStoreAddress specifies the default gRPC address of the evidence store. DefaultEvidenceStoreAddress = "localhost:9090" // DefaultOrchestratorAddress specifies the default gRPC address of the orchestrator. DefaultOrchestratorAddress = "localhost:9090" )
const ( // EvictionTime is the time after which an entry in the metric configuration is invalid EvictionTime = time.Hour * 1 )
Variables ¶
This section is empty.
Functions ¶
func DefaultServiceSpec ¶
func DefaultServiceSpec() launcher.ServiceSpec
func WithAuthorizationStrategy ¶
func WithAuthorizationStrategy(authz service.AuthorizationStrategy) service.Option[*Service]
WithAuthorizationStrategy is an option that configures an authorization strategy.
func WithAuthorizer ¶
func WithAuthorizer(auth api.Authorizer) service.Option[*Service]
WithAuthorizer is an option to use a pre-created authorizer
func WithEvidenceStoreAddress ¶
WithEvidenceStoreAddress is an option to configure the evidence store gRPC address.
func WithOAuth2Authorizer ¶
func WithOAuth2Authorizer(config *clientcredentials.Config) service.Option[*Service]
WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer
func WithOrchestratorAddress ¶
WithOrchestratorAddress is an option to configure the orchestrator gRPC address.
func WithRegoPackageName ¶
WithRegoPackageName is an option to configure the Rego package name
func WithoutEvidenceStore ¶
WithoutEvidenceStore is a service option to discard evidences and don't send them to an evidence store
Types ¶
type Service ¶
type Service struct { // Embedded for FWD compatibility assessment.UnimplementedAssessmentServer // contains filtered or unexported fields }
Service is an implementation of the Clouditor Assessment service. It should not be used directly, but rather the NewService constructor should be used. It implements the AssessmentServer interface.
func NewService ¶
NewService creates a new assessment service with default values.
func (*Service) AssessEvidence ¶
func (svc *Service) AssessEvidence(ctx context.Context, req *assessment.AssessEvidenceRequest) (res *assessment.AssessEvidenceResponse, err error)
AssessEvidence is a method implementation of the assessment interface: It assesses a single evidence
func (*Service) AssessEvidences ¶
func (svc *Service) AssessEvidences(stream assessment.Assessment_AssessEvidencesServer) (err error)
AssessEvidences is a method implementation of the assessment interface: It assesses multiple evidences (stream) and responds with a stream.
func (*Service) MetricConfiguration ¶
func (svc *Service) MetricConfiguration(CertificationTargetID string, metric *assessment.Metric) (config *assessment.MetricConfiguration, err error)
MetricConfiguration implements MetricsSource by getting the corresponding metric configuration for the default target certification target
func (*Service) MetricImplementation ¶
func (svc *Service) MetricImplementation(lang assessment.MetricImplementation_Language, metric *assessment.Metric) (impl *assessment.MetricImplementation, err error)
MetricImplementation implements MetricsSource by retrieving the metric implementation from the orchestrator.
func (*Service) Metrics ¶
func (svc *Service) Metrics() (metrics []*assessment.Metric, err error)
Metrics implements MetricsSource by retrieving the metric list from the orchestrator.
func (*Service) RegisterAssessmentResultHook ¶
func (svc *Service) RegisterAssessmentResultHook(assessmentResultsHook func(ctx context.Context, result *assessment.AssessmentResult, err error))