-
Notifications
You must be signed in to change notification settings - Fork 933
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auth: Add storage volume and bucket location to URL in access check (#…
…13517) This PR fixes fine grained authorization for storage volumes and storage buckets in clustered LXD. When listing volumes, we can use the `Location` field of the storage volume or bucket to perform an access check. When performing an action on a single storage volume, we need to perform the following checks: 1. Is the pool containing the volume remote? If so, the `target` query parameter may have been used to target a particular cluster member, but should not be used in the URL for the volume (volumes in remote pools do not have a location). 2. Is the volume located on another cluster member? If so, and the target parameter is set, use the target parameter as the location. If so, and the target parameter is unset, use the cluster member name as the location. If not, use the server name as the location. To prevent extra queries from being performed when a request is forwarded to another node. Each node will assume that forwarded requests have already reached their intended destination. This is done by checking for `request.CtxForwardedProtocol` in the request context (I tried this originally by setting the `target` parameter but this broke storage volume migrations). Closes #13365
- Loading branch information
Showing
7 changed files
with
589 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.