mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 13:27:46 +00:00
Fix type linter
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user