Fix type linter

This commit is contained in:
Fang-Pen Lin
2025-12-05 12:07:52 -08:00
parent 1818edcbcf
commit 344d0ef210
@@ -570,13 +570,29 @@ export const pamAccountServiceFactory = ({
const user = await userDAL.findById(actor.id); const user = await userDAL.findById(actor.id);
if (!user) throw new NotFoundError({ message: `User with ID '${actor.id}' not found` }); if (!user) throw new NotFoundError({ message: `User with ID '${actor.id}' not found` });
const { host, port } =
resourceType !== PamResource.Kubernetes
? connectionDetails
: (() => {
const url = new URL(connectionDetails.url);
let portNumber: number | undefined;
if (url.port) {
portNumber = Number(url.port);
} else {
portNumber = url.protocol === "https:" ? 443 : 80;
}
return {
host: url.hostname,
port: portNumber
};
})();
const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({ const gatewayConnectionDetails = await gatewayV2Service.getPAMConnectionDetails({
gatewayId, gatewayId,
duration, duration,
sessionId: session.id, sessionId: session.id,
resourceType: resource.resourceType as PamResource, resourceType: resource.resourceType as PamResource,
host: connectionDetails.host, host,
port: connectionDetails.port, port,
actorMetadata: { actorMetadata: {
id: actor.id, id: actor.id,
type: actor.type, type: actor.type,