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
Auto merge of #3470 - jakeswenson:restrict-api-token-access-on-GET-requests, r=pietroalbini
Add API Token Auth restrictions on GET APIs
This PR adds explicit denial of API token authentication on most GET APIs.
Currently, CloudFront was never passing along the `Authorization` header for `GET` requests.
(See rust-lang/simpleinfra#43 for more details.)
In addressing that issue it was pointed out that there may be GET APIs that the team might not want to commit to allowing API tokens access to.
This PR attempts to limit the exposed APIs to:
- `/api/v1/crates?following=1` (the crates "search" API, which is the only way to get the list of crates a user is following.)
- `/api/v1/me`
> Note: There were already [tests verifying token access to this API][me-tests], but with the CloudFront issue this API was not actually accessible.
[me-tests]: https://github.com/rust-lang/crates.io/blob/03f7b273eb7a024de8282ac2297daaa47df33fa6/src/tests/token.rs#L270
0 commit comments