From 7a41cce94feaf7f4680e772da994ce89526aa416 Mon Sep 17 00:00:00 2001 From: Yannick Bungers Date: Sat, 7 Oct 2023 13:32:28 +0200 Subject: [PATCH] Remove gitlab api version option Signed-off-by: Yannick Bungers --- backend/src/config/auth.config.ts | 7 +------ backend/src/config/gitlab.enum.ts | 6 ------ .../src/frontend-config/frontend-config.service.spec.ts | 3 +-- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/backend/src/config/auth.config.ts b/backend/src/config/auth.config.ts index e561f627b..f87b6ffa0 100644 --- a/backend/src/config/auth.config.ts +++ b/backend/src/config/auth.config.ts @@ -7,7 +7,7 @@ import { registerAs } from '@nestjs/config'; import * as fs from 'fs'; import * as Joi from 'joi'; -import { GitlabScope, GitlabVersion } from './gitlab.enum'; +import { GitlabScope} from './gitlab.enum'; import { buildErrorMessage, ensureNoDuplicatesExist, @@ -57,7 +57,6 @@ export interface AuthConfig { clientID: string; clientSecret: string; scope: GitlabScope; - version: GitlabVersion; }[]; // ToDo: tlsOptions exist in config.json.example. See https://nodejs.org/api/tls.html#tls_tls_connect_options_callback ldap: LDAPConfig[]; @@ -143,10 +142,6 @@ const authSchema = Joi.object({ .valid(...Object.values(GitlabScope)) .default(GitlabScope.READ_USER) .optional(), - version: Joi.string() - .valid(...Object.values(GitlabVersion)) - .default(GitlabVersion.V4) - .optional(), }).optional(), ) .optional(), diff --git a/backend/src/config/gitlab.enum.ts b/backend/src/config/gitlab.enum.ts index 0ddb24130..2bb470c68 100644 --- a/backend/src/config/gitlab.enum.ts +++ b/backend/src/config/gitlab.enum.ts @@ -8,9 +8,3 @@ export enum GitlabScope { READ_USER = 'read_user', API = 'api', } - -// ToDo: Evaluate if V3 is really necessary anymore (it's deprecated since 2017) -export enum GitlabVersion { - V3 = 'v3', - V4 = 'v4', -} diff --git a/backend/src/frontend-config/frontend-config.service.spec.ts b/backend/src/frontend-config/frontend-config.service.spec.ts index 74dd8ed31..8218889e3 100644 --- a/backend/src/frontend-config/frontend-config.service.spec.ts +++ b/backend/src/frontend-config/frontend-config.service.spec.ts @@ -12,7 +12,7 @@ import { AuthConfig } from '../config/auth.config'; import { CustomizationConfig } from '../config/customization.config'; import { DefaultAccessLevel } from '../config/default-access-level.enum'; import { ExternalServicesConfig } from '../config/external-services.config'; -import { GitlabScope, GitlabVersion } from '../config/gitlab.enum'; +import { GitlabScope } from '../config/gitlab.enum'; import { GuestAccess } from '../config/guest_access.enum'; import { Loglevel } from '../config/loglevel.enum'; import { NoteConfig } from '../config/note.config'; @@ -70,7 +70,6 @@ describe('FrontendConfigService', () => { clientID: 'gitlabTestId', clientSecret: 'gitlabTestSecret', scope: GitlabScope.API, - version: GitlabVersion.V4, }, ]; const ldap: AuthConfig['ldap'] = [