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