From b25c37eb08cf4dadb148d014372301035d1be1ab Mon Sep 17 00:00:00 2001 From: Claus-Peter Huebner Date: Thu, 26 Oct 2023 22:53:57 +0200 Subject: [PATCH] linting --- backend/src/federation/authenticateCommunities.ts | 2 +- federation/src/client/1_0/AuthenticationClient.ts | 4 ++-- federation/src/graphql/api/1_0/util/authenticateCommunity.ts | 5 ----- federation/test/testSetup.ts | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/backend/src/federation/authenticateCommunities.ts b/backend/src/federation/authenticateCommunities.ts index 30831fc4a..d16890b9a 100644 --- a/backend/src/federation/authenticateCommunities.ts +++ b/backend/src/federation/authenticateCommunities.ts @@ -1,6 +1,6 @@ import { Community as DbCommunity } from '@entity/Community' import { FederatedCommunity as DbFederatedCommunity } from '@entity/FederatedCommunity' -import { v4 as uuidv4, validate as validateUUID, version as versionUUID } from 'uuid' +import { validate as validateUUID, version as versionUUID } from 'uuid' import { CONFIG } from '@/config' // eslint-disable-next-line camelcase diff --git a/federation/src/client/1_0/AuthenticationClient.ts b/federation/src/client/1_0/AuthenticationClient.ts index 2742846b0..bed6b88c4 100644 --- a/federation/src/client/1_0/AuthenticationClient.ts +++ b/federation/src/client/1_0/AuthenticationClient.ts @@ -29,7 +29,7 @@ export class AuthenticationClient { async openConnectionCallback(args: OpenConnectionCallbackArgs): Promise { logger.debug('Authentication: openConnectionCallback with endpoint', this.endpoint, args) try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any const { data } = await this.client.rawRequest(openConnectionCallback, { args }) // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (data && data.openConnectionCallback) { @@ -53,7 +53,7 @@ export class AuthenticationClient { async authenticate(args: AuthenticationArgs): Promise { logger.debug('Authentication: authenticate with endpoint=', this.endpoint) try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any const { data } = await this.client.rawRequest(authenticate, { args }) logger.debug('Authentication: after authenticate: data:', data) // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access diff --git a/federation/src/graphql/api/1_0/util/authenticateCommunity.ts b/federation/src/graphql/api/1_0/util/authenticateCommunity.ts index 737590f20..0af3475ef 100644 --- a/federation/src/graphql/api/1_0/util/authenticateCommunity.ts +++ b/federation/src/graphql/api/1_0/util/authenticateCommunity.ts @@ -17,7 +17,6 @@ export async function startOpenConnectionCallback( ): Promise { logger.debug(`Authentication: startOpenConnectionCallback() with:`, args, comA) try { - const homeCom = await DbCommunity.findOneByOrFail({ foreign: false }) const homeFedCom = await DbFedCommunity.findOneByOrFail({ foreign: false, apiVersion: api, @@ -61,10 +60,6 @@ export async function startAuthentication( logger.debug(`Authentication: startAuthentication()...`, oneTimeCode, fedComB) try { const homeCom = await DbCommunity.findOneByOrFail({ foreign: false }) - const homeFedCom = await DbFedCommunity.findOneByOrFail({ - foreign: false, - apiVersion: fedComB.apiVersion, - }) // TODO encrypt homeCom.uuid with homeCom.privateKey and sign it with callbackFedCom.publicKey const client = AuthenticationClientFactory.getInstance(fedComB) diff --git a/federation/test/testSetup.ts b/federation/test/testSetup.ts index 814242f53..85008799f 100644 --- a/federation/test/testSetup.ts +++ b/federation/test/testSetup.ts @@ -1,4 +1,4 @@ -import { CONFIG } from '@/config' +// import { CONFIG } from '@/config' // import { i18n } from '@/server/localization' import { federationLogger as logger } from '@/server/logger'