Skip to content

Conversation

@andrei-21
Copy link
Contributor

Add check that every label of user or domain is not longer than 63. It better alings with validation in dnssec_prover::rr::Name.

Add check that every label of user or domain is not longer than 63.
It better alings with validation in `dnssec_prover::rr::Name`.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Oct 24, 2025

👋 I see @wpaulino was un-assigned.
If you'd like another reviewer assignment, please click here.

@andrei-21 andrei-21 force-pushed the feature/enhance-hrn-validation branch from d68284c to bb03a51 Compare October 24, 2025 17:02
@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.82%. Comparing base (0eec30a) to head (255a16e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4171      +/-   ##
==========================================
+ Coverage   88.78%   88.82%   +0.03%     
==========================================
  Files         180      180              
  Lines      137066   137123      +57     
  Branches   137066   137123      +57     
==========================================
+ Hits       121694   121793      +99     
+ Misses      12552    12519      -33     
+ Partials     2820     2811       -9     
Flag Coverage Δ
fuzzing 20.99% <0.00%> (-0.58%) ⬇️
tests 88.66% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks


impl HumanReadableName {
/// Constructs a new [`HumanReadableName`] from the `user` and `domain` parts. See the
/// struct-level documentation for more on the requirements on each.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention the new filtering in the struct docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done:

/// The `user` and `domain` parts combined cannot exceed 231 bytes in length;
/// each DNS label within them must be non-empty and no longer than 63 bytes.

@TheBlueMatt TheBlueMatt removed the request for review from wpaulino October 24, 2025 17:30
@andrei-21 andrei-21 force-pushed the feature/enhance-hrn-validation branch from bb03a51 to 255a16e Compare October 24, 2025 22:07
Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

if domain.ends_with('.') {
domain = &domain[..domain.len() - 1];
}
let domain = domain.strip_suffix(".").unwrap_or(domain);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: '.' and "." are different - '.' is the char . whereas "." is the string ".". We should be stripping the char, not the string, as it uses a more efficient algorithm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that what I meant.
I made a followup to clean this and similar instances: #4174.

@TheBlueMatt TheBlueMatt merged commit 8501afa into lightningdevkit:main Oct 25, 2025
22 of 25 checks passed
@andrei-21 andrei-21 deleted the feature/enhance-hrn-validation branch October 25, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants