Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Correct nested groups for keepassxc builtin mode #4189

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

bakito
Copy link
Contributor

@bakito bakito commented Jan 7, 2025

This PR fixes nested groups for keepassxc when run in builtin mode and adds additional tests to assure the functionality.

@bakito bakito changed the title correct nested groups for keepassxc builtin mode fix: Correct nested groups for keepassxc builtin mode Jan 7, 2025
Copy link
Owner

@twpayne twpayne left a comment

Choose a reason for hiding this comment

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

Looks great! One nit. If you don't want to fix it, I'll happily do it in a follow-up PR.

func setupKeepassEntry(
t *testing.T,
command, tempDir, database, databasePassword, groupName, entryName, entryUsername, entryPassword, attachmentName, attachmentData string,
) {
Copy link
Owner

Choose a reason for hiding this comment

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

nit: instead of passing lots of arguments with the same type, pass a struct with named fields. For an example, see

// AddOptions are options to SourceState.Add.
type AddOptions struct {
AutoTemplate bool // Automatically create templates, if possible.
Create bool // Add create_ entries instead of normal entries.
Encrypt bool // Encrypt files.
EncryptedSuffix string // Suffix for encrypted files.
Errorf func(string, ...any) // Function to print errors.
Exact bool // Add the exact_ attribute to added directories.
Filter *EntryTypeFilter // Entry type filter.
OnIgnoreFunc func(RelPath) // Function to call when a target is ignored.
PreAddFunc PreAddFunc // Function to be called before a source entry is added.
ConfigFileAbsPath AbsPath // Path to config file.
ProtectedAbsPaths []AbsPath // Paths that must not be added.
RemoveDir RelPath // Directory to remove before adding.
ReplaceFunc ReplaceFunc // Function to be called before a source entry is replaced.
Template bool // Add the .tmpl attribute to added files.
TemplateSymlinks bool // Add symlinks with targets in the source or home directories as templates.
}
// Add adds destAbsPathInfos to s.
func (s *SourceState) Add(
sourceSystem System,
persistentState PersistentState,
destSystem System,
destAbsPathInfos map[AbsPath]fs.FileInfo,
options *AddOptions,
) error {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@twpayne twpayne merged commit fc8c20f into twpayne:master Jan 7, 2025
30 checks passed
@twpayne
Copy link
Owner

twpayne commented Jan 7, 2025

Thank you!

@bakito bakito deleted the nested-keepass branch January 7, 2025 20:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants