Skip to content

database config - encrypt password by default (#549)#551

Merged
mariuz merged 2 commits intomasterfrom
issue-549-encrypt-password
Apr 29, 2026
Merged

database config - encrypt password by default (#549)#551
mariuz merged 2 commits intomasterfrom
issue-549-encrypt-password

Conversation

@mariuz
Copy link
Copy Markdown
Owner

@mariuz mariuz commented Apr 29, 2026

This PR addresses issue #549 by making encrypted passwords the default choice when registering or creating a database.

Changes:

  • Set DatabaseAuthenticationMode default to UseSavedEncryptedPwd.
  • Updated DatabaseRegistrationDialog to default to the "Use saved user name and encrypted password" option (index 1).

This ensures that if a user chooses to save their password, it will be encrypted by default using the Master Password feature, rather than being stored in plain text in the fr_databases.conf file.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the default database authentication mode to use saved encrypted passwords by modifying the DatabaseAuthenticationMode constructor and the initial selection in the DatabaseRegistrationDialog. Feedback was provided suggesting the use of symbolic constants instead of hardcoded indices for UI selections to improve code robustness and maintainability.

Comment thread src/gui/DatabaseRegistrationDialog.cpp Outdated
button_browse->SetSize(wh, wh);

choice_authentication->SetSelection(0);
choice_authentication->SetSelection(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding the selection index to 1 makes the dialog less flexible if the order of authentication choices changes in the future. Consider using a symbolic constant or a more robust way to select the default authentication mode.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by using the DatabaseAuthenticationMode::UseSavedEncryptedPwd symbolic constant instead of a hardcoded index.

@mariuz mariuz merged commit 1418f13 into master Apr 29, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant