Added API key authentication alternative.#12
Conversation
|
Added "Copy config" ClipbardButton. |
d11e7b4 to
8623949
Compare
|
Added 'permission_callback's to avoid 'doing_wrong' notice: |
|
There is a lot of good work here @gassan, thank you. Ideally I would like to keep the auth simple, so I think perhaps I would like to make a breaking change to the plugin which changes the authentication to avoid standard auth methods (like bearer tokens) and uses a fixed header like I need a little time to consider this change and work out the best route. |
|
Just to be clear, this method is not a replacement for the old one with the bearer token — it’s an addition. Everything old will continue to work as before. |
For those who have
wpackagist-plugin/jwt-authentication-for-wp-rest-apiinstalled, Bearer token authentication is problematic, because the plugin intercepts the token and tries to authenticate the user automatically.To make it work, you need to:
Authentication via a specific header simplifies things a lot.
In this same commit, I pass the settings into a
<script>before the settings page<div>. This saves a request. If, for some reason, the data is missing, an AJAX request will be sent (old method).Added a dynamic Prometheus job-config example to the bottom of the settings page.