mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-12-03 06:26:43 +00:00
d0706be988
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.