mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-08 23:18:05 -05:00
fix: resolved first time rotation issue in rotation
This commit is contained in:
@@ -17,7 +17,8 @@ import { AppConnection } from "@app/services/app-connection/app-connection-enums
|
|||||||
|
|
||||||
export const MongoDBCredentialsRotationGeneratedCredentialsSchema = SqlCredentialsRotationGeneratedCredentialsSchema;
|
export const MongoDBCredentialsRotationGeneratedCredentialsSchema = SqlCredentialsRotationGeneratedCredentialsSchema;
|
||||||
export const MongoDBCredentialsRotationParametersSchema = SqlCredentialsRotationParametersSchema.omit({
|
export const MongoDBCredentialsRotationParametersSchema = SqlCredentialsRotationParametersSchema.omit({
|
||||||
rotationStatement: true
|
rotationStatement: true,
|
||||||
|
passwordRequirements: true
|
||||||
});
|
});
|
||||||
export const MongoDBCredentialsRotationTemplateSchema = SqlCredentialsRotationTemplateSchema.omit({
|
export const MongoDBCredentialsRotationTemplateSchema = SqlCredentialsRotationTemplateSchema.omit({
|
||||||
rotationStatement: true
|
rotationStatement: true
|
||||||
|
|||||||
@@ -110,10 +110,11 @@ export const sqlCredentialsRotationFactory: TRotationFactory<
|
|||||||
) => {
|
) => {
|
||||||
// For SQL, since we get existing users, we change both their passwords
|
// For SQL, since we get existing users, we change both their passwords
|
||||||
// on issue to invalidate their existing passwords
|
// on issue to invalidate their existing passwords
|
||||||
const credentialsSet = [
|
const credentialsSet = [{ username: username1, password: generatePassword(passwordRequirement) }];
|
||||||
{ username: username1, password: generatePassword(passwordRequirement) },
|
// if both are same username like for mysql dual password rotation - we don't want to reissue twice loosing first cred access
|
||||||
{ username: username2, password: generatePassword(passwordRequirement) }
|
if (username1 !== username2) {
|
||||||
];
|
credentialsSet.push({ username: username2, password: generatePassword(passwordRequirement) });
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await executeOperation(async (client) => {
|
await executeOperation(async (client) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user