Documentation ¶
Index ¶
- Variables
- func NewAnotherCloudService() *orchestrator.CloudService
- func NewCatalog() *orchestrator.Catalog
- func NewCertificate() *orchestrator.Certificate
- func NewCloudService() *orchestrator.CloudService
- func NewTargetOfEvaluation(assuranceLevel string) *orchestrator.TargetOfEvaluation
- func NewTargetOfEvaluationWithoutControlsInScope(assuranceLevel string) *orchestrator.TargetOfEvaluation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MockAssessmentResultRequest1 = &orchestrator.GetAssessmentResultRequest{ Id: testdata.MockAssessmentResult1ID, } MockAssessmentResultRequest2 = &orchestrator.GetAssessmentResultRequest{ Id: testdata.MockAssessmentResult2ID, } MockAssessmentResult1 = &assessment.AssessmentResult{ Id: testdata.MockAssessmentResult1ID, Timestamp: timestamppb.New(time.Unix(1, 0)), CloudServiceId: testdata.MockCloudServiceID, MetricId: testdata.MockMetricID, Compliant: true, EvidenceId: testdata.MockEvidenceID, ResourceId: testdata.MockResourceID, ResourceTypes: []string{"Resource"}, MetricConfiguration: &assessment.MetricConfiguration{ Operator: "==", TargetValue: structpb.NewBoolValue(true), IsDefault: true, MetricId: testdata.MockMetricID, CloudServiceId: testdata.MockCloudServiceID, }, } MockAssessmentResult2 = &assessment.AssessmentResult{ Id: testdata.MockAssessmentResult2ID, Timestamp: timestamppb.New(time.Unix(1, 0)), CloudServiceId: testdata.MockAnotherCloudServiceID, MetricId: testdata.MockMetricID, Compliant: true, EvidenceId: testdata.MockEvidenceID, ResourceId: testdata.MockResourceID, ResourceTypes: []string{"Resource"}, MetricConfiguration: &assessment.MetricConfiguration{ Operator: "==", TargetValue: structpb.NewBoolValue(true), IsDefault: true, MetricId: testdata.MockMetricID, CloudServiceId: testdata.MockAnotherCloudServiceID, }, } MockAssessmentResult3 = &assessment.AssessmentResult{ Id: testdata.MockAssessmentResult3ID, Timestamp: timestamppb.New(time.Unix(1, 0)), CloudServiceId: testdata.MockCloudServiceID, MetricId: testdata.MockAnotherMetricID, Compliant: false, EvidenceId: testdata.MockEvidenceID, ResourceId: testdata.MockResourceID, ResourceTypes: []string{"Resource"}, MetricConfiguration: &assessment.MetricConfiguration{ Operator: "==", TargetValue: structpb.NewBoolValue(true), IsDefault: true, MetricId: testdata.MockAnotherMetricID, CloudServiceId: testdata.MockCloudServiceID, }, } MockAssessmentResult4 = &assessment.AssessmentResult{ Id: testdata.MockAssessmentResult4ID, Timestamp: timestamppb.New(time.Unix(1, 0)), CloudServiceId: testdata.MockAnotherCloudServiceID, MetricId: testdata.MockAnotherMetricID, Compliant: false, EvidenceId: testdata.MockEvidenceID, ResourceId: testdata.MockAnotherResourceID, ResourceTypes: []string{"Resource"}, MetricConfiguration: &assessment.MetricConfiguration{ Operator: "==", TargetValue: structpb.NewBoolValue(true), IsDefault: true, MetricId: testdata.MockAnotherMetricID, CloudServiceId: testdata.MockAnotherCloudServiceID, }, } MockAssessmentResults = []*assessment.AssessmentResult{MockAssessmentResult1, MockAssessmentResult2, MockAssessmentResult3, MockAssessmentResult4} MockControl1 = &orchestrator.Control{ Id: testdata.MockControlID1, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, Controls: []*orchestrator.Control{ { Id: testdata.MockSubControlID11, Name: testdata.MockSubControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockSubControlDescription, AssuranceLevel: &testdata.AssuranceLevelBasic, ParentControlId: util.Ref(testdata.MockControlID1), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}}, }} MockControl11 = &orchestrator.Control{ Id: testdata.MockSubControlID11, Name: testdata.MockSubControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockSubControlDescription, AssuranceLevel: &testdata.AssuranceLevelBasic, ParentControlId: util.Ref(testdata.MockControlID1), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }, }} MockControl2 = &orchestrator.Control{ Id: testdata.MockControlID2, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, Controls: []*orchestrator.Control{ { Id: testdata.MockSubControlID21, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelBasic, ParentControlId: util.Ref(testdata.MockControlID2), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}}, }} MockControl3 = &orchestrator.Control{ Id: testdata.MockControlID3, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, Controls: []*orchestrator.Control{ { Id: testdata.MockSubControlID31, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelSubstantial, ParentControlId: util.Ref(testdata.MockControlID3), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), }}, } MockControl4 = &orchestrator.Control{ Id: testdata.MockControlID4, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelHigh, Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}, } MockControl5 = &orchestrator.Control{ Id: testdata.MockControlID5, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: nil, Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}, } // Control without sub-control MockControl6 = &orchestrator.Control{ Id: testdata.MockControlID1, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, } MockControls = []*orchestrator.Control{MockControl1, MockControl2, MockControl3, MockControl4, MockControl5} MockControlsInScope1 = &orchestrator.Control{ Id: testdata.MockControlID1, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, } MockControlsInScopeSubControl11 = &orchestrator.Control{ Id: testdata.MockSubControlID11, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelBasic, ParentControlId: util.Ref(testdata.MockControlID1), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}} MockControlsInScope2 = &orchestrator.Control{ Id: testdata.MockControlID2, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, } MockControlsInScopeSubControl21 = &orchestrator.Control{ Id: testdata.MockSubControlID21, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelBasic, ParentControlId: util.Ref(testdata.MockControlID2), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}, } MockControlsInScope3 = &orchestrator.Control{ Id: testdata.MockControlID3, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, } MockControlsInScopeSubControl31 = &orchestrator.Control{ Id: testdata.MockSubControlID31, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelSubstantial, ParentControlId: util.Ref(testdata.MockControlID3), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), } MockControlsInScopeSubControl32 = &orchestrator.Control{ Id: testdata.MockSubControlID32, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelHigh, ParentControlId: util.Ref(testdata.MockControlID3), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), } MockControlsInScope4 = &orchestrator.Control{ Id: testdata.MockControlID4, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, Metrics: []*assessment.Metric{}, } MockControlsInScopeSubControl4 = &orchestrator.Control{ Id: testdata.MockSubControlID32, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: &testdata.AssuranceLevelSubstantial, ParentControlId: util.Ref(testdata.MockControlID3), ParentControlCategoryName: util.Ref(testdata.MockCategoryName), ParentControlCategoryCatalogId: util.Ref(testdata.MockCatalogID), } MockControlsInScope5 = &orchestrator.Control{ Id: testdata.MockControlID5, Name: testdata.MockControlName, CategoryName: testdata.MockCategoryName, CategoryCatalogId: testdata.MockCatalogID, Description: testdata.MockControlDescription, AssuranceLevel: nil, Metrics: []*assessment.Metric{{ Id: testdata.MockMetricID, Name: testdata.MockMetricName, Description: testdata.MockMetricDescription, Scale: assessment.Metric_ORDINAL, Range: &assessment.Range{ Range: &assessment.Range_AllowedValues{ AllowedValues: &assessment.AllowedValues{ Values: []*structpb.Value{ structpb.NewBoolValue(false), structpb.NewBoolValue(true), }, }, }, }, }}, } MockControlsInScope = []*orchestrator.Control{MockControlsInScope1, MockControlsInScopeSubControl11, MockControlsInScope2, MockControlsInScopeSubControl21, MockControlsInScope3, MockControlsInScopeSubControl31, MockControlsInScope4, MockControlsInScope5, MockControlsInScopeSubControl32} )
Functions ¶
func NewAnotherCloudService ¶
func NewAnotherCloudService() *orchestrator.CloudService
func NewCertificate ¶
func NewCertificate() *orchestrator.Certificate
NewCertificate creates a mock certificate
func NewCloudService ¶
func NewCloudService() *orchestrator.CloudService
func NewTargetOfEvaluation ¶
func NewTargetOfEvaluation(assuranceLevel string) *orchestrator.TargetOfEvaluation
NewTargetOfEvaluation creates a new Target of Evaluation. The assurance level is set if available.
func NewTargetOfEvaluationWithoutControlsInScope ¶
func NewTargetOfEvaluationWithoutControlsInScope(assuranceLevel string) *orchestrator.TargetOfEvaluation
NewTargetOfEvaluationWithoutControlsInScope creates a new Target of Evaluation without controls_in_scope. The assurance level is set if available.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.