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

Remove trailing dot from the fqdn when present #35

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

arturo-seijas
Copy link
Collaborator

@arturo-seijas arturo-seijas commented Feb 27, 2024

Applicable spec: https://go-acme.github.io/lego/dns/httpreq/

Overview

Remove trailing dot from the fqdn when present, per the spec above

Rationale

N/A

Module Changes

forms.py

Checklist

  • The contributing guide was applied
  • The PR is tagged with appropriate label (urgent, trivial, complex)

@arturo-seijas arturo-seijas requested a review from a team as a code owner February 27, 2024 09:19
@mthaddon mthaddon changed the title Remove tailing dot from the fqdn when present Remove trailing dot from the fqdn when present Feb 27, 2024
Copy link

Test coverage for 9cc9018

Name                                                   Stmts   Miss Branch BrPart  Cover   Missing
--------------------------------------------------------------------------------------------------
httprequest_lego_provider/__init__.py                      1      0      0      0   100%
httprequest_lego_provider/apps.py                          5      0      0      0   100%
httprequest_lego_provider/dns.py                          58      0      8      0   100%
httprequest_lego_provider/forms.py                        22      0      2      0   100%
httprequest_lego_provider/migrations/0001_initial.py       8      0      0      0   100%
httprequest_lego_provider/migrations/__init__.py           0      0      0      0   100%
httprequest_lego_provider/models.py                       10      0      0      0   100%
httprequest_lego_provider/serializers.py                  11      0      0      0   100%
httprequest_lego_provider/settings.py                      5      0      0      0   100%
httprequest_lego_provider/urls.py                          8      0      0      0   100%
httprequest_lego_provider/views.py                        49      0      8      0   100%
--------------------------------------------------------------------------------------------------
TOTAL                                                    177      0     18      0   100%

Static code analysis report

Run started:2024-02-27 09:22:09.647235

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 921
  Total lines skipped (#nosec): 0
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

@arturo-seijas arturo-seijas merged commit aa6fd34 into main Feb 27, 2024
13 checks passed
@arturo-seijas arturo-seijas deleted the support-trailing-dot branch February 27, 2024 09:37
@weiiwang01
Copy link
Contributor

Maybe we should consider saving fully qualified domain names with the trailing dot in the database, instead of stripping the trailing dot from the FQDN? In a zone file, a relative name (without a trailing dot) is considered an error unless concatenated with an origin. https://datatracker.ietf.org/doc/html/rfc1035#section-5.1

Of cause I might be wrong since I don't know if the same standard for DNS zone files should be apply to databases in httprequest-lego-provider.

@arturo-seijas
Copy link
Collaborator Author

Maybe we should consider saving fully qualified domain names with the trailing dot in the database, instead of stripping the trailing dot from the FQDN? In a zone file, a relative name (without a trailing dot) is considered an error unless concatenated with an origin. https://datatracker.ietf.org/doc/html/rfc1035#section-5.1

Of cause I might be wrong since I don't know if the same standard for DNS zone files should be apply to databases in httprequest-lego-provider.

Good point, however, what we'll be storing in the repo on a file per domain will be the subdomain with the challenge, for instance, for example.canonical.com well have a canonical.com file with the following content:
_acme_challenge.example 60 IN TXT [value as sent in the form]

We are just discarding the trailing dot since we have to support both formats, with, and without, as per to https://go-acme.github.io/lego/dns/httpreq/

@weiiwang01
Copy link
Contributor

discarding the trailing dot since we have to support both formats

Understand, thanks for the explanation.

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.

5 participants