This change adds GoDoc comments to many of the public symbols in the
`pkg/` directory. It also includes various improvements to the
documentation in `README.md` and other markdown files in the `docs/`
directory.
This is a partial documentation effort, as requested by the user, to
get a pull request submitted quickly.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* [feat] Add verbosity levels to the debug package
Use debug.V(N).Log instead of debug.Log to indicate message
verbosity (higher numbers indicate more verbose messages).
Use GOPASS_DEBUG_VERBOSE=N to control the desired level
of verbosity in the log output.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Document the verbosity env vars.
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* Allow negative verbosity values
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
---------
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
* 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>
* test: fix failing debug_test.go on Windows
--- FAIL: TestDebug (1.52s)
testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestDebug1334287763\001\gopass.log: The process cannot access the file because it is being used by another process.
--- FAIL: TestDebugSecret (1.90s)
testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestDebugSecret2374267425\001\gopass.log: The process cannot access the file because it is being used by another process.
--- FAIL: TestDebugFilter (1.77s)
testing.go:1097: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestDebugFilter836798913\001\gopass.log: The process cannot access the file because it is being used by another process.
The gopass.log needs to be closed before it can be deleted on Windows.
Fixes: f584544 ("Increase test coverage (#2461)")
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* test(debug): close logFile in initDebug
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit replaces some overly complex constructs with type
parameters.
Fixes#2030
RELEASE_NOTES=[ENHANCEMENT] Generics
Signed-off-by: Dominik Schulz <dominik.schulz@gauner.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 adds a getting started section to the readme and improves
the gopass clone UX a little it. It also fixes the call depth for nested
debug.Log invocations (e.g. during ExitError) and adds debug logging
for every out invocation.
Fixes#1839
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>