-
Notifications
You must be signed in to change notification settings - Fork 500
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
Conversation
There was a problem hiding this 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, | ||
) { |
There was a problem hiding this comment.
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
chezmoi/internal/chezmoi/sourcestate.go
Lines 340 to 366 in 94f00d1
// 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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: bakito <[email protected]>
Thank you! |
This PR fixes nested groups for keepassxc when run in builtin mode and adds additional tests to assure the functionality.