From 8a937e2eba20d6a828aeb01a928c22e8d3e7cc76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Thu, 2 Nov 2023 13:06:58 +0100 Subject: [PATCH] Config => Add gitlab secret --- ExpressAPI/src/config/Config.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ExpressAPI/src/config/Config.ts b/ExpressAPI/src/config/Config.ts index 574f9b2..369959d 100644 --- a/ExpressAPI/src/config/Config.ts +++ b/ExpressAPI/src/config/Config.ts @@ -19,8 +19,12 @@ class Config { secret: string; expiresIn: number; }; - public readonly permissions: { - teachingStaff: Array<string>; + public readonly login: { + gitlab: { + client: { + secret: string + } + } }; public readonly gitlab: { @@ -35,9 +39,6 @@ class Config { maxSameName: number; resultsFolder: string, pipelineResultsFolder: string; default: { description: string; visibility: string; }; }; - public readonly userPasswordLength: number; - public readonly userPasswordSaltRounds: number; - constructor() { this.api = { port: Number(process.env.API_PORT || 30992) @@ -50,8 +51,12 @@ class Config { expiresIn: Number(process.env.SESSION_TIMEOUT || 0) }; - this.permissions = { - teachingStaff: JSON5.parse(process.env.ROLES_WITH_TEACHING_STAFF_PERMISSIONS || '[]') + this.login = { + gitlab: { + client: { + secret: process.env.LOGIN_GITLAB_CLIENT_SECRET || '' + } + } }; this.gitlab = { @@ -97,9 +102,6 @@ class Config { visibility : process.env.EXERCISE_DEFAULT_VISIBILITY || GitlabVisibility.PRIVATE } }; - - this.userPasswordLength = Number(process.env.USER_PASSWORD_LENGTH || 0); - this.userPasswordSaltRounds = Number(process.env.USER_PASSWORD_SALT_ROUNDS || 10); } public getResultsFolder(exercise: Exercise): string { -- GitLab