Repository navigation
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #101. Pins libforge to its merge of fil-forge/libforge#86.
#101 refuses a query naming two subresources (
ConflictingQuery) or an unsupported one, and classifies DeleteObjects. It classifies the remaining supported subresources as the plain bucket or object operation. Those include writes:PUT /b?versioningand?object-lockrun on a CreateBucket authorization, which skips the bucket scope check, so a key holdings3:CreateBucketcan change any bucket's versioning or object lock. This PR gives each of them its own operation and permission.What changes
Each supported subresource now selects its operation per method, as the gateway's router does (
bucketRoutes,objectRoutes, alongside #101'ssubresourcesvocabulary):s3:GetBucketLocation/s3:GetBucketAcl/s3:GetBucketCORSs3:GetBucketPolicyStatuss3:GetBucketTagging/s3:PutBucketTagging(both writes)s3:GetBucketVersioning/s3:PutBucketVersionings3:GetBucketObjectLockConfiguration/s3:PutBucketObjectLockConfigurations3:GetObjectTagging/s3:PutObjectTagging/s3:DeleteObjectTaggings3:GetObjectAttributesThe bucket configuration writes and the policy status are service-key only, like the policy and encryption. The other new permissions are policy actions (fil-forge/libforge#86, merged). Object tagging writes are catalog writes; the bucket configuration lives in Ingot's registry and needs no Forge commands.
Routing follows the router per method:
UnsupportedOperation:PUT/DELETE ?cors,PUT ?acl, object ACLs,?uploads/?versionson an object, anduploadIdon a PUT without apartNumber.PUT /b?uploadscreates the bucket). A HEAD is HeadBucket or HeadObject whatever its subresource.Behaviour changes to know about
s3:*) need the new reads added for principals to keep reading bucket configuration, tags and attributes.POST /b/k?partNumber&uploadIdis now CompleteMultipartUpload, as the router routes it (same permission as the PutObject it was before).Tests
go test ./...andgo vet -tags itest ./itestpass.TestClassifyRequestcovers each new operation, the router's fall-through cases, and the refused routes.TestRoutesAddressExistingBucketschecks that every routed operation is scope-checked against its bucket and routes only on a supported subresource. I haven't run the IAM itest scenarios against the change. fil-forge/ingot#287 pins this branch and runs its route-permission scenario against it.🤖 Generated with Claude Code