Repository navigation
feat(elb): tagging, and a producer for elasticloadbalancing:CreateAction (#748) - #775
Merged
Merged
Conversation
…ion (#748) AddTags, RemoveTags and DescribeTags did not exist, and the Tags.member.N on each of the four creates was accepted and silently dropped. All four creates now store what they are given, the three tagging operations reach all four resource types, and every ELB request naming a resource by ARN is authorized against that ARN rather than against the literal string "*". A tagged create is authorized a second time against elasticloadbalancing:AddTags with elasticloadbalancing:CreateAction set to the operation name, which is the last of the seven bundled managed-policy condition keys to gain a producer. Also fixes six pre-existing ELB operations that answered a bare <OperationResponse/> with no result wrapper, making the AWS CLI and boto3 raise KeyError on a call that had succeeded. Found by this PR's live-CLI proof.
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.
Closes #748
AddTags,RemoveTagsandDescribeTagsdid not exist, and theTags.member.Non each of the four ELBv2 creates was accepted and silently dropped — aCreateLoadBalancercarrying tags answered success and produced an untagged load balancer. TheTagsfield was dead on two of the four records and absent from the other two.All four creates now store what they are given, and the three tagging operations reach all four resource types. Limits are the API model's: keys 1–128, values 0–256, 50 tags per resource with
aws:-prefixed keys excluded from the count,DescribeTagscapped at 20 resources andRemoveTagsat 128 keys. Per-operation error sets are followed rather than unified —DuplicateTagKeysonAddTagsandCreateLoadBalanceronly, since those are the two operations that publish it.Authorization
Every ELB request naming a resource by ARN is now decided against that ARN. Previously every ELB request was decided against the literal string
*, which is not a wildcard on the request side — so an ARN-scopedAllowdenied every call and an ARN-scopedDenywas inert. A request naming several resources is denied unless every one is allowed. Tags are reported underelasticloadbalancing:ResourceTag/<key>as well asaws:ResourceTag/<key>.A tagged create is authorized twice, against
elasticloadbalancing:AddTagswithelasticloadbalancing:CreateActionset to the bare operation name. That is the last of the seven bundled managed-policy condition keys to gain a producer; the census indocs/services.mddrops to four.Provenance correction
The plan claimed
elasticloadbalancing:CreateAction's only citable source was AWS's own managed policy shipping inside substrate. That is wrong: the ELB user guide's "Tag your Elastic Load Balancing resources during creation" page documents the key, the secondAddTagsauthorization, and the bare operation name as its value. It is absent from the guide's own condition-key list, and both Service Authorization Reference pages for ELB render their tables in JavaScript and were unreachable — which is how it came to look otherwise. Docs, CHANGELOG and release notes cite the user guide.A second bug, found by the live proof
Six pre-existing operations —
DeleteLoadBalancer,DeleteTargetGroup,DeleteListener,DeleteRule,RegisterTargets,DeregisterTargets— answered a bare<OperationResponse/>with no result wrapper. ELBv2 is a Query-protocol service whose output shapes all declare aresultWrapper, so the AWS CLI raisedKeyError: 'DeleteLoadBalancerResult'for a call that had already succeeded. Substrate's ELB tests read the response XML directly rather than through an SDK parser, so all six were green. Fixed in one shared place with a test that asserts the wire bytes.Verification
gofmt/go build/go vet/golangci-lint: 0 issuesmake testpasses; coverage emulator 83.5%, total 82.9% (baseline 83.4% / 82.9%)make docs-reference-check,docs-versions,npm --prefix docs run build, anchor diff: cleango vet/go testundertest/e2e: passmainbuild: all three tagging operations answeredInvalidActionand a tagged create dropped its tags; after, the round trip, the multi-resource describe,DuplicateTagKeysandLoadBalancerNotFoundall answer correctly, and the six empty-output operations no longer crash the CLI.Deliberate gaps, named in the docs
Names.member.NonDescribeLoadBalancers/DescribeTargetGroupsis not resolved to an ARN — whether ELB describes support resource-level permissions is on the unreachable pages, and leaving them at*cannot invent a grant.aws:is accepted: the restriction is documented, no code for refusing one is.