Repository navigation
fix(#1245, #1244, #1477, #1489, #1474, #507): ELB paging, IAM single-object Statement, S3 multipart actions, Object Ownership enforcement, email grantees - #1530
Merged
Conversation
… actions, copy source needs s3:GetObject
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or 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
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.
Fixes #1245
Fixes #1244
Fixes #1477
Fixes #1489
Fixes #1474
Fixes #507
ELB paging (elb: an unissued Marker is refused by classic DescribeLoadBalancers and answered with page one by DescribeAccountLimits #1245, elb: the four ELBv2 describes publish Marker/PageSize and read neither, so a paging loop runs once #1244). All six paginated ELB operations use one cursor rule,
elbPageCursorinelb_page_size.go.PageSizegoes throughelbPageSize.Markergoes throughdecodeOffsetPaginationToken, the base64 offset classicDescribeLoadBalancersalready issued. A marker substrate could not have issued isValidationError/400 at every operation.DescribeAccountLimitsused to restart at page one. An offset past the end is still an empty last page. ELBv2DescribeLoadBalancers,DescribeTargetGroups,DescribeListenersandDescribeRulesnow page over key order and emitNextMarkeronly when a further page exists. Named ARNs and names are resolved before paging.TestELB_DescribeAccountLimits_MarkerEdgesmoved toelb_page_cursor_test.go, which asserts that all six operations give the same code and status for each unusable cursor. It also walks each describe one page at a time. ThePageSizecomparison table now covers all six.IAM single-object
Statement(iam: a policy whose Statement is a single object is refused as MalformedPolicyDocument #1477).PolicyDocument.Statementis nowPolicyStatements, which unmarshals either an array or a single object, per the IAM grammar's brackets-optional convention. Every policy writer accepts it. Reads still serve the submitted text (iam: CreateRole flattens a {"AWS": arn} trust principal to a string, and GetRole returns the trust un-encoded #1452). Evaluation, the STS trust gate andpolicyDocumentsEqualsee a one-element list.S3 multipart and copy authz (s3 authz: multipart-upload operations authorize under non-existent IAM actions instead of s3:PutObject #1489).
CreateMultipartUpload,UploadPart,UploadPartCopyandCompleteMultipartUploadauthorize ass3:PutObject, per the User Guide's multipart permissions table.ListPartsauthorizes ass3:ListMultipartUploadParts.CopyObjectauthorizes ass3:PutObject, per API_CopyObject. This was the same defect as the multipart operations.checkS3CopySourcepass requiress3:GetObjecton thex-amz-copy-sourceobject forCopyObjectandUploadPartCopy. It follows thecheckS3CreateSideEffectspattern.S3 Object Ownership (s3: enforce Object Ownership (BucketOwnerEnforced disables ACLs) #1474) and email grantees (S3: an emailAddress grantee is skipped rather than refused with HTTP 405 #507). The rules and their citations are in
s3_acl_enforcement.go.BucketOwnerEnforced(the default),PutBucketAcl,PutObjectAcland the ACL headers onPutObject,CopyObjectandCreateMultipartUploadare refused withAccessControlListNotSupported/400. This check runs before the email and Block Public Access checks. Only the forms the guide accepts get through:bucket-owner-full-control, orFULL_CONTROLto the owner alone through grant headers or XML.CreateBucketandPutBucketOwnershipControls: both answerInvalidBucketAclWithObjectOwnership/400, per the troubleshooting page.CreateBucketdoes so for a granting ACL under enforced ownership.PutBucketOwnershipControlsdoes so when it sets enforced ownership on a bucket whose ACL grants others.emailAddress=or an XMLAmazonCustomerByEmailgrantee is refused on all six operations. The answer isMethodNotAllowed/405 in the eight Regions the notice names, andInvalidArgument/400 elsewhere (substrate's reading, s3: capture the answer to an email-address grantee outside the eight end-of-support Regions #1527). The messages are substrate's own.x-amz-object-ownership: ObjectWriter(s3ACLsEnabled), as does the e2e ACL journey.Deviation from the brief:
CreateBucketwith a granting ACL answersInvalidBucketAclWithObjectOwnership, notAccessControlListNotSupported. The Object Ownership troubleshooting page names that code for exactly this request, and s3: enforce Object Ownership (BucketOwnerEnforced disables ACLs) #1474's acceptance criteria ask for it.Catalog: the routed-operation catalog is unchanged at 1,098; no operation was added.
Gates run locally:
make lint test e2e operation-catalog-check docs-reference-check docs-headings-check operation-docs-check authz-reference-check wire-bookkeeping-check discarded-unmarshal-check discarded-marshal-check discarded-state-check docs-versions, andnpm ci && vitepress buildindocs/. Onemake testrun hit an unrelated flake, filed as test: TestAutoScaling_WeightsAreStoredCanonically fails when a generated ID contains 007 #1529; it passed on re-run.Follow-ups: s3: capture the answer to an email-address grantee outside the eight end-of-support Regions #1527 (capture the email-grantee answer, v0.129.0), elb: the six paginated describes page by offset, so a listing that changes mid-walk skips or repeats records #1528 (value-based ELB cursor, v0.130.0), test: TestAutoScaling_WeightsAreStoredCanonically fails when a generated ID contains 007 #1529 (Auto Scaling test flake, v0.129.0).
Review follow-up (2fae5da):
x-amz-copy-sourceparser (s3_copy_source.go) for authz,CopyObjectandUploadPartCopy. It splits at the first unencoded?. A versioned copy reads the named version, a delete-marker version isInvalidRequest/400, and an access-point ARN isNotImplemented/501 everywhere.decodePolicyStatementList).s3ACLWriteRefusaltakes the caller's bucket record.s3ResourceARN).emailAddress=is skipped, like an emptyid=.