Fix for deleting per hostname authenticated origin pulls #3680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue with the authenticated origin pulls per hostname where the API docs state that in order to delete an instance the enabled flag must be set to null.
API docs can be found here:
https://developers.cloudflare.com/api/operations/per-hostname-authenticated-origin-pull-enable-or-disable-a-hostname-for-client-authentication
This fix is required to correct an issue with the cloudflare terraform provider which is currently failing to destroy these resources correctly.
This can lead to a hard lock of mtls certificates and origin pulls configured on them as the cloudflare API contains validation bugs on the endpoint documented on the URL above.
Issue raised on the terraform provider:
cloudflare/terraform-provider-cloudflare#4648
PR raised to fix this on the terraform provider:
cloudflare/terraform-provider-cloudflare#4649
Has your change been tested?
Unit tests have been extended to ensure that
nil
is allowed as a value when making thisPUT
request.Types of changes
What sort of change does your code introduce/modify?
Checklist:
and relies on stable APIs.