refactor(iam): promote supported_actions to const, extract CreatePolicyInput#356
Merged
vieiralucas merged 3 commits intomainfrom Apr 13, 2026
Merged
Conversation
…cyInput - Promote IamService::supported_actions inline 130-element &[&str] to a file-level SUPPORTED_ACTIONS const; same shape PR #336 used for logs. - Extract CreatePolicyInput::from_query from create_policy. The parse + validate prologue (PolicyName, PolicyDocument, Path, Description, Tags + tag validation, MalformedPolicyDocument check) is now isolated from the state-mutation flow. list_policies (49L) audited in the same pass and judged clean: most of the body is parameter validation calls, with a short filter+render tail. Splitting would just rearrange validate_* calls.
…ions When the supported_actions() function returns a const instead of an inline array, the scanner now: 1. Limits search for &[ to the function body (not the entire file after it) 2. Falls back to extracting the const name from the function body 3. Searches for the const definition and parses it This fixes the test failure introduced when IAM's supported_actions was promoted to a const.
vieiralucas
added a commit
that referenced
this pull request
Apr 13, 2026
…Input The two longest functions in the SSM sub-modules were create_patch_baseline (~150 lines) and create_association_inner (~162 lines). Both were dominated by body parsing, field validation, and field extraction — with the actual state mutation only in the last 30-40 lines. This extracts dedicated *Input structs with from_body() constructors, leaving each function focused on idempotency, ID generation, and struct assembly. Same pattern as PRs #324/#328/#338/#355/#356.
2 tasks
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.
Summary
Audited and judged already-clean
Test plan
Summary by cubic
Promotes IAM supported actions to a file-level
SUPPORTED_ACTIONSconst and extractsCreatePolicyInputto keepcreate_policyfocused. No behavior changes; also fixes the conformance audit scanner to handle const-basedsupported_actions().Refactors
IamService::supported_actions()now returnsSUPPORTED_ACTIONS(same shape used for logs in PR refactor(logs): extract subscription filter delivery and promote action list #336).CreatePolicyInput::from_queryto parse/validate inputs (PolicyName,PolicyDocument,Path,Description,Tags), leavingcreate_policyto mutate state.Bug Fixes
fakecloud-conformanceaudit scanner now supports const-backedsupported_actions()by scanning the function body, resolving the const name, and parsing its definition; fixes the test failure.Written for commit 26a7718. Summary will update on new commits.