mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
feat: fixed ts issues
This commit is contained in:
2
backend/src/@types/fastify.d.ts
vendored
2
backend/src/@types/fastify.d.ts
vendored
@@ -110,7 +110,7 @@ declare module "@fastify/request-context" {
|
||||
};
|
||||
};
|
||||
identityPermissionMetadata?: Record<string, unknown>; // filled by permission service
|
||||
assumedProjectRole: { requesterId: string; actorId: string; actorType: ActorType; projectId: string };
|
||||
assumedProjectRole?: { requesterId: string; actorId: string; actorType: ActorType; projectId: string };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { requestContext } from "@fastify/request-context";
|
||||
import { z } from "zod";
|
||||
|
||||
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
||||
@@ -6,7 +7,6 @@ import { BadRequestError } from "@app/lib/errors";
|
||||
import { writeLimit } from "@app/server/config/rateLimiter";
|
||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||
import { ActorType, AuthMode } from "@app/services/auth/auth-type";
|
||||
import { requestContext } from "@fastify/request-context";
|
||||
|
||||
export const registerAssumePrivilegeRouter = async (server: FastifyZodProvider) => {
|
||||
server.route({
|
||||
|
||||
@@ -248,6 +248,7 @@ export const projectRoleServiceFactory = ({
|
||||
actorEmail: ""
|
||||
}
|
||||
: undefined;
|
||||
|
||||
if (impersonation?.actorType === ActorType.IDENTITY) {
|
||||
const identityDetails = await identityDAL.findById(impersonation.actorId);
|
||||
if (!identityDetails) throw new NotFoundError({ message: `Identity with ID ${impersonation.actorId} not found` });
|
||||
@@ -258,6 +259,7 @@ export const projectRoleServiceFactory = ({
|
||||
impersonation.actorName = `${userDetails?.firstName} ${userDetails?.lastName || ""}`;
|
||||
impersonation.actorEmail = userDetails?.email || "";
|
||||
}
|
||||
|
||||
return { permissions: packRules(permission.rules), membership, impersonation };
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user