Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/lib/api/evaluation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface EvaluationResult {

export async function startEvaluation(auditScope: AuditScope): Promise<StartEvaluationResponse> {
const apiUrl = clouditorize(
`/v1/evaluation/evaluate/${auditScope.certificationTargetId}/${auditScope.catalogId}/start`
`/v1/evaluation/evaluate/${auditScope.id}/start`
);

return fetch(apiUrl, {
Expand All @@ -47,7 +47,7 @@ export async function startEvaluation(auditScope: AuditScope): Promise<StartEval

export async function stopEvaluation(auditScope: AuditScope): Promise<{}> {
const apiUrl = clouditorize(
`/v1/evaluation/evaluate/${auditScope.certificationTargetId}/${auditScope.catalogId}/stop`
`/v1/evaluation/evaluate/${auditScope.id}/stop`
);

return fetch(apiUrl, {
Expand Down
81 changes: 41 additions & 40 deletions src/lib/api/orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface Tag {
tag: object;
}

export interface CertificationTarget {
export interface TargetOfEvaluation {
id: string;
name: string;
description?: string;
Expand All @@ -34,14 +34,15 @@ export interface CertificationTarget {
}

export interface AuditScope {
certificationTargetId: string;
id: string;
targetOfEvaluationId: string;
catalogId: string;
assuranceLevel?: string;
controlsInScope?: Control[];
}

export interface ControlInScope {
auditScopeCertificationTargetId: string;
auditScopeTargetOfEvaluationId: string;
auditScopeCatalogId: string;
controlId: string;
controlCategoryName: string;
Expand Down Expand Up @@ -104,7 +105,7 @@ export interface ListMetricConfigurationsResponse {
export interface Certificate {
id: string;
name: string;
certificationTargetId: string;
targetOfEvaluationId: string;
issueDate: string;
expirationDate: string;
standard: string;
Expand Down Expand Up @@ -138,8 +139,8 @@ export interface ListAssessmentResultsResponse {
results: AssessmentResult[];
}

export interface ListCertificationTargetsResponse {
targets: CertificationTarget[];
export interface ListTargetsOfEvaluationResponse {
targets: TargetOfEvaluation[];
}

export interface ListAuditScopesResponse {
Expand Down Expand Up @@ -202,12 +203,12 @@ export async function listAssessmentResults(
*
* @returns an array of {@link AssessmentResult}s.
*/
export async function listCertificationTargetAssessmentResults(
export async function listTargetOfEvaluationAssessmentResults(
serviceId: string,
fetch = window.fetch
): Promise<AssessmentResult[]> {
const apiUrl = clouditorize(
`/v1/orchestrator/assessment_results?pageSize=1000&filter.certificationTargetId=${serviceId}&orderBy=timestamp&asc=false`
`/v1/orchestrator/assessment_results?pageSize=1000&filter.targetOfEvaluationId=${serviceId}&orderBy=timestamp&asc=false`
);

return fetch(apiUrl, {
Expand Down Expand Up @@ -270,7 +271,7 @@ export async function getMetricImplementation(id: string): Promise<MetricImpleme
/**
* Retrieves a particular metric configuration from the orchestrator service.
*
* @param serviceId the Certification Target ID
* @param serviceId the Target of Evaluation ID
* @param metricId the metric id
* @returns metric configuration
*/
Expand All @@ -279,7 +280,7 @@ export async function getMetricConfiguration(
metricId: string
): Promise<MetricConfiguration> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${serviceId}/metric_configurations/${metricId}`
`/v1/orchestrator/targets_of_evaluation/${serviceId}/metric_configurations/${metricId}`
);

return fetch(apiUrl, {
Expand All @@ -305,7 +306,7 @@ export async function listMetricConfigurations(
serviceId: string,
skipDefault = false
): Promise<Map<string, MetricConfiguration>> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${serviceId}/metric_configurations`);
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation/${serviceId}/metric_configurations`);

return fetch(apiUrl, {
method: 'GET',
Expand All @@ -329,10 +330,10 @@ export async function listMetricConfigurations(
}

/**
* Creates a new certification target
* Creates a new target of evaluation
*/
export async function registerCertificationTarget(service: CertificationTarget): Promise<CertificationTarget> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets`);
export async function registerTargetOfEvaluation(service: TargetOfEvaluation): Promise<TargetOfEvaluation> {
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation`);

return fetch(apiUrl, {
method: 'POST',
Expand All @@ -343,16 +344,16 @@ export async function registerCertificationTarget(service: CertificationTarget):
})
.then(throwError)
.then((res) => res.json())
.then((response: CertificationTarget) => {
.then((response: TargetOfEvaluation) => {
return response;
});
}

/**
* Removes a certification target.
* Removes a target of evaluation.
*/
export async function removeCertificationTarget(targetId: string): Promise<void> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${targetId}`);
export async function removeTargetOfEvaluation(targetId: string): Promise<void> {
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation/${targetId}`);

return fetch(apiUrl, {
method: 'DELETE',
Expand All @@ -365,12 +366,12 @@ export async function removeCertificationTarget(targetId: string): Promise<void>
}

/**
* Retrieves a list of certification targets from the orchestrator service.
* Retrieves a list of targets of evaluation from the orchestrator service.
*
* @returns an array of {@link CertificationTarget}s.
* @returns an array of {@link TargetOfEvaluation}s.
*/
export async function listCertificationTargets(fetch = window.fetch): Promise<CertificationTarget[]> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets`);
export async function listTargetsOfEvaluation(fetch = window.fetch): Promise<TargetOfEvaluation[]> {
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation`);

return fetch(apiUrl, {
method: 'GET',
Expand All @@ -380,7 +381,7 @@ export async function listCertificationTargets(fetch = window.fetch): Promise<Ce
})
.then(throwError)
.then((res) => res.json())
.then((response: ListCertificationTargetsResponse) => {
.then((response: ListTargetsOfEvaluationResponse) => {
return response.targets;
});
}
Expand Down Expand Up @@ -411,7 +412,7 @@ export async function removeAuditScope(
target: AuditScope
): Promise<AuditScope> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${target.certificationTargetId}/audit_scopes/${target.catalogId}`
`/v1/orchestrator/audit_scopes/${target.id}`
);

return fetch(apiUrl, {
Expand All @@ -433,7 +434,7 @@ export async function addControlToScope(
fetch = window.fetch
): Promise<ControlInScope> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${scope.auditScopeCertificationTargetId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope`
`/v1/orchestrator/targets_of_evaluation/${scope.auditScopeTargetOfEvaluationId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope`
);

return fetch(apiUrl, {
Expand All @@ -458,7 +459,7 @@ export async function removeControlFromScope(
fetch = window.fetch
): Promise<ControlInScope> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${scope.auditScopeCertificationTargetId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope/categories/${scope.controlCategoryName}/controls/${scope.controlId}`
`/v1/orchestrator/targets_of_evaluation/${scope.auditScopeTargetOfEvaluationId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope/categories/${scope.controlCategoryName}/controls/${scope.controlId}`
);

return fetch(apiUrl, {
Expand All @@ -480,7 +481,7 @@ export async function listAuditScopes(
serviceId: string,
fetch = window.fetch
): Promise<AuditScope[]> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${serviceId}/audit_scopes`);
const apiUrl = clouditorize(`/v1/orchestrator/audit_scopes`);

return fetch(apiUrl, {
method: 'GET',
Expand All @@ -506,7 +507,7 @@ export async function listControlsInScope(
fetch = window.fetch
): Promise<ControlInScope[]> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${serviceId}/audit_scopes/${catalogId}/controls_in_scope?pageSize=1500&orderBy=control_id&asc=true`
`/v1/orchestrator/targets_of_evaluation/${serviceId}/audit_scopes/${catalogId}/controls_in_scope?pageSize=1500&orderBy=control_id&asc=true`
);

return fetch(apiUrl, {
Expand Down Expand Up @@ -605,12 +606,12 @@ export async function listControls(
}

/**
* Retrieve a certification target from the orchestrator service using its ID.
* Retrieve a target of evaluation from the orchestrator service using its ID.
*
* @returns the certification target
* @returns the target of evaluation
*/
export async function getCertificationTarget(id: string, fetch = window.fetch): Promise<CertificationTarget> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${id}`);
export async function getTargetOfEvaluation(id: string, fetch = window.fetch): Promise<TargetOfEvaluation> {
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation/${id}`);

return fetch(apiUrl, {
method: 'GET',
Expand All @@ -622,11 +623,11 @@ export async function getCertificationTarget(id: string, fetch = window.fetch):
.then((res) => res.json());
}

export async function updateCertificationTarget(
service: CertificationTarget,
export async function updateTargetOfEvaluation(
service: TargetOfEvaluation,
fetch = window.fetch
): Promise<CertificationTarget> {
const apiUrl = clouditorize(`/v1/orchestrator/certification_targets/${service.id}`);
): Promise<TargetOfEvaluation> {
const apiUrl = clouditorize(`/v1/orchestrator/targets_of_evaluation/${service.id}`);

return fetch(apiUrl, {
method: 'PUT',
Expand All @@ -637,17 +638,17 @@ export async function updateCertificationTarget(
})
.then(throwError)
.then((res) => res.json())
.then((response: CertificationTarget) => {
.then((response: TargetOfEvaluation) => {
return response;
});
}

export async function updateControlInScope(
scope: ControlInScope,
fetch = window.fetch
): Promise<CertificationTarget> {
): Promise<TargetOfEvaluation> {
const apiUrl = clouditorize(
`/v1/orchestrator/certification_targets/${scope.auditScopeCertificationTargetId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope/categories/${scope.controlCategoryName}/controls/${scope.controlId}`
`/v1/orchestrator/targets_of_evaluation/${scope.auditScopeTargetOfEvaluationId}/audit_scopes/${scope.auditScopeCatalogId}/controls_in_scope/categories/${scope.controlCategoryName}/controls/${scope.controlId}`
);

return fetch(apiUrl, {
Expand All @@ -659,7 +660,7 @@ export async function updateControlInScope(
})
.then(throwError)
.then((res) => res.json())
.then((response: CertificationTarget) => {
.then((response: TargetOfEvaluation) => {
return response;
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/CatalogComplianceItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<li class="overflow-hidden rounded-xl border border-gray-200">
<div class="flex items-center justify-between gap-x-4 border-b border-gray-900/5 bg-gray-50 p-6">
<a href={'/cloud/' + auditScope.certificationTargetId + '/compliance/' + catalog.id}>
<a href={'/cloud/' + auditScope.targetOfEvaluationId + '/compliance/' + catalog.id}>
<div class="text-sm font-medium leading-6 text-gray-900">{catalog.name}</div>
<div class="text-sm text-gray-500">{catalog.description}</div>
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ComplianceChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
params.append('status', s);
}

goto(`/cloud/${auditScope.certificationTargetId}/compliance/${auditScope.catalogId}?${params.toString()}`);
goto(`/cloud/${auditScope.targetOfEvaluationId}/compliance/${auditScope.catalogId}?${params.toString()}`);
}
};
});
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/Sidebar.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import type { CertificationTarget } from '$lib/api/orchestrator';
import type { TargetOfEvaluation } from '$lib/api/orchestrator';
import NavigationItem from '$lib/components/NavigationItem.svelte';
import {
AdjustmentsHorizontal,
Expand All @@ -11,14 +11,14 @@
} from '@steeze-ui/heroicons';
import { Icon } from '@steeze-ui/svelte-icon';

export let services: CertificationTarget[];
export let services: TargetOfEvaluation[];
export let mobile: boolean = false;

// Build navigation menu with dynamic components
$: navigation = [
{ name: 'Dashboard', href: '/dashboard', icon: Home, disabled: true },
{
name: 'Certification Targets',
name: 'Targets of Evaluation',
href: '/cloud',
icon: Folder,
children: [
Expand Down
12 changes: 6 additions & 6 deletions src/lib/components/Wizard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// WizardData contains all the data that the wizard creates, such as the cloud
// service, its meta-data and optionally some target of evaluations.
export interface WizardData {
service: CertificationTarget;
service: TargetOfEvaluation;
catalogs: Catalog[];
auditScopes: AuditScope[];
mode: 'create' | 'edit';
Expand All @@ -16,7 +16,7 @@
import WizardStepInfo from './WizardStepInfo.svelte';
import WizardStepSave from './WizardStepSave.svelte';
import WizardStepCatalog from './WizardStepCatalog.svelte';
import type { Catalog, CertificationTarget, AuditScope } from '$lib/api/orchestrator';
import type { Catalog, TargetOfEvaluation, AuditScope } from '$lib/api/orchestrator';
import type { SvelteComponent } from 'svelte';

export let current: number = 0;
Expand All @@ -34,14 +34,14 @@
content: typeof SvelteComponent;
}[] = [
{
name: 'Create certification target',
description: 'Please provide a name for the certification target.',
name: 'Create target of evaluation',
description: 'Please provide a name for the target of evaluation.',
href: '?step=0',
content: WizardStepName
},
{
name: 'Service information',
description: 'Optionally specify additional information about the certification target.',
description: 'Optionally specify additional information about the target of evaluation.',
href: '?step=1',
content: WizardStepInfo
},
Expand All @@ -53,7 +53,7 @@
},
{
name: 'Confirm',
description: 'Confirm creation of certification target.',
description: 'Confirm creation of target of evaluation.',
href: '?step=3',
content: WizardStepSave
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/WizardStepCatalog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
catalogId: catalog.id,
// This will not be the final ID, since we do not know it at this point.
// This needs to be set by the caller of save()
certificationTargetId: data.service.id,
targetOfEvaluationId: data.service.id,
assuranceLevel: assuranceLevel
};

Expand Down
Loading