* feat: Allow to customize commit messages
This change introduces the ability for users to customize the commit
message when performing actions that modify the secret store.
It adds two new flags to the `edit`, `insert`, `generate`, `copy`,
`move`, and `delete` commands:
- `--commit-message` (`-m`): to specify the commit message directly.
- `--interactive-commit` (`-i`): to open an editor for the commit
message.
The default behavior of using a pre-defined commit message is
preserved.
* fix: Use correct commit message from context
This change fixes a bug where the commit message from the context was
not being used correctly in the `delete` function.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Correctly handle new multiline secrets
This commit fixes as small issue in how multi-line secrets are handled.
Before they were always written in to the secret body completly ignoring
the first line that contains the password. Now we do respect that
correctly. To implement that properly we need to have some additional
code to satisfy the io.Writer assumptions around the AKV secret type.
Also this fixes some non-hermetic tests that showed up during testing of
this change.
Fixes#2614
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Fix typo
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Ditch the MultiWriter approach in favor of a pass-through writer
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Format
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
---------
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Fsck: Improved message handling and decreased commit spam.
* Merge upstream changes with local changes (part 2: manual fixes)
* pgp keyring: Do not import a pgp public key into the user's private keyring if the key there is identical to the one in the store's keyring
* fsck.go: made the code more go-idiomatic
* more changes to make code more go-idiomatic
* Fsck: fixed misleading messages caused by previous refactor
(also clarified the roles of the values in ErrorSeverity)
* Fsck: even smoother git use (pubkey updates now in the same git commit as the rest of fsck's changes)
Also removed dupeicate check of public keys, and added more tests around commit messages
* Ctxutil: Pruning unused functions, more go idiomaticity (and some tweaks regarding errors)
* Formatted files with gofmt
* fixed misc. error management
* More fixes and formatting
(plus one fixed text for the `link` action)
* unblock CI (attempt 1)
* fix problems discovered by CI
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
* Maintain secret structure when parsing
This commit introduces a new KV secret type ("AKV") that fully maintains
the secret format when parsing. As such it obsoletes the old KV and
Plain formats and the need for the core.parsing option.
Fixes#2431
RELEASE_NOTES=[ENHANCEMENT] Maintain secret structure when parsing
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Update internal/action/edit.go
Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
* Address review comments
This brings back the noparsing flag since we need this to cover some
corners cases.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Yolan Romailler <AnomalRoil@users.noreply.github.com>
Running gci in order to make sure we have properly deterministic imports
RELEASE_NOTES=n/a
Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
When gopass can't find a pinentry binary to use for prompting for a
password to unlock an age keyring, it uses its own barebones fallback
pinentry mechanism to prompt for a password in the terminal. This
fallback pinentry always asked the user to retype their password and
required the password match, even when decrypting a file using an
already-existing password. I've updated it to only prompt for a repeat
when necessary, and also made the password prompte messages less
awkward.
RELEASE_NOTES=[BUGFIX] Don't prompt to retype password unnecessarily
with age backend when pinentry binary is unavailable.
Signed-off-by: Faye Duxovni <duxovni@duxovni.org>
This commit adds filtering to avoid logging credentials in the debug
logs. If logging of credentials, e.g. for debugging secret parsers,
is required GOPASS_DEBUG_LOG_SECRETS can be set to an non empty
string to enable logging of secrets.
Fixes#1883
RELEASE_NOTES=[BUGFIX] Avoid logging credentials
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit renames the existing out methods that expect
a format string to include the common f suffix and introduces
new out methods without this suffix that don't accept a
format string or variadic arguments.
Fixes#1793
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This PR moves some packages from internal to pkg to increase the
independence of binaries in cmd/ from internal packages further.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Fixes#1602Fixes#1614Fixes#1600Fixes#1594Fixes#1601Fixes#1650
RELEASE_NOTES=[BUGFIX] Disabling all kind of parsing of the input
RELEASE_NOTES=[ENHANCEMENT] Adding the flag show -n to disable output parsing
RELEASE_NOTES=[ENHANCEMENT] Adding the option parsing to disable all parsing
Signed-off-by: Yolan Romailler <yolan@romailler.ch>
This commit reduces the usage of internal/ packages in auxiliary
binaries so we can get closer to eventually moving them to their own
repos.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Fixes#1595
RELEASE_NOTES=[BUGFIX] Re-adding the global --yes flag
RELEASE_NOTES=[BUGFIX] Insert is not resetting the pw now if a key:value pair is specified inline
This is just adding --yes back since it was mistakingly removed.
Signed-off-by: Yolan Romailler <yolan@romailler.ch>
Fixes#788Fixes#1575Fixes#1574Fixes#1573Fixes#1570Fixes#1592
RELEASE_NOTES=[BUGFIX] Correcting newlines handling
RELEASE_NOTES=[BUGFIX] Show now correctly handles -C and -u together
RELEASE_NOTES=[BUGFIX] Insert is now parsing its stdin input
This is trying to correct the way we display and write newlines.
Newlines are appended by the MIME type after the header but won't be
displayed by show now unless the MIME body is non-empty.
Notice the `mime` setting is significantly changing the way secrets are
handled, written and displayed, also how the newlines are treated.
I've tried to add tests to take this into account.
I've also added unit tests and integration tests accordingly to try and
detect such regressions in the future.
This is changing the behaviour of insert to make it compatible with the new MIME format
This is also refactoring the code a bit, removing dead code such as the
YAML special handling.
Signed-off-by: Yolan Romailler <yolan@romailler.ch>
This commit introduces a new MIME-based secrets format that will
eventually replace any existing secret format.
Fixes#1310
RELEASE_NOTES=[BREAKING] New secrets format.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit adds a new debug package to gopass.
It is heavily inspired by github.com/restic/restic/internal/debug
and adapted for the gopass use case.
This change allows to further trim down the source code since the
new package doesn't propagate the debug flag in the context anymore.
As such we can now omit passing ctx in most places.
In order to ensure we don't accidentially keep passing ununsed
parameters we also introduce unparam to check for extra arguments.
RELEASE_NOTES=[ENHANCEMENT] New Debug package
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
This commit removes the unnecessary store.Store interface and renames
store/sub to the more apt store/leaf.
RELEASE_NOTES=n/a
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>