https://git.schokokeks.org/derivepassphrase.git/tree/c930819d63ed7a9c38ed146716b1db3f8395dba6Recent commits to derivepassphrase.git (c930819d63ed7a9c38ed146716b1db3f8395dba6)2026-06-21T22:00:04+02:00tag:gitlist.org,2012:commit/c930819d63ed7a9c38ed146716b1db3f8395dba6Add a pytest marker for external SSH agent use2026-06-21T22:00:04+02:00Marco Riccisoftware@the13thletter.info
<pre>This allows finding tests which use external SSH agents more easily, so
that they may be better evaluated for necessity of such agent use.
</pre>
tag:gitlist.org,2012:commit/e8e4a63dcca200af6cc4d570d7202d6f38b660eaRun vault CLI config management tests against the stub agent where possible2026-06-21T21:02:26+02:00Marco Riccisoftware@the13thletter.info
<pre>Several tests for the `vault` CLI check for failures when storing or
retrieving a selected SSH key to/from the `vault` settings file. These
tests used to run against every known SSH agent, separately, but not
truly interact with the agent at all, because all high-level interaction
was stubbed out to return error responses anyway. For externally
spawned or interfaced SSH agents, this is wasteful. So we now restrict
these tests to run against the stubbed agent, which is specifically
designed for these purposes.
Half of these tests previously falsely claimed that they don't actually
need an external agent; now, they no longer lie. The other half never
made any claims; now, they do.
There may be other tests that request external SSH agents but don't
actually require them, but this is somewhat hard to discover
exhaustively. These tests were an obvious first group of tests that
could be fixed in one go. Other groups (if any) will be left to future
commits.
</pre>
tag:gitlist.org,2012:commit/958669d2bf797c45408d7f6ffa4c571b81385a1bUse the stub agent for SSH agent client communications faking2026-06-20T14:39:49+02:00Marco Riccisoftware@the13thletter.info
<pre>Instead of stubbing all I/O to the stub agent ourselves, use the stub
agent's facilities for this.
</pre>
tag:gitlist.org,2012:commit/b76c2afc68fd4e0a5164fa9ff258470be947d5e2Harmonize tests for missing SSH agent communication support2026-06-20T13:58:03+02:00Marco Riccisoftware@the13thletter.info
<pre>Use a common parameter set and a common monkeypatching setup. At the
moment, this is done by copy-pasting the parametrization and setup code,
but this could feasibly be abstracted into a common testing function and
common parameter set within the `tests.data` and `tests.data.callables`
modules.
</pre>
tag:gitlist.org,2012:commit/bad75d455d6e170c20b0405ead16fa732de727e3Reformat recent test changes for consistent style2026-06-20T11:36:36+02:00Marco Riccisoftware@the13thletter.info
<pre></pre>
tag:gitlist.org,2012:commit/f797d5074181fc4d5a35f04367784543249315e4Type generators explicitly as generators, not iterators2026-06-19T22:40:11+02:00Marco Riccisoftware@the13thletter.info
<pre>For compatibility with `contextlib.contextmanager`, and because it is
the more specific type, we annotate generators as `Generator[T, None,
None]`, not as `Iterator[T]`.
In January 2026, typeshed started shipping type annotations for the
Python standard library that deprecate the use of
`contextlib.contextmanager` with general functions returning
`Iterator[T]`. `contextlib.contextmanager` actually requires
a `Generator[T, None, None]` to work, but the `contextlib` and the
`typing` documentation has been erroneously suggesting the `Iterator[T]`
type as a "shorthand" notation for years. For
`contextlib.contextmanager`, the difference matters. So, re-annotate
everything explicitly with generators (when producing) or iterables
(when consuming), whichever is appropriate.
</pre>
tag:gitlist.org,2012:commit/3a69028fe108068a7c7ba6e0cdeeefc18df56e7dRefactor the (SSH agent) testing machinery tests for modularity2026-06-19T21:31:13+02:00Marco Riccisoftware@the13thletter.info
<pre>Use pytest parametrization and hypothesis randomization systematically:
tests that have exhaustive configurations or error conditions use pytest
parametrization, tests with whole classes of configurations or error
conditions use hypothesis randomization. Consolidate tests that test
the same thing, but under different circumstances, into pytest
parametrized tests. Also, use class inheritance to share helper
functions for setting up the stub agent environment across all relevant
test groups.
Consolidating tests usually involves variants of a test for different
variants of the stubbed agent. Converting pytest parametrization to
a hypothesis strategy usually means settling for
a `strategies.sampled_from(existing_parameter_set)` implementation and
leaving any smarter generation logic to future edits.
</pre>
tag:gitlist.org,2012:commit/27f35e7c4101164e42e08051b0698a55735f8322Re-align the stubbed SSH agent socket with "real world" behavior2026-06-18T06:15:10+02:00Marco Riccisoftware@the13thletter.info
<pre>Let the stubbed SSH agent tolerate incomplete request messages, or
multiple request messages at once, within the same `sendall` call.
Furthermore, change the error type to OSError (EBADF) for I/O on closed
socket connections (mirroring the behavior of UNIX domain sockets) and
when closing the connection, assert that no incomplete requests have
been issued to the agent.
With this change, the stubbed SSH agent socket now usefully models the
communication channel between agent and client, and can be sensibly used
to simulate communication and protocol errors (or their absence). This
differentiates it—in terms of scope and use cases—from the agent
protocol response queue, which monkeypatches the client instead of
faking a server, and which operates on full request/response messages.
Add some commentary to the stubbed SSH agent socket docstring to this
effect.
</pre>
tag:gitlist.org,2012:commit/729c89799dc49635698c8f73a59ba79eb3c584a0Serialize the SSH agent protocol numbers as request/response codes2026-06-16T22:19:26+02:00Marco Riccisoftware@the13thletter.info
<pre>When calling `bytes` on the SSH agent protocol number enums, return
their corresponding serialization as request codes or response codes.
(A follow-up to 57e3b1ed832e865e9f9e8316f930b1beae3714f0.)
</pre>
tag:gitlist.org,2012:commit/3790413fb35878eb8500e29e7c6923104869d854Rewrite test data initializers for nicer API docs2026-06-16T19:55:01+02:00Marco Riccisoftware@the13thletter.info
<pre>In attribute declarations, `griffe`/`mkdocstring-python` elides the
object on which the outermost method is called (but correctly autolinks
the method itself). This looks good if the initializer is something
like `base64.b64_decode(data)` (which gets shortened to
`b64_decode(data)`), and terrible if the initializer is something like
`base64.b64_decode(data).decode()` (which gets shortened to `decode()`).
So, to get nicer API docs, rewrite some obvious cases where the object
would otherwise be elided in the "class-bound method + self argument"
style instead.
</pre>