Recent commits to derivepassphrase.git (d29025e290a39d992a54b36d28b6a503479ef0cb) https://git.schokokeks.org/derivepassphrase.git/tree/d29025e290a39d992a54b36d28b6a503479ef0cb Recent commits feed provided by GitList. Merge topic branch 'vault-config-falsy' into master * t/vault-config-falsy: Signal and list falsy value cleanup steps that were actually performed Manage health checks in centralized hypothesis settings as well Centralize settings for hypothesis deadline management Add changelog entry for key/phrase and falsy behavior changes Align behavior with vault concerning falsy values in config Align behavior with vault concerning key and phrase in config GitHub: Closes #17. https://git.schokokeks.org/derivepassphrase.git/commit/d29025e290a39d992a54b36d28b6a503479ef0cb software@the13thletter.info (Marco Ricci) Thu, 10 Oct 2024 13:31:25 +0200 d29025e290a39d992a54b36d28b6a503479ef0cb Merge topic branch 'support-py313' into master * t/support-py313: Support Python 3.13 https://git.schokokeks.org/derivepassphrase.git/commit/7daaa0e2eb18b33c84cb771efe80725503caebe4 software@the13thletter.info (Marco Ricci) Thu, 10 Oct 2024 13:31:16 +0200 7daaa0e2eb18b33c84cb771efe80725503caebe4 Merge topic branch 'documentation-ideas' into master * t/documentation-ideas: Suggest new reference documentation: vault(1) configuration Add a tutorial: setting up three services with master passphrase Add some ideas for missing documentation pages Tell MkDocs to ignore scriv's changelog snippets https://git.schokokeks.org/derivepassphrase.git/commit/890c3b079f2a50ddea674937ba1eac031894bf33 software@the13thletter.info (Marco Ricci) Thu, 10 Oct 2024 13:31:02 +0200 890c3b079f2a50ddea674937ba1eac031894bf33 Signal and list falsy value cleanup steps that were actually performed Signal whether cleanup was actually perfomed on the requested object or not, and if yes, list the actual cleanup steps undertaken. When importing a vault configuration on the command-line, issue a warning for each cleaning step. Since the warning messages in both the cleanup steps and the check for non-normalized passphrases report on "paths" in a JSON object, implement a fully general JSONPath formatting function (single item selection from the root only). This harmonizes the warnings output, but also causes changes in the test cases and expected output. Additionally, the JSONPath function name clashes with a common local variable name, necessitating renaming, and control flow for the validation function and the vault configuration import action have changed somewhat; the former to impose a consistent validation order (global first, service-specific next), the latter to avoid extraneous else-branches. As a result of all this, this patch is somewhat larger and less concise than it should be, given the modest magnitude of changes it actually introduces. https://git.schokokeks.org/derivepassphrase.git/commit/2eaaa7f8ace52c29c83e36568417c92b358d9710 software@the13thletter.info (Marco Ricci) Wed, 09 Oct 2024 16:20:12 +0200 2eaaa7f8ace52c29c83e36568417c92b358d9710 Support Python 3.13 No functional changes needed; only the project metadata has been amended. https://git.schokokeks.org/derivepassphrase.git/commit/743df7112b0a80c8b4e1fd8503487bb7aa67aa6f software@the13thletter.info (Marco Ricci) Wed, 09 Oct 2024 08:03:20 +0200 743df7112b0a80c8b4e1fd8503487bb7aa67aa6f Manage health checks in centralized hypothesis settings as well Some of the tests that time out under coverage-based slow instrumentation time out during the data generation phase, not the actual test phase (i.e. trigger health check errors). The root cause is the same, and settings objects cannot be stacked, so amend the standard decorator for slow `hypothesis`-based tests, instead of introducing a new one. https://git.schokokeks.org/derivepassphrase.git/commit/695ac3fd833a1d50ba99f9539d668982bbd2bc00 software@the13thletter.info (Marco Ricci) Tue, 08 Oct 2024 13:57:21 +0200 695ac3fd833a1d50ba99f9539d668982bbd2bc00 Centralize settings for hypothesis deadline management Our unit tests run in multiple, very different environments, which leads to drastically different execution times, up to a slowdown factor of roughly 40 (test coverage, "timid" Python tracer). The `hypothesis` library however runs timing checks on each of its tests, indepedent of the available processing power and coverage instrumentation. As a result, some benign tests time out under these circumstances regardless. In the past, I've raised their execution deadline in an ad-hoc manner whenever this happens (or fixed the tests, if they weren't so benign). But instead of littering the test suite with one-time adjustments of deadlines, a more sensible approach is to use a test decorator that ensures a common extended deadline for tests that need it, only if they need it (i.e. run under coverage). So do that. (Sadly, because of how the settings decorator works, this must be applied function-wise, and cannot be stacked with other settings decorators.) Finally, if this deadline extension still doesn't help, then this usually means we are generating huge or expensive-to-evaluate inputs. So limit the size of some of the inputs (string length, recursion depth, size of passphrases to derive) to keep execution times better constrained. https://git.schokokeks.org/derivepassphrase.git/commit/3eabf0cd303c0e2e83a61a7c7835ee66b7fb5acf software@the13thletter.info (Marco Ricci) Tue, 08 Oct 2024 11:43:10 +0200 3eabf0cd303c0e2e83a61a7c7835ee66b7fb5acf Add changelog entry for key/phrase and falsy behavior changes Document the changes in 7d2f2b1bda31ead428d3c009772aaf3d2261d60c and 798ddc103c6c03835394733aeca128b970aacd06 in the changelog. https://git.schokokeks.org/derivepassphrase.git/commit/63053f40ef9487c6ede43eb863bbd9abe578e258 software@the13thletter.info (Marco Ricci) Tue, 08 Oct 2024 10:04:11 +0200 63053f40ef9487c6ede43eb863bbd9abe578e258 Align behavior with vault concerning falsy values in config The original vault(1) sometimes checks only for falsy values (in the JavaScript sense) for its configuration settings. `derivepassphrase` however uses strict type and value checks, and rejects falsy values of the wrong type. This behavior is a visible deviation from vault(1), and shall thus be removed. A new function, `_types.clean_up_falsy_vault_config_values`, normalizes falsy values in a vault configuration to their correct types, in-place. Running this on a potential vault configuration and then calling `_types.is_vault_config` should return the same validity results as vault(1) does. The new handling of falsy values invalidates most of the tests for validation errors, as `None`/`null` was a common way to generate an invalid setting. Instead, keep a master list of vault configurations that is used (perhaps filtered first) for all validation tests, and test the handling of falsy values by generating vault configurations with falsy value replacements from the master list (a custom `hypothesis` strategy). On that note, the existing `_types.validate_vault_config` has proved rather difficult to keep at 100% coverage with the new example vault configurations, because some of the error conditions are triggered elsewhere. Accordingly, instead of treating global and service-specific settings separately and quasi-duplicating all validation checks, unify them into a queue of settings dicts to check, only mildly adjusting for the very few differing keys between them. GitHub: Closes #17. https://git.schokokeks.org/derivepassphrase.git/commit/7d2f2b1bda31ead428d3c009772aaf3d2261d60c software@the13thletter.info (Marco Ricci) Tue, 08 Oct 2024 09:32:00 +0200 7d2f2b1bda31ead428d3c009772aaf3d2261d60c Align behavior with vault concerning key and phrase in config When both a key and a passphrase are specified in the vault configuration, vault(1) would unconditionally use the key, *unless* the command-line overrides this choice. `derivepassphrase` however always gave preference to the most "specific" configuration, and would error out if both key and passphrase were specified at the same specificity. While arguably more intuitive, this behavior is a visible deviation from vault(1), and shall thus be removed. Besides two instances of the `test_200_is_vault_config` in `tests.test_derivepassphrase_types`, this also flips the result of `test_205_service_phrase_if_key_in_global_config` in `tests.test_derivepassphrase_cli`. Because that flipped version needs extra mocking infrastructure – the `sign` function – and because that mock function already exists in another test (but local to that test), promote that mock function to global and shift it into the top-level `tests` module. Since we had to update the imports in `tests` anyway, we also purged `dpp.vault...` references in `tests.test_derivepassphrase_cli` in favor of `vault...`. https://git.schokokeks.org/derivepassphrase.git/commit/798ddc103c6c03835394733aeca128b970aacd06 software@the13thletter.info (Marco Ricci) Sat, 05 Oct 2024 23:30:07 +0200 798ddc103c6c03835394733aeca128b970aacd06