diff --git a/backend/capellacollab/settings/configuration/models.py b/backend/capellacollab/settings/configuration/models.py index 5dbb91d2c..c1cbc1d03 100644 --- a/backend/capellacollab/settings/configuration/models.py +++ b/backend/capellacollab/settings/configuration/models.py @@ -5,6 +5,7 @@ import enum import typing as t import zoneinfo +from collections import abc as collections_abc import pydantic from croniter import croniter @@ -69,40 +70,40 @@ class CustomNavbarLink(NavbarLink): class NavbarConfiguration(core_pydantic.BaseModelStrict): - external_links: list[BuiltInNavbarLink | CustomNavbarLink] = ( - pydantic.Field( - default=( + external_links: collections_abc.Sequence[ + BuiltInNavbarLink | CustomNavbarLink + ] = pydantic.Field( + default=( + [ + BuiltInNavbarLink( + name="Grafana", + service=BuiltInLinkItem.GRAFANA, + role=users_models.Role.ADMIN, + ), + BuiltInNavbarLink( + name="Prometheus", + service=BuiltInLinkItem.PROMETHEUS, + role=users_models.Role.ADMIN, + ), + BuiltInNavbarLink( + name="Documentation", + service=BuiltInLinkItem.DOCUMENTATION, + role=users_models.Role.USER, + ), + ] + + ( [ BuiltInNavbarLink( - name="Grafana", - service=BuiltInLinkItem.GRAFANA, - role=users_models.Role.ADMIN, - ), - BuiltInNavbarLink( - name="Prometheus", - service=BuiltInLinkItem.PROMETHEUS, - role=users_models.Role.ADMIN, - ), - BuiltInNavbarLink( - name="Documentation", - service=BuiltInLinkItem.DOCUMENTATION, + name="SMTP Mock", + service=BuiltInLinkItem.SMTP_MOCK, role=users_models.Role.USER, - ), + ) ] - + ( - [ - BuiltInNavbarLink( - name="SMTP Mock", - service=BuiltInLinkItem.SMTP_MOCK, - role=users_models.Role.USER, - ) - ] - if core.DEVELOPMENT_MODE - else [] - ) - ), - description="Links to display in the navigation bar.", - ) + if core.DEVELOPMENT_MODE + else [] + ) + ), + description="Links to display in the navigation bar.", ) diff --git a/backend/capellacollab/tools/models.py b/backend/capellacollab/tools/models.py index b45a12a57..e9cf9377a 100644 --- a/backend/capellacollab/tools/models.py +++ b/backend/capellacollab/tools/models.py @@ -63,7 +63,7 @@ class ToolSessionEnvironment(core_pydantic.BaseModel): "'after' runs after the environment variable is JSON serialized, allowing to access a dict in the JSON format. " ), ) - value: str = pydantic.Field( + value: dict[str, str] = pydantic.Field( default={"RMT_PASSWORD": "{CAPELLACOLLAB_SESSION_TOKEN}"}, description=( "Environment variables, which are mounted into session containers. " diff --git a/frontend/src/app/openapi/model/guacamole-connection-method-input.ts b/frontend/src/app/openapi/model/guacamole-connection-method-input.ts index 2149f07d7..aa784f6a1 100644 --- a/frontend/src/app/openapi/model/guacamole-connection-method-input.ts +++ b/frontend/src/app/openapi/model/guacamole-connection-method-input.ts @@ -16,7 +16,7 @@ import { RDPPortsInput } from './rdp-ports-input'; export interface GuacamoleConnectionMethodInput { id?: string; - type?: GuacamoleConnectionMethodInput.TypeEnum; + type?: string; name?: string; description?: string; ports?: RDPPortsInput; @@ -26,11 +26,4 @@ export interface GuacamoleConnectionMethodInput { environment?: { [key: string]: EnvironmentValue; }; sharing?: ToolSessionSharingConfigurationInput; } -export namespace GuacamoleConnectionMethodInput { - export type TypeEnum = 'guacamole'; - export const TypeEnum = { - Guacamole: 'guacamole' as TypeEnum - }; -} - diff --git a/frontend/src/app/openapi/model/guacamole-connection-method-output.ts b/frontend/src/app/openapi/model/guacamole-connection-method-output.ts index 77faae740..893b1a3bf 100644 --- a/frontend/src/app/openapi/model/guacamole-connection-method-output.ts +++ b/frontend/src/app/openapi/model/guacamole-connection-method-output.ts @@ -16,7 +16,7 @@ import { EnvironmentValue1 } from './environment-value1'; export interface GuacamoleConnectionMethodOutput { id: string; - type: GuacamoleConnectionMethodOutput.TypeEnum; + type: string; name: string; description: string; ports: RDPPortsOutput; @@ -26,11 +26,4 @@ export interface GuacamoleConnectionMethodOutput { environment: { [key: string]: EnvironmentValue1; }; sharing: ToolSessionSharingConfigurationOutput; } -export namespace GuacamoleConnectionMethodOutput { - export type TypeEnum = 'guacamole'; - export const TypeEnum = { - Guacamole: 'guacamole' as TypeEnum - }; -} - diff --git a/frontend/src/app/openapi/model/http-connection-method-input.ts b/frontend/src/app/openapi/model/http-connection-method-input.ts index 3288c623b..d2f8ea9f7 100644 --- a/frontend/src/app/openapi/model/http-connection-method-input.ts +++ b/frontend/src/app/openapi/model/http-connection-method-input.ts @@ -16,7 +16,7 @@ import { HTTPPortsInput } from './http-ports-input'; export interface HTTPConnectionMethodInput { id?: string; - type?: HTTPConnectionMethodInput.TypeEnum; + type?: string; name?: string; description?: string; ports?: HTTPPortsInput; @@ -31,11 +31,4 @@ export interface HTTPConnectionMethodInput { */ cookies?: { [key: string]: string; }; } -export namespace HTTPConnectionMethodInput { - export type TypeEnum = 'http'; - export const TypeEnum = { - Http: 'http' as TypeEnum - }; -} - diff --git a/frontend/src/app/openapi/model/http-connection-method-output.ts b/frontend/src/app/openapi/model/http-connection-method-output.ts index 2264c081a..075bdd218 100644 --- a/frontend/src/app/openapi/model/http-connection-method-output.ts +++ b/frontend/src/app/openapi/model/http-connection-method-output.ts @@ -16,7 +16,7 @@ import { EnvironmentValue1 } from './environment-value1'; export interface HTTPConnectionMethodOutput { id: string; - type: HTTPConnectionMethodOutput.TypeEnum; + type: string; name: string; description: string; ports: HTTPPortsOutput; @@ -31,11 +31,4 @@ export interface HTTPConnectionMethodOutput { */ cookies: { [key: string]: string; }; } -export namespace HTTPConnectionMethodOutput { - export type TypeEnum = 'http'; - export const TypeEnum = { - Http: 'http' as TypeEnum - }; -} - diff --git a/frontend/src/app/openapi/model/tool-session-connection-input-methods-inner.ts b/frontend/src/app/openapi/model/tool-session-connection-input-methods-inner.ts index 2cd98e1f5..24f6f199c 100644 --- a/frontend/src/app/openapi/model/tool-session-connection-input-methods-inner.ts +++ b/frontend/src/app/openapi/model/tool-session-connection-input-methods-inner.ts @@ -18,7 +18,7 @@ import { HTTPPortsInput } from './http-ports-input'; export interface ToolSessionConnectionInputMethodsInner { id?: string; - type?: ToolSessionConnectionInputMethodsInner.TypeEnum; + type?: string; name?: string; description?: string; ports?: HTTPPortsInput; @@ -33,12 +33,4 @@ export interface ToolSessionConnectionInputMethodsInner { */ cookies?: { [key: string]: string; }; } -export namespace ToolSessionConnectionInputMethodsInner { - export type TypeEnum = 'guacamole' | 'http'; - export const TypeEnum = { - Guacamole: 'guacamole' as TypeEnum, - Http: 'http' as TypeEnum - }; -} - diff --git a/frontend/src/app/openapi/model/tool-session-connection-output-methods-inner.ts b/frontend/src/app/openapi/model/tool-session-connection-output-methods-inner.ts index aee12f9fa..e31d5889b 100644 --- a/frontend/src/app/openapi/model/tool-session-connection-output-methods-inner.ts +++ b/frontend/src/app/openapi/model/tool-session-connection-output-methods-inner.ts @@ -18,7 +18,7 @@ import { EnvironmentValue1 } from './environment-value1'; export interface ToolSessionConnectionOutputMethodsInner { id: string; - type: ToolSessionConnectionOutputMethodsInner.TypeEnum; + type: string; name: string; description: string; ports: HTTPPortsOutput; @@ -33,12 +33,4 @@ export interface ToolSessionConnectionOutputMethodsInner { */ cookies: { [key: string]: string; }; } -export namespace ToolSessionConnectionOutputMethodsInner { - export type TypeEnum = 'guacamole' | 'http'; - export const TypeEnum = { - Guacamole: 'guacamole' as TypeEnum, - Http: 'http' as TypeEnum - }; -} -