mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 12:26:13 +00:00
use __INFISICAL_UNCHANGED__ instead of empty string for unchanged
placeholder
This commit is contained in:
@@ -150,7 +150,12 @@ export const pamAccountServiceFactory = ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...(await decryptAccount(account, resource.projectId, kmsService)),
|
...(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) {
|
} catch (err) {
|
||||||
if (err instanceof DatabaseError && (err.error as { code: string })?.code === DatabaseErrorCode.UniqueViolation) {
|
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
|
// Logic to prevent overwriting unedited censored values
|
||||||
const finalCredentials = { ...credentials };
|
const finalCredentials = { ...credentials };
|
||||||
if (credentials.password === "******") {
|
if (credentials.password === "__INFISICAL_UNCHANGED__") {
|
||||||
const decryptedCredentials = await decryptAccountCredentials({
|
const decryptedCredentials = await decryptAccountCredentials({
|
||||||
encryptedCredentials: account.encryptedCredentials,
|
encryptedCredentials: account.encryptedCredentials,
|
||||||
projectId: account.projectId,
|
projectId: account.projectId,
|
||||||
@@ -269,7 +274,12 @@ export const pamAccountServiceFactory = ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...(await decryptAccount(updatedAccount, account.projectId, kmsService)),
|
...(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 {
|
return {
|
||||||
...(await decryptAccount(deletedAccount, account.projectId, kmsService)),
|
...(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
|
||||||
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,10 @@ export const pamResourceServiceFactory = ({
|
|||||||
|
|
||||||
// Logic to prevent overwriting unedited censored values
|
// Logic to prevent overwriting unedited censored values
|
||||||
const finalCredentials = { ...rotationAccountCredentials };
|
const finalCredentials = { ...rotationAccountCredentials };
|
||||||
if (resource.encryptedRotationAccountCredentials && rotationAccountCredentials.password === "******") {
|
if (
|
||||||
|
resource.encryptedRotationAccountCredentials &&
|
||||||
|
rotationAccountCredentials.password === "__INFISICAL_UNCHANGED__"
|
||||||
|
) {
|
||||||
const decryptedCredentials = await decryptAccountCredentials({
|
const decryptedCredentials = await decryptAccountCredentials({
|
||||||
encryptedCredentials: resource.encryptedRotationAccountCredentials,
|
encryptedCredentials: resource.encryptedRotationAccountCredentials,
|
||||||
projectId: resource.projectId,
|
projectId: resource.projectId,
|
||||||
|
|||||||
+1
-1
@@ -34,7 +34,7 @@ export const PostgresAccountForm = ({ account, resourceId, resourceType, onSubmi
|
|||||||
...account,
|
...account,
|
||||||
credentials: {
|
credentials: {
|
||||||
...account.credentials,
|
...account.credentials,
|
||||||
password: "******"
|
password: "__INFISICAL_UNCHANGED__"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
|
|||||||
+2
-2
@@ -38,14 +38,14 @@ export const SqlAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
|
|||||||
type={showPassword ? "text" : "password"}
|
type={showPassword ? "text" : "password"}
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
if (isUpdate && field.value === "******") {
|
if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
|
||||||
field.onChange("");
|
field.onChange("");
|
||||||
}
|
}
|
||||||
setShowPassword(true);
|
setShowPassword(true);
|
||||||
}}
|
}}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (isUpdate && field.value === "") {
|
if (isUpdate && field.value === "") {
|
||||||
field.onChange("******");
|
field.onChange("__INFISICAL_UNCHANGED__");
|
||||||
}
|
}
|
||||||
setShowPassword(false);
|
setShowPassword(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ export const PostgresResourceForm = ({ resource, onSubmit }: Props) => {
|
|||||||
rotationAccountCredentials: resource.rotationAccountCredentials
|
rotationAccountCredentials: resource.rotationAccountCredentials
|
||||||
? {
|
? {
|
||||||
...resource.rotationAccountCredentials,
|
...resource.rotationAccountCredentials,
|
||||||
password: "******"
|
password: "__INFISICAL_UNCHANGED__"
|
||||||
}
|
}
|
||||||
: resource.rotationAccountCredentials
|
: resource.rotationAccountCredentials
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -55,14 +55,14 @@ export const SqlRotateAccountFields = ({ isUpdate }: { isUpdate: boolean }) => {
|
|||||||
type={showPassword ? "text" : "password"}
|
type={showPassword ? "text" : "password"}
|
||||||
autoComplete="new-password"
|
autoComplete="new-password"
|
||||||
onFocus={() => {
|
onFocus={() => {
|
||||||
if (isUpdate && field.value === "******") {
|
if (isUpdate && field.value === "__INFISICAL_UNCHANGED__") {
|
||||||
field.onChange("");
|
field.onChange("");
|
||||||
}
|
}
|
||||||
setShowPassword(true);
|
setShowPassword(true);
|
||||||
}}
|
}}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (isUpdate && field.value === "") {
|
if (isUpdate && field.value === "") {
|
||||||
field.onChange("******");
|
field.onChange("__INFISICAL_UNCHANGED__");
|
||||||
}
|
}
|
||||||
setShowPassword(false);
|
setShowPassword(false);
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user