* Add flag '--keep-capitalization' to env subcommend
By adding this boolean flag to the `gopass env` cmd, the original
capitalization of the secret is maintained.
This fixes#2225.
RELEASE_NOTES=[ENHANCEMENT] Add flag to keep env variable capitalization
in `gopass env` subcmd
Signed-off-by: dotcs <git@dotcs.me>
* Rename CLI flag from 'keep-capitalization' to 'keep-case'
Signed-off-by: dotcs <git@dotcs.me>
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>
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#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>
Fixes#1558
RELEASE_NOTES=[BUGFIX] Apply limit in list correctly
RELEASE_NOTES=[ENHANCEMENT] Adding a trailing separator to the listed folders
This is also including a refactoring of the action/list.go in
order to avoid code duplication.
It is important to notice that now one must set MaxDepth to -1 in order
to list all the items in a subtree instead of 0. The 0 is now only
listing the direct parents of the subtree, 1 is listing the subitems,
and so on as explained in docs/commands/list.md
Signed-off-by: Yolan Romailler <yolan@romailler.ch>
* env command: tests: make the test more stringent
RELEASE_NOTES=N/A
- the test was invoking /usr/bin/env and looking for the presence of the
string "secret" (injected by the tests). This would give a lot of
false positives (test passing and code wrong), since "secret" could
appear everywhre in any of the environment variables. We now look also
for the presence of the environment variable that gopass is expected
to inject, FOO.
- while at it, add some comments explaining what is happening and give
a more precise name to the test.
Signed-off-by: Marco Molteni <marco.molteni@mailbox.org>
* env command: tests: add test for secret not found
RELEASE_NOTES=n/a
Signed-off-by: Marco Molteni <marco.molteni@mailbox.org>
* env command: tests: add test for program not found
RELEASE_NOTES=[ENHANCEMENT] env command: more tests
Signed-off-by: Marco Molteni <marco.molteni@mailbox.org>
* FIX env command: do not crash if called without a command to execute
RELEASE_NOTES=[BUGFIX] env command: do not crash if called without a command to execute
Signed-off-by: Marco Molteni <marco.molteni@mailbox.org>
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 slightly rewrites the tree implementation and removes
another unnecessary indirection.
RELEASE_NOTES=[ENHANCEMENT] Rewrite tree implementation.
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>