Skip to content

Adds ability to respond to dns-01 challenges from CA - #47

Open
netops2devops wants to merge 6 commits into
mainfrom
develop/dcv
Open

Adds ability to respond to dns-01 challenges from CA#47
netops2devops wants to merge 6 commits into
mainfrom
develop/dcv

Conversation

@netops2devops

@netops2devops netops2devops commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Implements feature request as discussed in #35

  Introduce DNS01 challenge as an alternative to EAB for ACME account
  registration, supporting CAs that require EAB even with DNS01. Extract
  AcmeProxyConfig and certificate bundle splitting into dedicated files.
  Replace package-level cfgModeFlag map with useEAB/useDNS01 struct fields
  to eliminate cross-test state pollution. Separate challenge solver setup
  from account registration in createLegoClient so the two concerns are
  independently conditioned. Expand unit tests to cover DNS01-only, EAB-only,
  and both-mode validation paths, User interface methods, mixed-PEM bundle
  parsing, and RevokeCertificate success and error paths.
  Code changes:
  - Rename config field `dns01` → `dns01_txt` in config.go and ca.json
  - Remove `metrics.enabled` field (always-on now)
  - Add config_test.go with unit tests for ExternalCAS config parsing
  - Slim down external_test.go (tests moved to config_test.go)
  - Add `make test` target for running externalcas tests with -race

  Docs changes:
  - Add new configuration.md page with full field reference and upstream CA URL table
  - Remove configuration section from install.md (now its own page)
  - Remove pre-built binary install method from install.md
  - Rewrite README and docs landing page to lead with DNS01-TXT as a supported mode alongside EAB, and add LetsEncrypt as a viable upstream CA
  - Update quickstart.md to cover both EAB and DNS01-TXT configuration paths
  - Add dns01-txt.png sequence diagram asset
  - Regenerate Hugo public/ output

Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@netops2devops netops2devops changed the title #35 - Adds ability to respond to dns-01 challenges from CA Adds ability to respond to dns-01 challenges from CA Aug 9, 2026
…ion tests from external_test.go to config_test.go

Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
  config_test.go:
  - Assert metricsEnabled derived field is set/unset correctly by Validate(),
    including the invariant that it stays false when Validate() returns an error
  - Add parseConfig round-trip test for dns01_txt JSON fields (provider,
    dns_servers, env_vars) to guard against tag-name regressions after the
    dns01 → dns01_txt rename
  - Add parseConfig round-trip test for the metrics block, verifying the
    dataSource camelCase JSON key matches the struct tag

  external_test.go:
  - Add TestNew_DNS01OnlyConfig: verifies New() sets dnsProvider on the
    returned struct when only dns01_txt is configured (no EAB)
  - Restore TestNew_ValidatesConfig: exercises New()'s error path for invalid
    configs (empty bytes, missing ca_url, no mode, partial metrics)

Signed-off-by: Kapil Agrawal <7047165+netops2devops@users.noreply.github.com>
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.

2 participants