Documentation ¶
Index ¶
- Constants
- Variables
- func CachedRequirementsSource(src policies.RequirementsSource) policies.RequirementsSource
- func WithOAuth2Authorizer(config *clientcredentials.Config) service.ServiceOption[Server]
- func WithRequirementsManagerAddress(address string, opts ...grpc.DialOption) service.ServiceOption[Server]
- func WithStorage(storage persistence.Storage) service.ServiceOption[Server]
- type Server
- func (srv *Server) Authorizer() api.Authorizer
- func (srv *Server) CalculateCompliance(_ context.Context, req *evaluation.CalculateComplianceRequest) (empty *emptypb.Empty, err error)
- func (srv *Server) GetCompliance(_ context.Context, request *evaluation.GetComplianceRequest) (compliance *evaluation.Compliance, err error)
- func (srv *Server) GetEvaluation(_ context.Context, request *evaluation.GetEvaluationRequest) (eval *evaluation.EvaluationResult, err error)
- func (srv *Server) GetEvidence(_ context.Context, req *evaluation.GetEvidenceRequest) (e *common.Evidence, err error)
- func (srv *Server) ListCompliance(_ context.Context, req *evaluation.ListComplianceRequest) (res *evaluation.ListComplianceResponse, err error)
- func (srv *Server) ListEvidences(_ context.Context, req *evaluation.ListEvidencesRequest) (res *evaluation.ListEvidencesResponse, err error)
- func (srv *Server) SendEvidences(stream evaluation.Evaluation_SendEvidencesServer) (err error)
- func (srv *Server) SetAuthorizer(auth api.Authorizer)
Constants ¶
const ( DatabaseErrorMsg = "DB error" EvidenceNotFoundErrorMsg = "No evidence found" NoEvidencesInDBErrorMsg = "There are no evidences for this service in the DB yet" ComplianceResultNotFoundErrorMsg = "Compliance result not found" )
const ( // DefaultListComplianceDays indicates the default value for `days` in the ListCompliance endpoint DefaultListComplianceDays = int64(30) // DefaultListEvidencesDays indicates the default value for `days` in the ListEvidences endpoint DefaultListEvidencesDays = int64(30) )
Variables ¶
var (
DefaultRequirementsManagerAddress = grpcTarget{/* contains filtered or unexported fields */}
)
Functions ¶
func CachedRequirementsSource ¶
func CachedRequirementsSource(src policies.RequirementsSource) policies.RequirementsSource
func WithOAuth2Authorizer ¶ added in v0.2.0
func WithOAuth2Authorizer(config *clientcredentials.Config) service.ServiceOption[Server]
WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer
func WithRequirementsManagerAddress ¶
func WithRequirementsManagerAddress(address string, opts ...grpc.DialOption) service.ServiceOption[Server]
WithRequirementsManagerAddress is a Server option for setting the address of the Requirements Manager
func WithStorage ¶
func WithStorage(storage persistence.Storage) service.ServiceOption[Server]
WithStorage is an option to set the storage. If not set, NewServer will use inmemory storage.
Types ¶
type Server ¶ added in v0.2.0
type Server struct { evaluation.UnimplementedEvaluationServer // Clouditor's assessment service *cl_service_assessment.Service // contains filtered or unexported fields }
func NewServer ¶
func NewServer(opts ...service.ServiceOption[Server]) (srv *Server)
NewServer creates a new evaluation Server/service
func (*Server) Authorizer ¶ added in v0.2.0
func (srv *Server) Authorizer() api.Authorizer
Authorizer implements UsesAuthorizer
func (*Server) CalculateCompliance ¶ added in v0.2.0
func (srv *Server) CalculateCompliance(_ context.Context, req *evaluation.CalculateComplianceRequest) (empty *emptypb.Empty, err error)
CalculateCompliance triggers the compliance calculation for a particular services and a set of controls. This will most likely be triggered by the Requirements Manager.
func (*Server) GetCompliance ¶ added in v0.2.0
func (srv *Server) GetCompliance(_ context.Context, request *evaluation.GetComplianceRequest) (compliance *evaluation.Compliance, err error)
GetCompliance returns the most recent compliance result for a particular control of a service
func (*Server) GetEvaluation ¶ added in v0.2.0
func (srv *Server) GetEvaluation(_ context.Context, request *evaluation.GetEvaluationRequest) (eval *evaluation.EvaluationResult, err error)
GetEvaluation returns the most recent evaluation result for given service and metric IDs
func (*Server) GetEvidence ¶ added in v0.2.0
func (srv *Server) GetEvidence(_ context.Context, req *evaluation.GetEvidenceRequest) (e *common.Evidence, err error)
GetEvidence returns the evidence given by evidence_id.
func (*Server) ListCompliance ¶ added in v0.2.0
func (srv *Server) ListCompliance(_ context.Context, req *evaluation.ListComplianceRequest) ( res *evaluation.ListComplianceResponse, err error)
ListCompliance returns all current compliance results for a particular service
func (*Server) ListEvidences ¶ added in v0.2.0
func (srv *Server) ListEvidences(_ context.Context, req *evaluation.ListEvidencesRequest) ( res *evaluation.ListEvidencesResponse, err error)
ListEvidences returns evidences. The amount of evidences per request and the scope are determined by the query parameters.
func (*Server) SendEvidences ¶ added in v0.2.0
func (srv *Server) SendEvidences(stream evaluation.Evaluation_SendEvidencesServer) (err error)
SendEvidences stores and evaluates evidences sent by a SendEvidencesClient via a stream
func (*Server) SetAuthorizer ¶ added in v0.2.0
func (srv *Server) SetAuthorizer(auth api.Authorizer)
SetAuthorizer implements UsesAuthorizer