refactor(backend): config validation joi to zod

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2025-03-29 23:11:01 +01:00
parent 91ebd519a8
commit 926f7a5e49
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
37 changed files with 1299 additions and 994 deletions

View file

@ -67,11 +67,11 @@ describe('FrontendConfigService', () => {
identifier: 'oidcTestIdentifier',
providerName: 'oidcTestProviderName',
issuer: 'oidcTestIssuer',
clientID: 'oidcTestId',
clientId: 'oidcTestId',
clientSecret: 'oidcTestSecret',
scope: 'openid profile email',
userIdField: '',
userNameField: '',
usernameField: '',
displayNameField: '',
profilePictureField: '',
emailField: '',
@ -82,7 +82,7 @@ describe('FrontendConfigService', () => {
const appConfig: AppConfig = {
baseUrl: domain,
rendererBaseUrl: 'https://renderer.example.org',
port: 3000,
backendPort: 3000,
loglevel: Loglevel.ERROR,
showLogTimestamp: false,
persistInterval: 10,
@ -182,7 +182,7 @@ describe('FrontendConfigService', () => {
const appConfig: AppConfig = {
baseUrl: domain,
rendererBaseUrl: 'https://renderer.example.org',
port: 3000,
backendPort: 3000,
loglevel: Loglevel.ERROR,
showLogTimestamp: false,
persistInterval: 10,
@ -207,7 +207,7 @@ describe('FrontendConfigService', () => {
},
};
const externalServicesConfig: ExternalServicesConfig = {
plantUmlServer: plantUmlServer,
plantumlServer: plantUmlServer,
imageProxy: imageProxy,
};
const noteConfig: NoteConfig = {

View file

@ -52,8 +52,8 @@ export class FrontendConfigService {
authProviders: this.getAuthProviders(),
branding: this.getBranding(),
maxDocumentLength: this.noteConfig.maxDocumentLength,
plantUmlServer: this.externalServicesConfig.plantUmlServer
? new URL(this.externalServicesConfig.plantUmlServer).toString()
plantUmlServer: this.externalServicesConfig.plantumlServer
? new URL(this.externalServicesConfig.plantumlServer).toString()
: null,
specialUrls: this.getSpecialUrls(),
useImageProxy: !!this.externalServicesConfig.imageProxy,