Recent commits to derivepassphrase.git (e12e11d25356b047a816149446068c356db083c4) https://git.schokokeks.org/derivepassphrase.git/tree/e12e11d25356b047a816149446068c356db083c4 Recent commits feed provided by GitList. Add changelog entry for the introduction of the central configuration file https://git.schokokeks.org/derivepassphrase.git/commit/e12e11d25356b047a816149446068c356db083c4 software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:04:11 +0100 e12e11d25356b047a816149446068c356db083c4 Turn Unicode normalization preferences into user configuration settings Instead of storing Unicode normalization preferences in the vault configuration file, store these settings in the user configuration file: * For a service `SERVICE`, consult the configuration key `vault.SERVICE.unicode-normalization-form`. * If that is unset, or if there is no service, use `vault.default-unicode-normalization-form`. * If that too is unset, default to `NFC`. https://git.schokokeks.org/derivepassphrase.git/commit/c24003e853bd053cf88b2b9c3d940170dbc332ec software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:04:11 +0100 c24003e853bd053cf88b2b9c3d940170dbc332ec Introduce a central user configuration file (and division of responsibility) Introduce a new file for centralized user configuration of `derivepassphrase`, which we expect the user to write and maintain, and which we will never attempt to write to. Treat the existing "vault" configuration file as a "data" file, which is `derivepassphrase`'s responsibility to write and to maintain, and which the user shouldn't edit directly. In general, we now divide the configuration file set semantically into "user" files and "data" files with the aforementioned responsibilities: "user" files are managed by the user, "data" files are managed by the application. (This mirrors the distinction in the XDG Base Directory Specification, although we do not use their paths or their environment variables.) We choose TOML as the file format for "user" files, because it is the simplest configuration file format with both a robust parser in the Python standard library and support for comments. The "data" files currently use JSON, but may use other serialization formats in the future as well. We envision some use cases for the user configuration file such as disabling certain expected warnings, or declaring the desired Unicode normalization form of a text string, but as of now, no such configuration is defined or supported. https://git.schokokeks.org/derivepassphrase.git/commit/f02b81ad6df6d92cdcbb3469a7010f5f340afe99 software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:04:11 +0100 f02b81ad6df6d92cdcbb3469a7010f5f340afe99 Highlight security warnings and risks more prominently in the docs https://git.schokokeks.org/derivepassphrase.git/commit/83df7001d8996914bbfa0beaea8402074c0acd05 software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:04:11 +0100 83df7001d8996914bbfa0beaea8402074c0acd05 Make obtaining the compatibility config filename more explicit When obtaining the compatibility config filename `settings.json` from `cli._config_filename`, rename the corresponding subsystem from `settings` to `old settings.json`. Furthermore, pass that explicit subsystem upon each call. This frees us up to change the default subsystem in a future commit. Because this is not a public function, this is not a change in the public API. Some reformatting is necessary. https://git.schokokeks.org/derivepassphrase.git/commit/b9849af1b001d25ac62165f88778cfa18aacb547 software@the13thletter.info (Marco Ricci) Thu, 19 Dec 2024 15:04:11 +0100 b9849af1b001d25ac62165f88778cfa18aacb547 Merge topic branch 'usage-fixes' into master * t/usage-fixes: Fix user interface errors if the SSH agent does not work Fix usage of `--debug`, `--verbose` and `--quiet` options https://git.schokokeks.org/derivepassphrase.git/commit/855a758e4f21ce51fec6978b575caece90dd515f software@the13thletter.info (Marco Ricci) Tue, 17 Dec 2024 20:13:49 +0100 855a758e4f21ce51fec6978b575caece90dd515f Fix user interface errors if the SSH agent does not work While the configuration and interactive selection of an SSH key is properly guarded against (i.e., any exceptions are wrapped into proper command-line error messages), the calls to `vault.Vault.phrase_from_key` were not similarly guarded. This has now been fixed. The fix also uncovered an incorrectly specified mock function in the test suite, which has been repaired as well. https://git.schokokeks.org/derivepassphrase.git/commit/d15069d2db4040d444f65d7c3db6a854f4adcb92 software@the13thletter.info (Marco Ricci) Fri, 13 Dec 2024 14:52:17 +0100 d15069d2db4040d444f65d7c3db6a854f4adcb92 Fix usage of `--debug`, `--verbose` and `--quiet` options The three "verbosity" options `--debug`, `--verbose` and `--quiet` set the logging level for `derivepassphrase`, globally. Because `click` does not support mutually exclusive options by default, these options are implemented as boolean flags, and it is possible to override earlier verbosity settings with later options. The previous setup treated the three options as disjointed flags, so each callback was called once, irrespective of the others, so the aforementioned intended overriding behavior was not working properly. In addition, the callback was faulty, always enabling each of the flags. The new setup now links all three options to the same flag, with different flag values. We further expose the option objects at the top level, and unify the three callback functions to a single one. As a side effect, we also fix a misclassified diagnostic during configuration file migration ("vault" derivation scheme). https://git.schokokeks.org/derivepassphrase.git/commit/58f6653d0d7a886d1cf02f70bb005de640a6b0b0 software@the13thletter.info (Marco Ricci) Fri, 13 Dec 2024 14:25:44 +0100 58f6653d0d7a886d1cf02f70bb005de640a6b0b0 Merge topic branch 'hypothesis-fixes' into master * t/hypothesis-fixes: Actually correctly implement custom hypothesis settings Overhaul the state machine for testing vault configuration imports https://git.schokokeks.org/derivepassphrase.git/commit/a6a657011d5d39671bd4d0b8bbaa10617e32cfb9 software@the13thletter.info (Marco Ricci) Thu, 12 Dec 2024 12:03:53 +0100 a6a657011d5d39671bd4d0b8bbaa10617e32cfb9 Actually correctly implement custom hypothesis settings The `hypothesis.settings` decorators are intended to modify the currently active `hypothesis` settings profile for singular tests. However, the profiles are defined and selected only *after* the `tests` module has been loaded, so any settings defined in the `tests` module actually modify the `hypothesis` default settings, not the selected profile's settings. Fix this by defining decorators that construct and apply the correct settings, which defines the settings objects deferredly, instead of defining them immediately. https://git.schokokeks.org/derivepassphrase.git/commit/7189e0e3b7eb053181c6a28cc585c7c4aebb6ee7 software@the13thletter.info (Marco Ricci) Thu, 12 Dec 2024 12:03:30 +0100 7189e0e3b7eb053181c6a28cc585c7c4aebb6ee7