Skip to content

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

use __INFISICAL_UNCHANGED__ instead of empty string for unchanged placeholder

x03220565b36e6232cf
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 83e4882313..2dfdec196b 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -150,7 +150,12 @@ export const pamAccountServiceFactory = ({
return {
...(await decryptAccount(account, resource.projectId, kmsService)),
- resource: { id: resource.id, name: resource.name, resourceType: resource.resourceType }
+ resource: {
+ id: resource.id,
+ name: resource.name,
+ resourceType: resource.resourceType,
+ rotationCredentialsConfigured: !!resource.encryptedRotationAccountCredentials
+ }
};
} catch (err) {
if (err instanceof DatabaseError && (err.error as { code: string })?.code === DatabaseErrorCode.UniqueViolation) {
@@ -241,7 +246,7 @@ export const pamAccountServiceFactory = ({
// Logic to prevent overwriting unedited censored values
const finalCredentials = { ...credentials };
- if (credentials.password === "******") {
+ if (credentials.password === "__INFISICAL_UNCHANGED__") {
const decryptedCredentials = await decryptAccountCredentials({
encryptedCredentials: account.encryptedCredentials,
projectId: account.projectId,
@@ -269,7 +274,12 @@ export const pamAccountServiceFactory = ({
return {
...(await decryptAccount(updatedAccount, account.projectId, kmsService)),
- resource: { id: resource.id, name: resource.name, resourceType: resource.resourceType }
+ resource: {
+ id: resource.id,
+ name: resource.name,
+ resourceType: resource.resourceType,
+ rotationCredentialsConfigured: !!resource.encryptedRotationAccountCredentials
+ }
};
};
@@ -308,7 +318,12 @@ export const pamAccountServiceFactory = ({
return {
...(await decryptAccount(deletedAccount, account.projectId, kmsService)),
- resource: { id: resource.id, name: resource.name, resourceType: resource.resourceType }
+ resource: {
+ id: resource.id,
+ name: resource.name,
+ resourceType: resource.resourceType,
+ rotationCredentialsConfigured: !!resource.encryptedRotationAccountCredentials
+ }
};
};
diff --git a/backend/src/ee/services/pam-resource/pam-resource-service.ts b/backend/src/ee/services/pam-resource/pam-resource-service.ts
index 9ec702b248..d97905dbe1 100644
--- a/backend/src/ee/services/pam-resource/pam-resource-service.ts
+++ b/backend/src/ee/services/pam-resource/pam-resource-service.ts
@@ -194,7 +194,10 @@ export const pamResourceServiceFactory = ({
// Logic to prevent overwriting unedited censored values
const finalCredentials = { ...rotationAccountCredentials };
- if (resource.encryptedRotationAccountCredentials && rotationAccountCredentials.password === "******") {
+ if (
+ resource.encryptedRotationAccountCredentials &&
+ rotationAccountCredentials.password === "__INFISICAL_UNCHANGED__"
+ ) {
const decryptedCredentials = await decryptAccountCredentials({
encryptedCredentials: resource.encryptedRotationAccountCredentials,
projectId: resource.projectId,
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PostgresAccountForm.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PostgresAccountForm.tsx
index c353a278b4..17d68bdf05 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PostgresAccountForm.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/PostgresAccountForm.tsx
@@ -34,7 +34,7 @@ export const PostgresAccountForm = ({ account, resourceId, resourceType, onSubmi
...account,
credentials: {
...account.credentials,
- password: "******"
+ password: "__INFISICAL_UNCHANGED__"
}
}
: undefined
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/shared/SqlAccountFields.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/shared/SqlAccountFields.tsx
index 7d9e85c44d..0fd5760f3a 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/shared/SqlAccountFields.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/shared/SqlAccountFields.tsx
@@ -38,14 +38,14 @@ export const SqlAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
type={showPassword ? "text" : "password"}
autoComplete="new-password"
onFocus={() => {
- if (isUpdate && field.value === "******") {
+ if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
field.onChange("");
}
setShowPassword(true);
}}
onBlur={() => {
if (isUpdate && field.value === "") {
- field.onChange("******");
+ field.onChange("__INFISICAL_UNCHANGED__");
}
setShowPassword(false);
}}
diff --git a/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/PostgresResourceForm.tsx b/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/PostgresResourceForm.tsx
index 20ac710c3f..2c53c89df1 100644
--- a/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/PostgresResourceForm.tsx
+++ b/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/PostgresResourceForm.tsx
@@ -37,7 +37,7 @@ export const PostgresResourceForm = ({ resource, onSubmit }: Props) => {
rotationAccountCredentials: resource.rotationAccountCredentials
? {
...resource.rotationAccountCredentials,
- password: "******"
+ password: "__INFISICAL_UNCHANGED__"
}
: resource.rotationAccountCredentials
}
diff --git a/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/shared/SqlRotateAccountFields.tsx b/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/shared/SqlRotateAccountFields.tsx
index 8695941406..6ce92b8e62 100644
--- a/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/shared/SqlRotateAccountFields.tsx
+++ b/frontend/src/pages/pam/PamResourcesPage/components/PamResourceForm/shared/SqlRotateAccountFields.tsx
@@ -55,14 +55,14 @@ export const SqlRotateAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
type={showPassword ? "text" : "password"}
autoComplete="new-password"
onFocus={() => {
- if (isUpdate && field.value === "******") {
+ if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
field.onChange("");
}
setShowPassword(true);
}}
onBlur={() => {
if (isUpdate && field.value === "") {
- field.onChange("******");
+ field.onChange("__INFISICAL_UNCHANGED__");
}
setShowPassword(false);
}}