fix(sslcertificatechain): POST to trigger auto-linking when chain is incomplete - #621
fix(sslcertificatechain): POST to trigger auto-linking when chain is incomplete#621rybrose wants to merge 1 commit into
Conversation
|
Reopening this PR. To clarify the approach taken here: this fix follows the same established pattern used for other resource-specific quirks in
All of these use inline The This fix checks |
48be62b to
15d012e
Compare
…incomplete The sslcertificatechain module previously did a GET, found the resource exists (since NITRO always returns chain status for any existing certkey), and returned 'no change required' without issuing the POST that triggers auto-linking. This fix checks the chaincomplete field from the GET response. When the chain is incomplete (chaincomplete=0), the module now POSTs to trigger NITRO's auto-linking, which links certificates by content (AKI/SKI matching) regardless of certkey naming. Includes: - Proper diff output showing chainlinked/chainpossiblelinks transitions - Idempotent: returns ok when chain is already complete (chaincomplete=1) - check_mode support via existing client.send() transport layer - Integration test covering check, link, and idempotent scenarios
15d012e to
122e2d5
Compare
Summary
The
sslcertificatechainmodule never issues the POST that triggers auto-linking. It does a GET, sees the resource exists (NITRO always returns chain status for any existing certkey), compares only thecertkeynamefield, and returns "no change required".Root Cause
The
create_or_update()flow inmodule_executor.py:/nitro/v1/config/sslcertificatechain/<certkeyname>- always returns 200 with chain statusis_resource_identical()- only comparescertkeyname(the sole readwrite argument)Fix
When
chaincomplete == "0"in the GET response, force a POST to/nitro/v1/config/sslcertificatechainto trigger auto-linking. This links certificates by content (AKI/SKI matching) regardless of certkey naming.Includes:
chainlinked,chainpossiblelinks, andchaincompletetransitionsokwhen chain is already complete (chaincomplete=1)check_modesupport via existingclient.send()transport layer (skips non-GET in check mode)--check, link, and idempotent scenariosTesting
Tested against NetScaler NS14.1 Build 66.54.nc with:
--check --diff: reports changed with diff, no actual POST madeExample output