You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge #1367: New API feature: allow API clients to authenticate via authentication header
34f2f43 refactor: [#727] use the Authentication header in the API client (Jose Celano)
084beb2 feat: [#727] allow to authenticate API via authentication header (Jose Celano)
Pull request description:
The API allows client authentication via a `token` parameter in the URL query:
```console
curl http://0.0.0.0:1212/api/v1/stats?token=MyAccessToken | jq
```
Now it's also possible to do it via an `Authentication Header`:
```console
curl -H "Authorization: Bearer MyAccessToken" http://0.0.0.0:1212/api/v1/stats | jq
```
This is to avoid leaking the token in logs, etc.
For now, it's only optional and recommendable. It could be mandatory in future major API versions.
The API client uses by default the `Authentication Header`. It could be a breaking change if you use the newer client witn an old API that does not support it. However we have not released any crate for the API client yet. And [we are still using a different client in the Index](torrust/torrust-index#806).
ACKs for top commit:
josecelano:
ACK 34f2f43
Tree-SHA512: 94e83465f0f105200ea4257aa9a8e1f15b810410fd421e30f286cbea4bd47f3917a83088337ca6608f572f828f82f5a90aa18298763821c1c5e0da7e02c7ea6a
0 commit comments