Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backend] Domain observable checker is incorrect (#7620) #8768

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

SarahBocognano
Copy link
Member

Proposed changes

  • Change the regex to also accept dots on subdomain

Related issues

@SarahBocognano SarahBocognano added the filigran team use to identify PR from the Filigran team label Oct 24, 2024
@SarahBocognano SarahBocognano self-assigned this Oct 24, 2024
@SouadHadjiat

This comment was marked as resolved.

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.30%. Comparing base (bd767c4) to head (baf58e8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8768   +/-   ##
=======================================
  Coverage   66.30%   66.30%           
=======================================
  Files         597      597           
  Lines       61033    61033           
  Branches     6275     6279    +4     
=======================================
  Hits        40468    40468           
  Misses      20565    20565           

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

@marieflorescontact marieflorescontact self-requested a review October 29, 2024 09:13
Copy link
Member

@marieflorescontact marieflorescontact left a comment

Choose a reason for hiding this comment

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

Tested ok with corrects and incorrects domains and subdomains.
the only case that seems to be not covered by test is a very long subdomain:
"very0long0subdomain0that0exceeds0the0sixty0three0character0limit.mydomain.com"
subdomain are limited to 63 characters to be valid

@@ -12,6 +12,8 @@ describe('Regex Pattern Tests', () => {
expect('example.com').toMatch(domainChecker);
expect('sub.example.co.uk').toMatch(domainChecker);
expect('løveskateboards.com').toMatch(domainChecker);
expect('test._mysubdomain.mydomain.com').toMatch(domainChecker);
expect('test_mysubdomain.domain.io').toMatch(domainChecker);
expect('invalid_domain.12_3').not.toMatch(domainChecker);
Copy link
Member

Choose a reason for hiding this comment

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

maybe add a test that it's not working if there is a dot in the main name and no dots (exemple: invalid_domain)

@Archidoit
Copy link
Member

I just suggested to add a little test case. Since everything is ok, I'm gonna approve the PR so you can merge it after adding the test.

@SarahBocognano SarahBocognano merged commit cdf27d9 into master Nov 5, 2024
6 checks passed
@SarahBocognano SarahBocognano deleted the issue/7620 branch November 5, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants