17 Commits

Author SHA1 Message Date
FG
de099d9202
Add flag '--keep-case' to env subcommend (#2226)
* 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>
2022-05-22 10:10:26 +02:00
Dominik Schulz
16c071a780
Enable golangci-lint on push and pr (#2158)
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-24 21:58:53 +01:00
Dominik Schulz
f2cac9f3b3
Refactor action.ExitError into its own package (#2114)
RELEASE_NOTES=n/a

Fixes #2107

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-01-16 14:34:12 +01:00
Yolan Romailler
3d3c7d5b77
GCI-ing imports (#2072)
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>
2021-12-28 13:59:31 +01:00
Dominik Schulz
289fbdcd6e
Fix gopass env for subtress (#1894)
Fixes #1893

RELEASE_NOTES=[BUGFIX] Fix gopass env with subtrees

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-04-05 14:18:44 +02:00
Dominik Schulz
2e1f2e442d
Avoid logging credentials (#1886)
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>
2021-03-27 21:28:09 +01:00
Dominik Schulz
08b7d56d65
Add suffix f to formating out methods (#1794)
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>
2021-02-15 19:38:58 +01:00
Dominik Schulz
ff349772ac
Reduce dependencies on internal packages (#1707)
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>
2021-01-13 18:21:09 +01:00
Dominik Schulz
ddc223262e
Remove MIME secrets (#1665)
RELEASE_NOTES=[CLEANUP] Remove MIME

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-02 12:47:58 +01:00
Yolan Romailler
10f89fe39e
Correcting newlines handling (#1579)
Fixes #788
Fixes #1575
Fixes #1574
Fixes #1573
Fixes #1570
Fixes #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>
2020-09-23 19:43:41 +02:00
Yolan Romailler
ef72769301
Refactoring List (#1559)
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>
2020-08-27 12:28:27 +02:00
Marco Molteni
1eb6d1ba4d
Fix env command crash (#1475)
* 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>
2020-08-07 20:00:56 +02:00
Marco Molteni
7c41f7f8f0
env command: log only if gopass debug (#1476)
Signed-off-by: Marco Molteni <marco.molteni@mailbox.org>
2020-08-02 16:19:30 +02:00
Dominik Schulz
dccfbeb011
Introduce typed MIME Secrets (#1415)
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>
2020-06-11 16:46:05 +02:00
Dominik Schulz
668dd0a486
Rewrite tree implementation (#1395)
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>
2020-05-29 21:59:35 +02:00
Dominik Schulz
0cfa536d28
Add debug package (#1396)
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>
2020-05-29 13:47:35 +02:00
Dominik Schulz
09c9031fb4
Unexport interal packages (#1363)
RELEASE_NOTES=[CLEANUP] Move internal packages to internal.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-05-16 20:27:56 +02:00