From 667871aa9fa9fec3c7312c93faf7da2af690a9f3 Mon Sep 17 00:00:00 2001 From: eric-intuitem <71850047+eric-intuitem@users.noreply.github.com> Date: Mon, 1 Apr 2024 00:06:10 +0200 Subject: [PATCH] wip --- frontend/src/hooks.server.ts | 5 +++++ frontend/src/routes/{ => [client]}/(app)/+error.svelte | 0 frontend/src/routes/{ => [client]}/(app)/+layout.server.ts | 0 frontend/src/routes/{ => [client]}/(app)/+layout.svelte | 2 +- frontend/src/routes/{ => [client]}/(app)/+page.server.ts | 0 frontend/src/routes/{ => [client]}/(app)/+page.svelte | 0 .../{ => [client]}/(app)/[model=urlmodel]/+layout.server.ts | 0 .../{ => [client]}/(app)/[model=urlmodel]/+page.server.ts | 0 .../{ => [client]}/(app)/[model=urlmodel]/+page.svelte | 0 .../routes/{ => [client]}/(app)/[model=urlmodel]/+server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/+layout.server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/+page.server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/+page.svelte | 0 .../(app)/[model=urlmodel]/[id=uuid]/+server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/edit/+layout.svelte | 0 .../(app)/[model=urlmodel]/[id=uuid]/edit/+page.server.ts | 0 .../(app)/[model=urlmodel]/[id=uuid]/edit/+page.svelte | 0 .../{ => [client]}/(app)/analyses-registry/+page.server.ts | 0 .../{ => [client]}/(app)/analyses-registry/+page.svelte | 0 .../src/routes/{ => [client]}/(app)/analytics/+layout.svelte | 0 .../routes/{ => [client]}/(app)/analytics/+page.server.ts | 0 .../src/routes/{ => [client]}/(app)/analytics/+page.svelte | 0 .../{ => [client]}/(app)/analytics/ComposerSelect.svelte | 0 .../routes/{ => [client]}/(app)/analytics/CounterCard.svelte | 0 .../{ => [client]}/(app)/analytics/composer/+page.server.ts | 0 .../{ => [client]}/(app)/analytics/composer/+page.svelte | 0 .../{ => [client]}/(app)/backup-restore/+layout.svelte | 0 .../{ => [client]}/(app)/backup-restore/+page.server.ts | 0 .../routes/{ => [client]}/(app)/backup-restore/+page.svelte | 0 .../{ => [client]}/(app)/backup-restore/dump-db/+server.ts | 0 .../src/routes/{ => [client]}/(app)/calendar/+page.server.ts | 0 .../src/routes/{ => [client]}/(app)/calendar/+page.svelte | 0 .../(app)/compliance-assessments/[id=uuid]/+page.server.ts | 0 .../(app)/compliance-assessments/[id=uuid]/+page.svelte | 0 .../[id=uuid]/TreeViewItemContent.svelte | 0 .../compliance-assessments/[id=uuid]/TreeViewItemLead.svelte | 0 .../(app)/compliance-assessments/[id=uuid]/export/+server.ts | 0 .../(app)/compliance-assessments/[id=uuid]/types.ts | 0 .../(app)/compliance-assessments/[id=uuid]/utils.ts | 0 .../{ => [client]}/(app)/evidences/[id=uuid]/+page.server.ts | 0 .../{ => [client]}/(app)/evidences/[id=uuid]/+page.svelte | 0 .../(app)/evidences/[id=uuid]/attachment/+server.ts | 0 .../(app)/frameworks/[id=uuid]/+page.server.ts | 0 .../{ => [client]}/(app)/frameworks/[id=uuid]/+page.svelte | 0 .../(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte | 0 .../(app)/frameworks/[id=uuid]/TreeViewItemLead.svelte | 0 .../routes/{ => [client]}/(app)/libraries/+page.server.ts | 0 .../src/routes/{ => [client]}/(app)/libraries/+page.svelte | 0 .../{ => [client]}/(app)/libraries/[id=urn]/+page.server.ts | 0 .../{ => [client]}/(app)/libraries/[id=urn]/+page.svelte | 0 .../routes/{ => [client]}/(app)/libraries/[id=urn]/+page.ts | 0 .../{ => [client]}/(app)/libraries/[id=urn]/+server.ts | 0 .../{ => [client]}/(app)/libraries/[id=urn]/tree/+server.ts | 0 .../{ => [client]}/(app)/license-management/+page.server.ts | 0 .../{ => [client]}/(app)/license-management/+page.svelte | 0 .../src/routes/{ => [client]}/(app)/my-profile/+page.svelte | 0 .../(app)/my-profile/change-password/+page.server.ts | 0 .../(app)/my-profile/change-password/+page.svelte | 0 .../(app)/requirement-assessments/[id=uuid]/+page.server.ts | 0 .../(app)/requirement-assessments/[id=uuid]/+page.svelte | 0 .../(app)/risk-assessments/[id=uuid]/+layout.server.ts | 0 .../(app)/risk-assessments/[id=uuid]/+page.server.ts | 0 .../(app)/risk-assessments/[id=uuid]/+page.svelte | 0 .../(app)/risk-assessments/[id=uuid]/export/csv/+server.ts | 0 .../(app)/risk-assessments/[id=uuid]/export/pdf/+server.ts | 0 .../(app)/risk-assessments/[id=uuid]/plan/+page.server.ts | 0 .../(app)/risk-assessments/[id=uuid]/plan/+page.svelte | 0 .../risk-assessments/[id=uuid]/plan/export/csv/+server.ts | 0 .../risk-assessments/[id=uuid]/plan/export/pdf/+server.ts | 0 .../(app)/risk-matrices/[id=uuid]/+layout.server.ts | 0 .../(app)/risk-matrices/[id=uuid]/+layout.svelte | 0 .../(app)/risk-matrices/[id=uuid]/+page.svelte | 0 .../{ => [client]}/(app)/risk-matrices/[id=uuid]/+server.ts | 0 .../(app)/risk-scenarios/[id=uuid]/+page.server.ts | 0 .../(app)/risk-scenarios/[id=uuid]/+page.svelte | 0 .../(app)/risk-scenarios/[id=uuid]/edit/+page.server.ts | 0 .../(app)/risk-scenarios/[id=uuid]/edit/+page.svelte | 0 .../(app)/risk-scenarios/[id=uuid]/edit/RiskLevel.svelte | 0 .../{ => [client]}/(app)/scoring-assistant/+page.server.ts | 0 .../{ => [client]}/(app)/scoring-assistant/+page.svelte | 0 .../{ => [client]}/(app)/scoring-assistant/selector.svelte | 0 .../routes/{ => [client]}/(app)/scoring-assistant/utils.ts | 0 .../(app)/users/[id=uuid]/edit/+page.server.ts | 0 .../{ => [client]}/(app)/users/[id=uuid]/edit/+page.svelte | 0 .../(app)/users/[id=uuid]/edit/set-password/+page.server.ts | 0 .../(app)/users/[id=uuid]/edit/set-password/+page.svelte | 0 .../src/routes/{ => [client]}/(app)/x-rays/+page.server.ts | 0 frontend/src/routes/{ => [client]}/(app)/x-rays/+page.svelte | 0 .../(authentication)/first-connexion/+page.server.ts | 0 .../(authentication)/first-connexion/+page.svelte | 0 .../{ => [client]}/(authentication)/login/+page.server.ts | 4 ++-- .../{ => [client]}/(authentication)/login/+page.svelte | 0 .../routes/{ => [client]}/(authentication)/logout/+server.ts | 0 .../(authentication)/password-reset/+page.server.ts | 0 .../(authentication)/password-reset/+page.svelte | 0 .../(authentication)/password-reset/confirm/+page.server.ts | 0 .../(authentication)/password-reset/confirm/+page.svelte | 0 98 files changed, 8 insertions(+), 3 deletions(-) rename frontend/src/routes/{ => [client]}/(app)/+error.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/+layout.svelte (97%) rename frontend/src/routes/{ => [client]}/(app)/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/edit/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/edit/+layout.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/edit/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/[model=urlmodel]/[id=uuid]/edit/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analyses-registry/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/analyses-registry/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/+layout.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/ComposerSelect.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/CounterCard.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/composer/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/analytics/composer/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/backup-restore/+layout.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/backup-restore/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/backup-restore/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/backup-restore/dump-db/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/calendar/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/calendar/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/TreeViewItemContent.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/TreeViewItemLead.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/export/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/types.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/compliance-assessments/[id=uuid]/utils.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/evidences/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/evidences/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/evidences/[id=uuid]/attachment/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/frameworks/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/frameworks/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/frameworks/[id=uuid]/TreeViewItemContent.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/frameworks/[id=uuid]/TreeViewItemLead.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/[id=urn]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/[id=urn]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/[id=urn]/+page.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/[id=urn]/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/libraries/[id=urn]/tree/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/license-management/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/license-management/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/my-profile/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/my-profile/change-password/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/my-profile/change-password/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/requirement-assessments/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/requirement-assessments/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/export/csv/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/export/pdf/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/plan/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/plan/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/plan/export/csv/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-assessments/[id=uuid]/plan/export/pdf/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-matrices/[id=uuid]/+layout.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-matrices/[id=uuid]/+layout.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-matrices/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-matrices/[id=uuid]/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-scenarios/[id=uuid]/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-scenarios/[id=uuid]/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-scenarios/[id=uuid]/edit/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-scenarios/[id=uuid]/edit/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/risk-scenarios/[id=uuid]/edit/RiskLevel.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/scoring-assistant/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/scoring-assistant/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/scoring-assistant/selector.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/scoring-assistant/utils.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/users/[id=uuid]/edit/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/users/[id=uuid]/edit/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/users/[id=uuid]/edit/set-password/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/users/[id=uuid]/edit/set-password/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(app)/x-rays/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(app)/x-rays/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(authentication)/first-connexion/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(authentication)/first-connexion/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(authentication)/login/+page.server.ts (97%) rename frontend/src/routes/{ => [client]}/(authentication)/login/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(authentication)/logout/+server.ts (100%) rename frontend/src/routes/{ => [client]}/(authentication)/password-reset/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(authentication)/password-reset/+page.svelte (100%) rename frontend/src/routes/{ => [client]}/(authentication)/password-reset/confirm/+page.server.ts (100%) rename frontend/src/routes/{ => [client]}/(authentication)/password-reset/confirm/+page.svelte (100%) diff --git a/frontend/src/hooks.server.ts b/frontend/src/hooks.server.ts index c61d4c9bc..69c498d92 100644 --- a/frontend/src/hooks.server.ts +++ b/frontend/src/hooks.server.ts @@ -2,6 +2,11 @@ import { BASE_API_URL } from '$lib/utils/constants'; import type { User } from '$lib/utils/types'; import { redirect, type Handle, type RequestEvent, type HandleFetch } from '@sveltejs/kit'; +export const rewriteUrl = (url: string): string => { + console.log("coucou", url) + return url; +} + async function ensureCsrfToken(event: RequestEvent): Promise { let csrfToken = event.cookies.get('csrftoken') || ''; if (!csrfToken) { diff --git a/frontend/src/routes/(app)/+error.svelte b/frontend/src/routes/[client]/(app)/+error.svelte similarity index 100% rename from frontend/src/routes/(app)/+error.svelte rename to frontend/src/routes/[client]/(app)/+error.svelte diff --git a/frontend/src/routes/(app)/+layout.server.ts b/frontend/src/routes/[client]/(app)/+layout.server.ts similarity index 100% rename from frontend/src/routes/(app)/+layout.server.ts rename to frontend/src/routes/[client]/(app)/+layout.server.ts diff --git a/frontend/src/routes/(app)/+layout.svelte b/frontend/src/routes/[client]/(app)/+layout.svelte similarity index 97% rename from frontend/src/routes/(app)/+layout.svelte rename to frontend/src/routes/[client]/(app)/+layout.svelte index 61f1ed572..727192f76 100644 --- a/frontend/src/routes/(app)/+layout.svelte +++ b/frontend/src/routes/[client]/(app)/+layout.svelte @@ -1,6 +1,6 @@