zachomedia / cert-manager-webhook-pdns

A PowerDNS webhook for cert-manager
MIT License
57 stars 33 forks source link

Missing content-type on POST/PUT/PATCH Request #21

Closed iceman91176 closed 2 years ago

iceman91176 commented 2 years ago

Hi,

we just discovered that the pdns-webhook is not working with the powerdns-admin API (https://github.com/PowerDNS-Admin/PowerDNS-Admin/blob/v0.3.0/docs/API.md)

The API is identical (they just proxy the requests) - but they require a Content-type of "application/json" for all write operations.

Using the PowerDNS-Admin API gives the ability to control access to the API, since different API-Keys with fine-grained-access-control can be created (and revoked)

It should be possible to add the required header here - there is no need to differentiate between request-types

https://github.com/zachomedia/cert-manager-webhook-pdns/blob/6b8fca014e3e117b5c00d3520829651d06b16914/main.go#L287

Thank you

zachomedia commented 2 years ago

Thanks for the report @iceman91176, I can definitely add the header! I'll be working on it shortly.

zachomedia commented 2 years ago

@iceman91176 This should be fixed now in version v2.2.0 (chart v2.1.3)!