Added case sensitivity flag (require_exact_case) for certain DCV methods#65
Conversation
…to Website Change and DNS Change methods). Added tests. Reworked DCV checker logic accordingly.
…but not TXT, with tests
…lines of logic in DCV checker to improve test coverage.
There was a problem hiding this comment.
Pull request overview
This PR updates Domain Control Validation (DCV) request models and checker logic to support configurable case sensitivity when comparing challenge values, with method-specific defaults and enforcement (notably for DNS TXT vs non-TXT records). It also updates unit tests to reflect the new behavior and bumps dependency and project/spec versions.
Changes:
- Add
require_exact_caseto DCV parameter models with method-appropriate defaults and enforcement for DNS record types. - Update DCV DNS/HTTP validation logic to perform case-sensitive vs case-insensitive comparisons based on
require_exact_case. - Update unit tests and bump dependency, project, and spec versions.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/open_mpic_core/common_domain/check_parameters.py |
Adds require_exact_case across DCV parameter models and enforces it for DNS Change (non-TXT forced off). |
src/open_mpic_core/mpic_dcv_checker/mpic_dcv_checker.py |
Threads require_exact_case through DNS and WEBSITE_CHANGE HTTP evaluation logic. |
tests/unit/test_util/valid_check_creator.py |
Extends test request factory helpers to set require_exact_case where relevant. |
tests/unit/open_mpic_core/test_mpic_dcv_checker.py |
Refactors/extends DCV checker tests to validate new case-sensitivity behavior by method and flag. |
tests/unit/open_mpic_core/test_check_request_parameters.py |
Adds test ensuring non-TXT DNS Change requests force require_exact_case to False. |
pyproject.toml |
Bumps runtime dependencies and API spec version. |
src/open_mpic_core/__about__.py |
Bumps package version to 6.4.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… forced False for certain methods
birgelee
left a comment
There was a problem hiding this comment.
I am in favor, would just recommend a public statement/update that some aspects of default behavior will be changing.
This pull request introduces improved handling of case sensitivity for domain control validation (DCV) challenge values across various DCV methods. The changes add a new
require_exact_caseparameter to DCV parameter models, enforce correct case-sensitivity behavior for each validation method, and update the validation and test logic accordingly. Additionally, dependency versions are updated and the project version is bumped.This should mostly affect those that use HTTP Website Change or DNS Change with TXT record methods and have been relying on matching hex values (that are case insensitive), as the default for case sensitivity is now on ("require_exact_case = True") for those methods. For case-insensitive matching logic, set the flag to False. See the OpenAPI spec for more information.
Case sensitivity handling improvements
require_exact_casefield to all DCV parameter models (e.g.,DcvDnsChangeValidationParameters,DcvWebsiteChangeValidationParameters) to control case-sensitive comparison of challenge values, defaulting appropriately per method. For DNS validation, case sensitivity is only enabled for TXT records and forced off for others. [1] [2] [3] [4] [5] [6]require_exact_caseflag in both DNS and HTTP validations, ensuring that comparisons are performed in a case-sensitive or case-insensitive manner as required. [1] [2] [3] [4] [5]require_exact_caseis always set toFalsevia a model validator, ensuring consistent and correct behavior regardless of input.Test updates and coverage
Dependency and version updates
pyproject.toml:requeststo 2.33.0,aiohttpto 3.13.4, andcryptographyto 46.0.6.6.4.0insrc/open_mpic_core/__about__.py.3.9.0inpyproject.toml.