Skip to content

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

address comments

Andrey4ccf5270d674
diff --git a/backend/src/ee/services/pam-account/pam-account-schemas.ts b/backend/src/ee/services/pam-account/pam-account-schemas.ts
index 16a22586f1..5fddff29a6 100644
--- a/backend/src/ee/services/pam-account/pam-account-schemas.ts
+++ b/backend/src/ee/services/pam-account/pam-account-schemas.ts
@@ -780,7 +780,11 @@ export const ACCOUNT_TYPE_CONFIGS = {
authMethod: z.string()
}),
ui: {
- serviceAccountEmail: { label: "Service Account Email" },
+ serviceAccountEmail: {
+ label: "Service Account Email",
+ description:
+ 'With Impersonation, the service account ID must end with "{{organizationIdPrefix}}", e.g. service-account-{{organizationIdPrefix}}@my-project.iam.gserviceaccount.com'
+ },
authMethod: {
label: "Auth Method",
tooltip:
@@ -992,6 +996,7 @@ export const ACCOUNT_TYPE_CONFIGS = {
showWhen?: TFieldConditionHint;
forceWhen?: readonly TFieldForcedRuleHint[];
tooltip?: string;
+ description?: string;
options?: { label: string; value: string; docsUrl?: string }[];
}
>;
@@ -1344,7 +1349,10 @@ export const PamFieldDescriptorSchema = z.object({
.optional(),
// Info tooltip shown next to the label
- tooltip: z.string().optional()
+ tooltip: z.string().optional(),
+
+ // Help text shown under the field
+ description: z.string().optional()
});
type PamFieldDescriptor = z.infer<typeof PamFieldDescriptorSchema>;
@@ -1374,6 +1382,7 @@ type TFieldUiHint = {
showWhen?: TFieldConditionHint;
forceWhen?: readonly TFieldForcedRuleHint[];
tooltip?: string;
+ description?: string;
options?: { label: string; value: string; docsUrl?: string }[];
};
@@ -1440,7 +1449,8 @@ const describeField = (
...(hint.defaultValue !== undefined ? { defaultValue: hint.defaultValue } : {}),
...(resolvedShowWhen ? { showWhen: resolvedShowWhen } : {}),
...(hint.forceWhen ? { forceWhen: [...hint.forceWhen] } : {}),
- ...(hint.tooltip ? { tooltip: hint.tooltip } : {})
+ ...(hint.tooltip ? { tooltip: hint.tooltip } : {}),
+ ...(hint.description ? { description: hint.description } : {})
};
};
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index cac1ee62fc..dced0b1ce6 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -166,6 +166,7 @@ export type TPamFieldDescriptor = {
showWhen?: TPamFieldCondition;
forceWhen?: { when: TPamFieldCondition; value: string | number | boolean; reason: string }[];
tooltip?: string;
+ description?: string;
};
export type TPamPolicyDescriptor = {
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamSchemaFields.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamSchemaFields.tsx
index 6dfefadf75..461b57833a 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/PamSchemaFields.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamSchemaFields.tsx
@@ -55,12 +55,23 @@ type Props = {
const RequiredMark = () => <span className="text-product-pam">*</span>;
-// Tooltips may reference the org's ID via a {{organizationId}} placeholder (e.g. the AWS IAM role's
-// External ID); resolve it here so the user sees their actual ID inline.
+// Field text may use {{organizationId}} (e.g. the AWS IAM role's External ID) or its first two
+// sections via {{organizationIdPrefix}} (e.g. the GCP service account ID suffix).
+const resolveOrgPlaceholders = (text: string, orgId: string) =>
+ text
+ .replace(/\{\{organizationId\}\}/g, orgId)
+ .replace(/\{\{organizationIdPrefix\}\}/g, orgId.split("-").slice(0, 2).join("-"));
+
+const FieldHelpText = ({ text }: { text?: string }) => {
+ const { currentOrg } = useOrganization();
+ if (!text) return null;
+ return <FieldDescription>{resolveOrgPlaceholders(text, currentOrg.id)}</FieldDescription>;
+};
+
const FieldTooltip = ({ text }: { text?: string }) => {
const { currentOrg } = useOrganization();
if (!text) return null;
- const resolved = text.replace(/\{\{organizationId\}\}/g, currentOrg.id);
+ const resolved = resolveOrgPlaceholders(text, currentOrg.id);
return (
<Tooltip>
<TooltipTrigger>
@@ -238,6 +249,7 @@ export const PamSchemaFields = ({ control, setValue, namePrefix, fields, smartPa
isDisabled={Boolean(forcedRule)}
smartPaste={smartPaste?.fieldKey === descriptor.key ? smartPaste : undefined}
/>
+ <FieldHelpText text={descriptor.description} />
{selectedDocsUrl && (
<FieldDescription>
<a