Recent commits to derivepassphrase.git (5022fff219bf1bc30988d3070e564ad058f0d5c4) https://git.schokokeks.org/derivepassphrase.git/tree/5022fff219bf1bc30988d3070e564ad058f0d5c4 Recent commits feed provided by GitList. Add Changelog entry for the vault exporter https://git.schokokeks.org/derivepassphrase.git/commit/5022fff219bf1bc30988d3070e564ad058f0d5c4 m@the13thletter.info (Marco Ricci) Sat, 31 Aug 2024 22:09:41 +0200 5022fff219bf1bc30988d3070e564ad058f0d5c4 Rename vault v0.2/v0.3 classes, and fix API weirdnesses and test coverage The `Reader` classes are now named `VaultNativeConfigParser`, because `Reader` is a very non-descript name. The interface is now somewhat more pythonic, and uses fewer internal branches. Further tests of the internals have been added, so the module has 100% test coverage. https://git.schokokeks.org/derivepassphrase.git/commit/0169d5fbbb766fef119548e8b07cd0e2bcd43ac6 m@the13thletter.info (Marco Ricci) Sat, 31 Aug 2024 21:26:49 +0200 0169d5fbbb766fef119548e8b07cd0e2bcd43ac6 Add more tests of the storeroom format exporter's internals Further tests are necessary to achieve 100% coverage, but these concern the detection of format errors, so the test files are rather hard to generate. https://git.schokokeks.org/derivepassphrase.git/commit/349f20ebdbc4c3bd4e4fc9e8454dc10b5d081396 m@the13thletter.info (Marco Ricci) Sat, 31 Aug 2024 21:24:29 +0200 349f20ebdbc4c3bd4e4fc9e8454dc10b5d081396 Test exporter data loading functionality more robustly Move the `_load_data` function, which deals with determining the correct vault storage format (with automatic rollover) into the top level, where the function can be tested in isolation, and stubbed out if necessary. Also, use the environments with disabled cryptography support to test for correct failure behavior of the exporter. Use `importlib.util.find_spec` instead of an `import` statement to check for importability of a module, which does not require handling of `ModuleNotFoundError` if restricted to top-level modules/packages. https://git.schokokeks.org/derivepassphrase.git/commit/fa6125de4455fb187db8888e510400e9e9820b3b m@the13thletter.info (Marco Ricci) Sat, 31 Aug 2024 21:04:32 +0200 fa6125de4455fb187db8888e510400e9e9820b3b Move exporter command-line interface into a separate module Also replicate this module structure in the tests, which allows us to use `pytest.importorskip` to deal with missing `cryptography` support. https://git.schokokeks.org/derivepassphrase.git/commit/0be132367e57855736c2c4163dd6c606f2b88d23 m@the13thletter.info (Marco Ricci) Sat, 31 Aug 2024 13:32:33 +0200 0be132367e57855736c2c4163dd6c606f2b88d23 Add preliminary tests for the exporter Includes basic testing of command-line functionality, explicit examples of each supported format, and proper hatch environment and dependency selection (with exporter support, or without) to run tests in. The major missing pieces are weird-to-reach error conditions in the internals of the exporter functions (which require invasive mocking) and explicit API testing of the exporter functions (i.e. beyond each exporter's "main" function). Because the internal API is not yet stable, particularly the v0.2 and v0.3 exporters, this is currently left as a TODO. Since we are attempting to support installations without the cryptography module, we must ensure the exporter modules all stay importable without triggering import errors. (This is also relevant for pytest's test collection phase, where those modules too are scanned for doctests.) Currently we stub out each (sub-)module of the cryptography package implicitly, such that calling any method on the stub raises an import error, as well as explicitly through a `STUBBED` attribute on the exporter module. https://git.schokokeks.org/derivepassphrase.git/commit/fa1083e98907a6a7dc48e8decfa7146708510341 m@the13thletter.info (Marco Ricci) Sun, 25 Aug 2024 23:50:03 +0200 fa1083e98907a6a7dc48e8decfa7146708510341 Add command-line interface to the exporter A new script `derivepassphrase_export` implements a command-line interface to the exporter machinery. It is implemented as a separate script because it has a very different call signature which doesn't easily map to `derivepassphrase`'s command-line interface. https://git.schokokeks.org/derivepassphrase.git/commit/9fa74020070b37e150e4f34b3bd77ea279d0350c m@the13thletter.info (Marco Ricci) Sun, 25 Aug 2024 23:31:24 +0200 9fa74020070b37e150e4f34b3bd77ea279d0350c Move vault key and path detection logic into the exporter module Instead of having both exporters reimplement the logic for determining the vault key and vault configuration path, implement this functionality in the `derivepassphrase.exporter` package, which is otherwise still empty. https://git.schokokeks.org/derivepassphrase.git/commit/d525f4302bd1f00edffe1159f78b8da745f06d24 m@the13thletter.info (Marco Ricci) Sun, 18 Aug 2024 09:41:16 +0200 d525f4302bd1f00edffe1159f78b8da745f06d24 Add prototype for "vault v0.2/v0.3"-type data export Based on a rather direct translation of vault's "legacy" configuration migrator, for storeroom-enabled builds of vault. https://git.schokokeks.org/derivepassphrase.git/commit/3b2b65e4f564d15046a348842b2d28a495ec12ff m@the13thletter.info (Marco Ricci) Sun, 18 Aug 2024 00:45:19 +0200 3b2b65e4f564d15046a348842b2d28a495ec12ff Support exports from outside the current directory In the storeroom exporter, pass the storeroom directory explicitly, and open and glob all bucket files relative to this directory. https://git.schokokeks.org/derivepassphrase.git/commit/2d7402652cd0b845a1c755939c0d8634519af7b4 m@the13thletter.info (Marco Ricci) Sun, 18 Aug 2024 00:14:59 +0200 2d7402652cd0b845a1c755939c0d8634519af7b4