Skip to content

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

greptile review fixes & rule UI tweaks

x0322056f0086400eb2
diff --git a/backend/src/db/migrations/20260321035221_pam-tls-config-defaults.ts b/backend/src/db/migrations/20260321035221_pam-tls-config-defaults.ts
index c8616580fe..9997e8cdb9 100644
--- a/backend/src/db/migrations/20260321035221_pam-tls-config-defaults.ts
+++ b/backend/src/db/migrations/20260321035221_pam-tls-config-defaults.ts
@@ -93,8 +93,9 @@ export async function up(knex: Knex): Promise<void> {
const encrypted = encryptor({ plainText: Buffer.from(JSON.stringify(decrypted)) }).cipherTextBlob;
updates.push({ id: resource.id, encryptedConnectionDetails: encrypted });
}
- } catch {
- // Skip resources that fail to decrypt
+ } catch (err) {
+ // eslint-disable-next-line no-console
+ console.error(`Migration failed to backfill TLS config for [resourceId=${resource.id}]:`, err);
}
}
diff --git a/frontend/src/pages/pam/PamResourceByIDPage/components/PamRotationPolicyModal.tsx b/frontend/src/pages/pam/PamResourceByIDPage/components/PamRotationPolicyModal.tsx
index f0fbd00601..8a79690124 100644
--- a/frontend/src/pages/pam/PamResourceByIDPage/components/PamRotationPolicyModal.tsx
+++ b/frontend/src/pages/pam/PamResourceByIDPage/components/PamRotationPolicyModal.tsx
@@ -323,9 +323,10 @@ export const PamRotationPolicyModal = ({ isOpen, onOpenChange, resource }: Props
return chain;
}, Promise.resolve());
- const finalIds = localRules.map((r) =>
- r.id.startsWith(TEMP_ID_PREFIX) ? newIdMap.get(r.id)! : r.id
- );
+ const finalIds = localRules
+ .map((r) => (r.id.startsWith(TEMP_ID_PREFIX) ? newIdMap.get(r.id) : r.id))
+ .filter((id): id is string => !!id);
+
const serverOrder = rules.filter((r) => !deletedRuleIds.includes(r.id)).map((r) => r.id);
const orderChanged =
finalIds.length !== serverOrder.length || finalIds.some((id, i) => id !== serverOrder[i]);
diff --git a/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx b/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
index 9d9bdc7b38..f8d6022732 100644
--- a/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
+++ b/frontend/src/pages/pam/PamResourceByIDPage/components/rotation-policy/RotationRuleCard.tsx
@@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
import { ArrowDownIcon, ArrowUpIcon, TrashIcon } from "lucide-react";
-import { twMerge } from "tailwind-merge";
import {
Field,
@@ -82,7 +81,7 @@ export const RotationRuleCard = ({
return (
<div className="flex gap-2 rounded-lg border border-border bg-card p-4">
- <div className="flex flex-col gap-2">
+ <div className="flex w-full flex-col gap-2">
<div className="flex items-center gap-2">
<span className="mr-1 text-lg font-medium text-muted">{index + 1}</span>
<Switch
@@ -97,8 +96,8 @@ export const RotationRuleCard = ({
<Label className="opacity-50">Do Not Rotate</Label>
)}
</div>
- <div className="grid grid-cols-[auto_1fr_1fr] gap-2">
- <Field>
+ <div className="flex gap-2">
+ <Field className="w-2/5 shrink-0">
<FieldLabel>Rule Name</FieldLabel>
<FieldContent>
<UnstableInput
@@ -121,18 +120,18 @@ export const RotationRuleCard = ({
/>
</FieldContent>
</Field>
- <Field>
- <FieldLabel>Interval (days)</FieldLabel>
- <FieldContent>
- <UnstableInput
- value={localInterval}
- onChange={(e) => setLocalInterval(e.target.value)}
- onBlur={handleIntervalBlur}
- className={twMerge(!rule.enabled && "opacity-50")}
- disabled={!rule.enabled}
- />
- </FieldContent>
- </Field>
+ {rule.enabled && (
+ <Field>
+ <FieldLabel>Interval (days)</FieldLabel>
+ <FieldContent>
+ <UnstableInput
+ value={localInterval}
+ onChange={(e) => setLocalInterval(e.target.value)}
+ onBlur={handleIntervalBlur}
+ />
+ </FieldContent>
+ </Field>
+ )}
</div>
</div>