Commit fd6c432
authored
feat(dcv): DNS domain control validation via IDomainValidatorFactory (#5)
* fix: P1-P3 improvements — OAuth auth, sync CompleteAdding, Ping enabled check, renewal window, retry logic, IDisposable, GroupNumber config, nested product response model
* test: add unit tests for P1-P3 fixes; update MockCertificateData to nested product response format
* test: rewrite integration tests — remove stale hardcoded-order tests, add lifecycle test, make empty-account resilient
* docs: add GroupNumber field, per-account product code note, AgreementAcceptance and DCV findings
* chore: refactor Makefile — extract all API targets into scripts/; add generate-order-149-fresh, probe-endpoints, get-field-details targets
* docs: add cross-plugin analysis, certinext improvement plan, and API findings from sandbox exploration
* chore: add V2 API Makefile targets and scripts; ignore analysis/ directory
Adds 21 make targets covering every CERTInext V2 operation (ssl-certificates,
private-pki-certificates, catalog, groups, orgs, domains, reports). Each target
delegates to a corresponding script under scripts/v2/ which sources the new
scripts/lib/certinext-v2-auth.sh for CERTInext-native SHA256 token exchange.
Adds analysis/ to .gitignore so scratch docs and support emails are never committed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(constants): add Dcv constants and Config DCV key names
Add Constants.Dcv subclass with dcvMethod codes (1=DNS TXT, 2=HTTP,
3=Email), dcvStatus values (0=Pending, 1=Validated, 2=Rejected), and
the default TXT record hostname template. Add DcvEnabled,
DcvTxtRecordTemplate, and DcvPropagationDelaySeconds to Constants.Config.
* feat(api): add GetDcv and VerifyDcv request/response DTOs
Add GetDcvRequest, DcvRequestDetails, and VerifyDcvRequest for the
GetDcv/VerifyDcv endpoints. Add GetDcvResponse, DcvResponseDetails,
VerifyDcvResponse, TrackOrderDomainVerification (with JsonExtensionData
for heterogeneous per-domain entries), and DomainVerificationDetail.
Wire DomainVerification onto TrackOrderResponseDetails.
* feat(client): add GetDcvAsync and VerifyDcvAsync
GetDcvAsync posts to GetDcv and returns the token (and file/email
fields) for a domain on an existing order. VerifyDcvAsync posts to
VerifyDcv to ask CERTInext to check the published DNS TXT record.
Both methods follow the existing pattern: BuildMetaAsync, retry,
auth-failure detection, DeserializeOrThrow, meta.status check,
structured logging with OrderNumber and Domain context.
* feat(config): add DcvEnabled, DcvTxtRecordTemplate, DcvPropagationDelaySeconds
Add three DCV-related fields to CERTInextConfig with documented defaults
(false, _emsign-validation.{0}, 30 s) and corresponding UI annotations
in GetCAConnectorAnnotations. Guards the DNS DCV path so operators must
explicitly opt in before any DNS plugin interaction occurs.
* feat(enroll): inject IDomainValidatorFactory; add DNS DCV orchestration
Bump IAnyCAPlugin to 3.3.0-PRERELEASE-78770-979f582005 to gain access
to IDomainValidatorFactory, IDomainValidator, and IDomainValidatorConfigProvider.
Add a primary constructor accepting IDomainValidatorFactory (gateway
injects this at startup) alongside the existing parameterless fallback.
Add DomainValidatorConfigProvider inner class.
Add PerformDcvIfNeededAsync: reads pending-DCV domains from TrackOrder,
skips if the order is already issued, validates domain FQDNs, calls
GetDcvAsync per domain, resolves the DNS plugin via
ResolveDomainValidator(domain, 'dns-01'), stages the TXT record, waits
for propagation, triggers VerifyDcv, then cleans up in a finally block.
EnrollNewAsync calls this when DcvEnabled=true and the factory is present,
then re-fetches the post-DCV certificate status before returning.
* test(client): add WireMock unit tests for GetDcvAsync and VerifyDcvAsync
Add GetDcvSuccessJson, GetDcvFailureJson, VerifyDcvSuccessJson, and
VerifyDcvFailureJson helpers to MockCertificateData. Add seven tests
covering: successful token retrieval, meta-failure response, 401
authentication failure, successful verification, meta-failure on verify,
401 on verify, and 500 on verify.
* chore(scripts): add get-dcv/verify-dcv probe scripts and Makefile targets
Add scripts/get-dcv.sh and scripts/verify-dcv.sh mirroring the
track-order.sh pattern. Both scripts source ~/.env_certinext and
certinext-auth.sh, accept ORDER_NUMBER, DOMAIN_NAME, and optional
DCV_METHOD (default 1=DNS TXT), and use jq --arg for safe JSON
construction to prevent injection via user-supplied values.
Add get-dcv and verify-dcv Makefile targets with DCV_METHOD variable
and register both in .PHONY.1 parent 05395cd commit fd6c432
36 files changed
Lines changed: 1857 additions & 5 deletions
File tree
- CERTInext.Tests
- CERTInext
- API
- Client
- scripts
- lib
- v2
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
747 | 887 | | |
748 | 888 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
337 | 373 | | |
338 | 374 | | |
339 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
291 | 372 | | |
292 | 373 | | |
293 | 374 | | |
| |||
0 commit comments