https://git.schokokeks.org/derivepassphrase.git/tree/bdf02f629dc0dbc1b72d74f56a6edb06d681ab60Recent commits to derivepassphrase.git (bdf02f629dc0dbc1b72d74f56a6edb06d681ab60)2024-12-21T01:02:34+01:00tag:gitlist.org,2012:commit/bdf02f629dc0dbc1b72d74f56a6edb06d681ab60Instruct `coverage` to record the test function for each covered line2024-12-21T01:02:34+01:00Marco Riccisoftware@the13thletter.info
<pre>Enable the standard dynamic context setting `test_function` for
`coverage`. This is immensely helpful for debugging whether and which
tests trigger or don't trigger a certain branch of code in
a multi-branch block (`if`/`elif`/`else`, `match`/`case` blocks,
dispatch tables, etc.).
</pre>
tag:gitlist.org,2012:commit/f36630533e3f8d9932e4b1b2975ec3d8bde7b45aFix formatting, some coverage pragmas and some linting rules in tests2024-12-21T00:57:49+01:00Marco Riccisoftware@the13thletter.info
<pre>Aside from formatting fixes, disable the E501/line-too-long and
C419/unnecessary-comprehension-in-call linting rules in tests, where
they hinder debuggability of the tests. (See embedded comments for full
rationale.) Furthermore, make `coverage` recognize `@overload` lines
automatically as lines that should not be included in coverage, like
`assert False` and friends.
</pre>
tag:gitlist.org,2012:commit/cefe3175dd103226d6d404886a091f6dfe85026fSupport exporting the `vault` configuration as a POSIX shell script2024-12-21T00:23:33+01:00Marco Riccisoftware@the13thletter.info
<pre>When exporting `vault` configurations via `--export`, a new option
`--export-as=FORMAT` allows selecting the export format (defaulting to
`json`). Setting `FORMAT` as `sh` selects the new POSIX shell script
export format, which yields a sh(1)-compatible script to reimport the
existing configuration as a series of calls to the `derivepassphrase`
command.
Because the output is very regular, the test suite also includes an
interpreter specifically for the sh(1) subset emitted during an `sh`
export, on top of the usual adaptations to existing tests for the new
functionality.
</pre>
tag:gitlist.org,2012:commit/7a43a0cf4ea5877b3ff07576d5ee5c3ad36c087bAllow unsetting settings when configuring `vault`2024-12-20T17:00:48+01:00Marco Riccisoftware@the13thletter.info
<pre>When configuring a `vault` service, or the global settings, a new
configuration option `--unset FIELD` will unset the specified `FIELD`
from the service or global settings prior to and addition to applying
the requested settings changes. This way, the user can update all
settings on the command-line (except for the "notes") without manually
editing and reimporting a configuration export. (It is permissible to
only unset settings, without applying any other configuration changes.)
</pre>
tag:gitlist.org,2012:commit/8e7790551f023105c34a02df27bf6358e6d06d52Rework `ConfigManagementStateMachine` rules for higher data generation success rates2024-12-20T15:06:20+01:00Marco Riccisoftware@the13thletter.info
<pre>Lower the failure/retry rate for data generation by moving all data
generation into initialization rules and by removing data restrictions
on rule inputs as far as possible, turning the rule effectively into
a no-op if necessary.
The only currently remaining operation with notable retry rate is the
top-level rule selection.
</pre>
tag:gitlist.org,2012:commit/c9e143e6c04d7b667caa34efa02a210d78e3086aFix empty key handling in `vault` config, and harmonize warning text2024-12-20T11:39:45+01:00Marco Riccisoftware@the13thletter.info
<pre>Correctly handle empty `key` settings in the `vault` configuration: if
at the global level, it is equivalent to eliding the setting, but at the
service level, it explicitly disables key usage (even if a global key is
set). This implies that both cases need different cleanup steps.
Harmonize the warning message for ineffective passphrases for services:
always include the affected service name.
If during configuration import we find a key shadowing a passphrase,
issue the same ineffective passphrase warning as would happen during
interactive configuration or interactive use.
(The tests need minor modifications and reparametrization to continue to
cover all warning cases.)
</pre>
tag:gitlist.org,2012:commit/712a1d0d2abca699aae9bf6473dd336a2f3bd55eRewrite incompatible option checking for more readability2024-12-19T15:47:42+01:00Marco Riccisoftware@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/bc746734305a81187ecbdf856cbaebf34f22c470Document handling of file objects internally in CLI2024-12-19T15:27:08+01:00Marco Riccisoftware@the13thletter.info
<pre>The type hints for `click.open_file` are so broad that our file objects,
intended to be typed as `typing.TextIO`, end up getting typed as
`typing.TextIO | typing.IO[typing.Any]` instead. Fix this by casting,
explicitly, one level higher. Also document why no further checks for
readability or writablility are actually performed.
</pre>
tag:gitlist.org,2012:commit/0478233d6e154f2614110d172661b082ba88532dFix hypothesis settings for uninstrumented runs2024-12-19T15:18:58+01:00Marco Riccisoftware@the13thletter.info
<pre>The state machine tests appear to have such slow data generation that
they trigger `hypothesis` health check errors even in uninstrumented
runs (i.e. without a trace function running).
</pre>
tag:gitlist.org,2012:commit/5e5c12b78d541fd09e37595f1ba63deb22c82847Hoist and add tests for internal `key_to_phrase` CLI function2024-12-19T15:04:11+01:00Marco Riccisoftware@the13thletter.info
<pre>Commit d15069d2db4040d444f65d7c3db6a854f4adcb92 extended the internal
`key_to_phrase` CLI function, adding more expansive error handling and
better error messages. The new error handling still needed to be tested,
however. When actually writing tests for this function, it turns out to
be cumbersome to trigger the various scenarios directly, because, as an
internal function, this means issuing a full CLI call in a high-level
mock environment. Instead, we now hoist the function to the outer level,
making it easily accessible to tests and easier to isolate and prepare
a smaller and more specialized mock environment for.
(The primary reason this function was internal before was its use of the
`err` error callback, which still is internal to the CLI, but will now
be supplied explicitly as a callback.)
</pre>