This commit is contained in:
Claus-Peter Huebner 2023-10-26 22:53:57 +02:00
parent f2b755feb7
commit b25c37eb08
4 changed files with 4 additions and 9 deletions

View File

@ -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

View File

@ -29,7 +29,7 @@ export class AuthenticationClient {
async openConnectionCallback(args: OpenConnectionCallbackArgs): Promise<boolean> {
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<any>(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<string | null> {
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<any>(authenticate, { args })
logger.debug('Authentication: after authenticate: data:', data)
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access

View File

@ -17,7 +17,6 @@ export async function startOpenConnectionCallback(
): Promise<void> {
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)

View File

@ -1,4 +1,4 @@
import { CONFIG } from '@/config'
// import { CONFIG } from '@/config'
// import { i18n } from '@/server/localization'
import { federationLogger as logger } from '@/server/logger'