mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix type/lint issues
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
// All the any rules are disabled because passport typesense with fastify is really poor
|
||||
|
||||
import { IncomingMessage } from "node:http";
|
||||
|
||||
import { Authenticator } from "@fastify/passport";
|
||||
import fastifySession from "@fastify/session";
|
||||
import { FastifyRequest } from "fastify";
|
||||
@@ -27,15 +29,16 @@ export const registerLdapRouter = async (server: FastifyZodProvider) => {
|
||||
|
||||
passport.use(
|
||||
new LdapStrategy(
|
||||
server.services.ldap.getLdapPassportOpts,
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
server.services.ldap.getLdapPassportOpts as any,
|
||||
// eslint-disable-next-line
|
||||
async (req, user, cb) => {
|
||||
async (req: IncomingMessage, user, cb) => {
|
||||
try {
|
||||
const { isUserCompleted, providerAuthToken } = await server.services.ldap.ldapLogin({
|
||||
username: user.uid,
|
||||
firstName: user.givenName,
|
||||
lastName: user.sn,
|
||||
relayState: (req.body as { RelayState?: string }).RelayState,
|
||||
relayState: ((req as unknown as FastifyRequest).body as { RelayState?: string }).RelayState,
|
||||
orgId: (req as unknown as FastifyRequest).ldapConfig.organization
|
||||
});
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ import { TPermissionServiceFactory } from "../permission/permission-service";
|
||||
import { TLdapConfigDALFactory } from "./ldap-config-dal";
|
||||
import { TCreateLdapCfgDTO, TLdapLoginDTO, TUpdateLdapCfgDTO } from "./ldap-config-types";
|
||||
|
||||
// TODO: check the Picks
|
||||
type TLdapConfigServiceFactoryDep = {
|
||||
ldapConfigDAL: TLdapConfigDALFactory;
|
||||
orgDAL: Pick<
|
||||
@@ -320,7 +319,7 @@ export const ldapConfigServiceFactory = ({
|
||||
} catch (err) {
|
||||
logger.error(err);
|
||||
// eslint-disable-next-line
|
||||
done(err as Error);
|
||||
done(err);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ActorType } from "@app/services/auth/auth-type";
|
||||
// this is a unique id for sending posthog event
|
||||
export const getTelemetryDistinctId = (req: FastifyRequest) => {
|
||||
if (req.auth.actor === ActorType.USER) {
|
||||
return req.auth.user.email;
|
||||
return req.auth.user.username;
|
||||
}
|
||||
if (req.auth.actor === ActorType.IDENTITY) {
|
||||
return `identity-${req.auth.identityId}`;
|
||||
|
||||
Reference in New Issue
Block a user