mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-06 22:23:53 -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 MongoDBCredentialsRotationParametersSchema = SqlCredentialsRotationParametersSchema.omit({
|
||||
rotationStatement: true
|
||||
rotationStatement: true,
|
||||
passwordRequirements: true
|
||||
});
|
||||
export const MongoDBCredentialsRotationTemplateSchema = SqlCredentialsRotationTemplateSchema.omit({
|
||||
rotationStatement: true
|
||||
|
||||
@@ -110,10 +110,11 @@ export const sqlCredentialsRotationFactory: TRotationFactory<
|
||||
) => {
|
||||
// For SQL, since we get existing users, we change both their passwords
|
||||
// on issue to invalidate their existing passwords
|
||||
const credentialsSet = [
|
||||
{ username: username1, password: generatePassword(passwordRequirement) },
|
||||
{ username: username2, password: generatePassword(passwordRequirement) }
|
||||
];
|
||||
const credentialsSet = [{ 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
|
||||
if (username1 !== username2) {
|
||||
credentialsSet.push({ username: username2, password: generatePassword(passwordRequirement) });
|
||||
}
|
||||
|
||||
try {
|
||||
await executeOperation(async (client) => {
|
||||
|
||||
Reference in New Issue
Block a user