15 Commits

Author SHA1 Message Date
Yolan Romailler
d56639fcd7
[CLEANUP] Migration of options to more appropriate sections (#2681)
* [CLEANUP] Moving options to the correct config section

This adds an easy migration path to our config handling, which should
allow us to migrate option names around much more easily in the future.

Any system level config or env variables options are not migrated.

This also fixes a bug in our test code, where the root mount path was
not properly set in our config, because we used "path:" instead of
"path=" to set it.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [DOCUMENTATION] Document legacy options and their migration path

This also makes sure that legacy options aren't used in the code anymore using the docs test and its regexp

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Removing weird spaces from changelog

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [DOCUMENTATION] Reformatting our Markdown tables properly

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [TESTING] Patching a timezone bug in tests

This is a fun one where if your Timezone isn't UTC and you are past midnight but it's not past midnight UTC, the tests would fail because you're not using the right date to validate it.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Fix a typo and use the correct Env variables in the doc about the custom Env variables

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [BREAKING] Custom Env options moved from GOPASS_CONFIG_CONFIG_KEY_i to GOPASS_CONFIG_KEY_i

As discussed in #2617, this actually reflects the way GIT_CONFIG works.

It also fixes a potential Panic in our codebase when IsSet was called
without any Preset config on a non-existing key.

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [CLEANUP] Patching all of the new linter complaints

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [CLEANUP] Use Go1.21 everywhere

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] Increase our Golangci timeout

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

* [n/a] code review comment and extra regression test

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>

---------

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
2023-11-03 18:40:58 +01:00
Dominik Schulz
f58454452f
Increase test coverage (#2461)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-12-10 23:05:33 +01: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
117db90478
Update deps (#2168)
Ran 'make upgrade' (includes gofumpt).

RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2022-03-17 20:55:53 +01:00
Dominik Schulz
73ed2c189e
Upgrade to Go 1.16 (#1803)
Remove usage of io/ioutil: https://golang.org/doc/go1.16?s=03#ioutil

RELEASE_NOTES=[ENHANCEMENT] Use Go 1.16

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-02-17 21:39:07 +01:00
Dominik Schulz
d9759ffec8
Replace github.com/pkg/errors by stdlib errors (#1750)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2021-01-26 09:21:52 +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
Dominik Schulz
d6c62d869e
Add more tests and subtests (#1418)
RELEASE_NOTES=n/a

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2020-06-13 23:08:07 +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
Moritz Johner
21ff26d73a
feat: support windows (#1295)
* feat: support windows

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>

* fix: revert unnecessary changes

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>

* fix: remove useless test

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
2020-04-29 00:27:05 +02:00
Martin Hoefling
3ba59c0d6b
Windows tests (#1171)
* make tests run on windows and osx

* add osx and windows as test target
* add slow test factor as osx doesn't seem to be fast enough to capture the test interval
* reset buildflags on windows as no PIC code can be built
* append .exe to gopass output
* fix some tests on windows, disable others

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>

* kill gpg and test commands on windows after test

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>

* disable problematic clipboard and jsonapi tests under windows

Signed-off-by: Martin Hoefling <martin.hoefling@gmx.de>
2020-04-24 17:52:00 +02:00
Dominik Schulz
16e9e0f4b9
Update tests to abort if return value is critical (#997)
This commit updates the test cases to abort in cases where the returned values
must not be nil in order to avoid subsequent tests from panicking.

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
2018-11-25 16:49:43 +01:00
Dominik Schulz
132b21fd02 Fix some typos and minor issues 2017-09-14 20:31:17 +02:00
Dominik Schulz
8ef89b3a59 Improve error handling and propagation (#280)
This commit makes heavy use of github.com/pkg/errors to improve
handling and propagation of errors and to provide more meaningful
error messages. It also fixes some minor issues/wording wrt. error
message. Also it introduces distinct exit codes for different types
of errors.

Fixes #150
2017-08-23 17:38:22 +02:00
Dominik Schulz
0a72d3a2b0 Add more tests (#160) 2017-06-21 16:17:34 +02:00