Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

chore(pam): trim comments down to the load-bearing ones

bernie-g37e01680ce66
diff --git a/backend/src/ee/services/pam-account-heartbeat/pam-account-heartbeat-service.ts b/backend/src/ee/services/pam-account-heartbeat/pam-account-heartbeat-service.ts
index ff870935b0..7171d03c95 100644
--- a/backend/src/ee/services/pam-account-heartbeat/pam-account-heartbeat-service.ts
+++ b/backend/src/ee/services/pam-account-heartbeat/pam-account-heartbeat-service.ts
@@ -282,15 +282,13 @@ export const pamAccountHeartbeatServiceFactory = ({
const runCheck = async (account: TPamAccountDetail): Promise<TPamHeartbeatResult> => {
const now = new Date();
- // A target can echo the credential back in its error, and this message is persisted and audited.
const usedSecrets: string[] = [];
let outcome: { status: PamHeartbeatStatus; message?: string };
try {
outcome = await probe(account, usedSecrets);
} catch (err) {
const message = redactRotationError(err, usedSecrets);
- // Logged as the redacted string, never the error object: a target that echoed the credential back would
- // otherwise copy it into the application log, which no later redaction reaches.
+ // Never the error object: a target can echo the credential back, and no later redaction reaches a log.
logger.warn(`PAM heartbeat could not complete [accountId=${account.id}]: ${message}`);
outcome = { status: PamHeartbeatStatus.CannotCheck, message };
}
@@ -327,8 +325,7 @@ export const pamAccountHeartbeatServiceFactory = ({
throw new NotFoundError({ message: `Account with ID '${accountId}' not found` });
}
- // ViewCredentials, not EditAccounts: this sends the stored credential to whatever target the account
- // points at, so an editor who can re-point the host must not be able to trigger it.
+ // ViewCredentials, not EditAccounts: this sends the credential wherever the account currently points.
await checkAccountAccess(
permissionService,
account.id,
diff --git a/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts b/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
index dafec60f31..e85141bcb2 100644
--- a/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
+++ b/backend/src/ee/services/pam-account-rotation/pam-account-rotation-service.ts
@@ -164,8 +164,7 @@ export const pamAccountRotationServiceFactory = (deps: TPamAccountRotationServic
};
const markRotated = async (account: TPamAccountDetail, encryptedBlob: Buffer, now: Date) => {
- // Rotation commits only after authenticating with the new credential, so an account stopped for a
- // rejected password resumes checking here instead of staying stopped and red.
+ // Rotation commits only after authenticating, so an account stopped for a bad password resumes here.
const heartbeat = PamTemplateSettingsSchema.safeParse(account.templateSettings).data?.heartbeat;
await pamAccountDAL.updateById(account.id, {
diff --git a/backend/src/ee/services/pam-account-rotation/pam-rotation-fns.test.ts b/backend/src/ee/services/pam-account-rotation/pam-rotation-fns.test.ts
index 314255e55e..1994dd83f5 100644
--- a/backend/src/ee/services/pam-account-rotation/pam-rotation-fns.test.ts
+++ b/backend/src/ee/services/pam-account-rotation/pam-rotation-fns.test.ts
@@ -120,7 +120,6 @@ describe("withGatewayRetry", () => {
expect(attempts).toBe(3);
});
- // Every retry of a refused credential is another failed logon counting toward the target's lockout.
test("gives up immediately when the target rejected the credential", async () => {
let attempts = 0;
const authErr = Object.assign(new Error("WinRM authentication failed"), { gatewayFailureKind: "auth" });
diff --git a/backend/src/ee/services/pam-account/pam-account-connection-test.test.ts b/backend/src/ee/services/pam-account/pam-account-connection-test.test.ts
index 07cd25c427..be52e69166 100644
--- a/backend/src/ee/services/pam-account/pam-account-connection-test.test.ts
+++ b/backend/src/ee/services/pam-account/pam-account-connection-test.test.ts
@@ -64,8 +64,6 @@ describe("buildGatewayConnectionTest: MSSQL Windows authentication", () => {
expect(result?.request).toMatchObject({ domain: undefined, realm: undefined });
});
- // Account create and update call this without the opt so they keep working against a gateway that predates
- // the proxy handshake, where sending a Windows login as a SQL login would fail the save outright.
test("callers that omit the opt keep the old reachability check", async () => {
const result = await buildGatewayConnectionTest(
PamAccountType.MsSQL,
diff --git a/backend/src/ee/services/pam-account/pam-account-connection-test.ts b/backend/src/ee/services/pam-account/pam-account-connection-test.ts
index 0630325c3f..6667443f6b 100644
--- a/backend/src/ee/services/pam-account/pam-account-connection-test.ts
+++ b/backend/src/ee/services/pam-account/pam-account-connection-test.ts
@@ -96,8 +96,7 @@ export const buildGatewayConnectionTest = async (
connectionDetails: Record<string, unknown>,
credentials: Record<string, unknown> | null,
orgId: string,
- // Off for account create and update, which must not start failing against a gateway that predates the
- // Windows-auth proxy handshake.
+ // Off for account create and update, which must not fail against a gateway predating the proxy handshake.
opts?: { allowWindowsAuthSql?: boolean }
): Promise<{ host: string; port: number; request: TestConnectionRequest } | null> => {
const creds = credentials && isCredentialConfigured(accountType, credentials) ? credentials : null;
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts
index 71225f3dd8..75956004f6 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -762,8 +762,7 @@ export const pamAccountServiceFactory = (deps: TPamAccountServiceFactoryDep) =>
);
}
- // Clearing the old verdict is what resumes checking: the types that cannot be verified on this path would
- // otherwise stay stopped, telling the user to do the very thing they just did.
+ // Clearing the old verdict resumes checking; types unverifiable here would otherwise stay stopped.
if (credentials) {
updateData.heartbeatStatus = credentialVerified ? PamHeartbeatStatus.Healthy : null;
updateData.encryptedLastHeartbeatMessage = null;
diff --git a/backend/src/lib/gateway-v2/winrm-rpc.ts b/backend/src/lib/gateway-v2/winrm-rpc.ts
index 8ad41c2af6..f2717736b7 100644
--- a/backend/src/lib/gateway-v2/winrm-rpc.ts
+++ b/backend/src/lib/gateway-v2/winrm-rpc.ts
@@ -40,7 +40,7 @@ export type WinRmRpcFailure = {
ok: false;
status: number;
errorMessage: string;
- // The gateway separates a rejected credential from an unreachable host. Older gateways send nothing.
+ // Older gateways send nothing.
kind?: GatewayFailureKind | null;
};
export type WinRmRpcResponse<T> = WinRmRpcSuccess<T> | WinRmRpcFailure;