Files
garage/src/api
Antoine Popineau d0706be988 Refactor how anonymous access is checked and add granular method grants.
Anonymous access can now be configured by allowing specific S3 methods.
Currently, this only includes `s3:HeadObject` and `s3:GetObject`. Umbrella
grants can also be used that translate to lists of methods (`garage:ReadObject` ->
[`s3:HeadObject`, `s3:GetObject`].

The CLI takes either a list of `--allow`ed methods, or a `--revoke-all`.

`ReqCtx` is now represented by an enum of either an authenticated requests
or an anonymous one. Handlers will take either one of those depending on whether
they allow anonymous access or not. `ReqCtxEnum` implements `TryInto` to transform
into the requested type (where building an anonymous context always works, but
building an authenticated one only works if the request contained valid
credentials).

When building an anonymous context, the bucket anonymous configuration will
be checked against the requested endpoint to check if all required methods are
allowed anonymously.
2026-11-25 09:50:48 +01:00
..