Recent commits to derivepassphrase.git (7483aceb6e937bda5c0128129a4076b4df197d06) https://git.schokokeks.org/derivepassphrase.git/tree/7483aceb6e937bda5c0128129a4076b4df197d06 Recent commits feed provided by GitList. Hide translation template enums behind a type alias This is getting annoying to type, and error-prone to update. https://git.schokokeks.org/derivepassphrase.git/commit/7483aceb6e937bda5c0128129a4076b4df197d06 software@the13thletter.info (Marco Ricci) Mon, 13 Jan 2025 14:09:49 +0100 7483aceb6e937bda5c0128129a4076b4df197d06 Merge topic branch 'harmonize-exporter-interface' into master * t/harmonize-exporter-interface: Add changelog entry for export handler interface harmonization Test the export handler dispatcher as well as the handlers directly Harmonize the interface for both vault config export handlers Accept all bytes-like objects as byte strings in the export subcommand https://git.schokokeks.org/derivepassphrase.git/commit/a0fe6ac8f03daa0df66dfedcf7071732f79ae45b software@the13thletter.info (Marco Ricci) Mon, 13 Jan 2025 12:40:34 +0100 a0fe6ac8f03daa0df66dfedcf7071732f79ae45b Add changelog entry for export handler interface harmonization https://git.schokokeks.org/derivepassphrase.git/commit/9b9febbf4861ef7d6917367965677a58fd7ce1ad software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 20:06:57 +0100 9b9febbf4861ef7d6917367965677a58fd7ce1ad Test the export handler dispatcher as well as the handlers directly For each test calling an export handler directly, also perform the test when calling the export handler dispatcher. https://git.schokokeks.org/derivepassphrase.git/commit/d25cdbdd2494feabfb29e8d8a6d8f695475bf7a2 software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 19:04:57 +0100 d25cdbdd2494feabfb29e8d8a6d8f695475bf7a2 Harmonize the interface for both vault config export handlers Harmonize the interface for the `storeroom` and the `vault_native` config export handlers. Specifically, introduce a common interface `exporter.ExportVaultConfigDataFunction` which all such handlers must adhere to, as well as a registry of handlers and a decorator for registering handlers immediately upon definition. A new top-level function `exporter.export_vault_config_data` adhering to this interface will dispatch to the correct implementation, based on the handler registry; its use is recommended over calling the handlers directly. Though it is not encoded in the programmatic interface definition, the intent is to use common exceptions and exception messages for common failure modes. (The intended meanings of the exceptions are listed in the docstring of `exporter.export_vault_config_data`.) Specifically, introduce a new error message constant for when a given handler name is not registered in the registry, and an exception class `exporter.NotAVaultConfigError` for when the target path cannot be decrypted and decoded in the requested vault config encoding format with the given or inferred storage master key. Also update some outdated or wrong aspects of the handler docstrings. Additionally, the registry is empty upon definition to avoild circular imports. A separate call to the `exporter.find_vault_config_data_handlers` function is necessary to populate the standard set of handlers. `exporter.export_vault_config_data` will call this automatically. Because of this updated interface, the `vault_native.export_vault_native_data` handler no longer supports specifying multiple formats to try. The caller in `derivepassphrase.cli` already handles trying multiple formats natively, but additionally no longer dispatches to the handler functions itself, relying on `exporter.export_vault_config_data` for this task instead. Finally, update the tests to include the handler registry, the decorator, the change of parameter names and the change in handling attempting multiple formats. https://git.schokokeks.org/derivepassphrase.git/commit/0ecb8a91d39b699816e21d6e215878ddc50252e3 software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 19:04:57 +0100 0ecb8a91d39b699816e21d6e215878ddc50252e3 Accept all bytes-like objects as byte strings in the export subcommand This is a breaking API change, because some function return types have been widened. https://git.schokokeks.org/derivepassphrase.git/commit/a9bd473172968db23d6b79c7a12ad7bdb9203d3c software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 19:04:57 +0100 a9bd473172968db23d6b79c7a12ad7bdb9203d3c Merge topic branch 'usage-fixes' into master * t/usage-fixes: Fix tests for rephrased "Cannot update the %s settings" message https://git.schokokeks.org/derivepassphrase.git/commit/c4574c9f06dd37f8a95af0efafb068ad62a8b7d7 software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 18:54:56 +0100 c4574c9f06dd37f8a95af0efafb068ad62a8b7d7 Fix tests for rephrased "Cannot update the %s settings" message The rephrasing was introduced in 1b29904d789be7742119bfa06ce11aa5b7ffb6f9. https://git.schokokeks.org/derivepassphrase.git/commit/f2585c5ec1b1cb0f5bc7a2d924e294497696d9d6 software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 18:51:01 +0100 f2585c5ec1b1cb0f5bc7a2d924e294497696d9d6 Merge topic branch 'usage-fixes' into master * t/usage-fixes: Fix translation string formatting of preformatted paragraphs Make debug and info messages from exporter subcommands translatable https://git.schokokeks.org/derivepassphrase.git/commit/be9ba21a9696c59cea79365f9567decc7fa761ba software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 16:39:58 +0100 be9ba21a9696c59cea79365f9567decc7fa761ba Fix translation string formatting of preformatted paragraphs Due to a sign error, the paragraph content was being dropped. And since we now actively include translation strings with preformatted paragraphs, include coverage tracking for this case. https://git.schokokeks.org/derivepassphrase.git/commit/70be2295f958ed99bac34e2adc469d6d94a68a11 software@the13thletter.info (Marco Ricci) Sat, 11 Jan 2025 16:33:03 +0100 70be2295f958ed99bac34e2adc469d6d94a68a11