Commit 6a2db50
committed
feat: complete SSL order body, sync DCV retry, and bounded Enroll waits
Closes several gaps uncovered while running live enrollments against the
CERTInext sandbox under concurrent load.
SSL order body (CERTInextClient.BuildOrderRequestFromLegacyEnrollRequest):
- Populate organizationDetails (preVetting="1" + organizationNumber) so orders
declare a pre-vetted org and skip CERTInext's manual vetting queue. Without
this, fresh orders parked in "Pending System RA" for tens of hours on the
sandbox.
- Populate delegationInformation.groupNumber so orders route to the configured
account group.
- Populate technicalPointOfContact (defaults fall back to Requestor*).
- Apply admin-configurable defaults for accountingModel, emailNotifications,
subscriptionDetails.autoRenew/renewCriteria, certificateInformation.autoSecureWww.
Connector configuration (CERTInextConfig + Constants + manifest + README):
- Add OrganizationNumber, TechnicalContactName/Email/IsdCode/MobileNumber,
AccountingModel, EmailNotifications, SubscriptionValidityYears,
SubscriptionAutoRenew, SubscriptionRenewCriteriaDays, AutoSecureWww.
- Each has a PropertyConfigInfo descriptor surfaced in the Keyfactor Command
connector UI, plus a matching entry in integration-manifest.json and the
README "CA Configuration" reference table.
Sync-driven DCV retry (CERTInextCAPlugin.Synchronize + GetSingleRecord):
- Add TryRunDcvDuringSyncAsync wrapper around PerformDcvIfNeededAsync with a
per-order in-flight guard (_dcvInFlight ConcurrentDictionary) and bounded
timeout. Called from Synchronize for every non-terminal order and from
GetSingleRecord for single-record refreshes, so orders whose DCV challenge
is only exposed after Enroll() returns get advanced on the next gateway
sync cycle.
- Also reserve the in-flight slot during the enroll-side DCV path so a
concurrent sync can't double-stage TXT records for the same order.
EMS-956 tolerance (PerformDcvIfNeededAsync):
- CERTInext returns "EMS-956 Invalid Request for this API" from GetDcv when
TrackOrder shows domainVerification populated but the GetDcv endpoint
isn't yet accepting calls. Plugin now treats this narrowly as
"not yet ready" (deferred to next sync) instead of throwing and failing
the enrollment. Matching requires either an exact "EMS-956" code OR the
phrase with no other EMS-NNN code present, so a 4xx whose body happens
to contain the phrase isn't silently swallowed.
Bounded Enroll() waits (DcvWaitForChallengeSeconds, DcvWaitForIssuanceSeconds):
- Inside PerformDcvIfNeededAsync, poll TrackOrder up to DcvWaitForChallengeSeconds
(default 60) waiting for domainVerification to materialize. Without this,
high-concurrency enrollments race CERTInext and skip DCV during Enroll().
- After WaitForDcvVerificationAsync confirms DCV, poll GetCertificate up to
DcvWaitForIssuanceSeconds (default 60) waiting for CERTInext's async issuance
to complete. Without this, Enroll() returns a pending result and the cert
is picked up on the next sync cycle. Both env-overridable via
CERTINEXT_DCV_WAIT_FOR_CHALLENGE_SECONDS and CERTINEXT_DCV_WAIT_FOR_ISSUANCE_SECONDS.
Tests:
- CERTInextClientRequestShapeTests (9): pin the JSON body emitted by the new
builder against connector config combinations (org set/blank, group set/blank,
TPoC explicit/fallback, defaults vs custom).
- CERTInextCAPluginDcvTests (5 new): EMS-956 tolerance (defer with code,
defer with phrase-only, rethrow on unrelated error), challenge-wait polling
(succeeds when slot appears late, gives up after budget), issuance-wait
polling (returns issued, not first pending).
- SmokeTests adds GetSingleRecord_ForAllOrders_AllSucceed which iterates the
account's orders through the plugin's GetSingleRecord path.
- DcvLifecycleTests adds GetSingleRecord_DrivesDcvForPendingOrder and
BulkDvEnrollment_AllOrdersIssue_AndPaginationWorks (opt-in via
CERTINEXT_RUN_BULK_TEST=1) to exercise the deferred-DCV path and verify
the sync iterator crosses the PageSize boundary under volume.
136/136 unit tests pass.1 parent aea1ec0 commit 6a2db50
15 files changed
Lines changed: 1887 additions & 84 deletions
File tree
- CERTInext.IntegrationTests
- CERTInext.Tests
- CERTInext
- API
- Client
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
| 118 | + | |
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
37 | 42 | | |
38 | | - | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
64 | 72 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 73 | + | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
| 77 | + | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
| |||
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
0 commit comments