Skip to content

Commit

Permalink
Merge branch 'main' into CA-826-make-score-read-only-in-entity-assess…
Browse files Browse the repository at this point in the history
…ment-questionnaire
  • Loading branch information
Mohamed-Hacene committed Feb 4, 2025
2 parents 03541ef + 805d408 commit 08cebca
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/frontend-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["main"]
paths:
- "frontend/**"
workflow_dispatch:

env:
GITHUB_WORKFLOW: github_actions
Expand Down Expand Up @@ -37,6 +38,9 @@ jobs:
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: pnpm i --frozen-lockfile
- name: Prepare sveltekit
working-directory: ${{env.working-directory}}
run: pnpm run prepare
- name: Run coverage
working-directory: ${{env.working-directory}}
run: pnpm run coverage
4 changes: 4 additions & 0 deletions .github/workflows/frontend-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- "frontend/**"
workflow_dispatch:

env:
GITHUB_WORKFLOW: github_actions
Expand Down Expand Up @@ -36,6 +37,9 @@ jobs:
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: pnpm i --frozen-lockfile
- name: Prepare sveltekit
working-directory: ${{env.working-directory}}
run: pnpm run prepare
- name: Run tests
working-directory: ${{env.working-directory}}
run: pnpm run test:ci
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,13 @@ The goal of the test harness is to prevent any regression, i.e. all the tests sh

## API and Swagger

- The API documentation is available in dev mode on the `<backend_endpoint>/api/schema/swagger/`, for instance <http://127.0.0.1:8000/api/schema/swagger/>
- The API is available only on dev mode. To get that, you need to switch on the backend, for instance, `export DJANGO_DEBUG=True`
- The API documentation will be available on `<backend_endpoint>/api/schema/swagger/`, for instance <http://127.0.0.1:8000/api/schema/swagger/>

To interact with it:

- call `/api/iam/login/` with your credentials in the body to get the token
- pass it then as a header `Authorization: Token {token}` for your next calls. Notice it's Token not Bearer.
- pass it then as a header `Authorization: Token {token}` for your next calls. Notice it's `Token` not `Bearer`.

## Setting CISO Assistant for production

Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"prepare": "svelte-kit sync",
"dev": "vite dev",
"build": "paraglide-js compile --project ./project.inlang && vite build",
"preview": "vite preview",
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/lib/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const NameDescriptionMixin = {

export const FolderSchema = z.object({
...NameDescriptionMixin,
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
parent_folder: z.string().optional()
});

Expand All @@ -78,7 +78,7 @@ export const FolderImportSchema = z.object({
export const ProjectSchema = z.object({
...NameDescriptionMixin,
folder: z.string(),
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
lc_status: z.string().optional().default('in_design')
});

Expand All @@ -98,7 +98,7 @@ export const RiskAssessmentSchema = z.object({
version: z.string().optional().default('0.1'),
project: z.string(),
status: z.string().optional().nullable(),
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
risk_matrix: z.string(),
eta: z.union([z.literal('').transform(() => null), z.string().date()]).nullish(),
due_date: z.union([z.literal('').transform(() => null), z.string().date()]).nullish(),
Expand All @@ -112,7 +112,7 @@ export const ThreatSchema = z.object({
...NameDescriptionMixin,
folder: z.string(),
provider: z.string().optional().nullable(),
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
annotation: z.string().optional().nullable()
});

Expand All @@ -134,12 +134,12 @@ export const RiskScenarioSchema = z.object({
assets: z.string().uuid().optional().array().optional(),
vulnerabilities: z.string().uuid().optional().array().optional(),
owner: z.string().uuid().optional().array().optional(),
ref_id: z.string().max(8).optional().nullable()
ref_id: z.string().max(8).optional()
});

export const AppliedControlSchema = z.object({
...NameDescriptionMixin,
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
category: z.string().optional().nullable(),
csf_function: z.string().optional().nullable(),
priority: z.number().optional().nullable(),
Expand Down Expand Up @@ -179,7 +179,7 @@ export const ReferenceControlSchema = z.object({
category: z.string().optional().nullable(),
csf_function: z.string().optional().nullable(),
folder: z.string(),
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
annotation: z.string().optional().nullable()
});

Expand Down Expand Up @@ -268,7 +268,7 @@ export const SetPasswordSchema = z.object({
export const ComplianceAssessmentSchema = z.object({
...NameDescriptionMixin,
version: z.string().optional().default('0.1'),
ref_id: z.string().optional().nullable(),
ref_id: z.string().optional(),
project: z.string(),
status: z.string().optional().nullable(),
selected_implementation_groups: z.array(z.string().optional()).optional(),
Expand Down

0 comments on commit 08cebca

Please sign in to comment.