This repository was archived by the owner on Mar 23, 2026. It is now read-only.
IAM: refactor simulation into simulator class#13326
Merged
Conversation
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 52s ⏱️ - 2h 2m 28s Results for commit 7113bd8. ± Comparison against base commit f829e69. This pull request removes 4696 tests.♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files ± 0 5 suites ±0 9m 49s ⏱️ - 2h 30m 22s Results for commit 7113bd8. ± Comparison against base commit f829e69. This pull request removes 5046 tests.♻️ This comment has been updated with latest results. |
dfangl
approved these changes
Nov 3, 2025
Member
dfangl
left a comment
There was a problem hiding this comment.
Looks really nice, thanks for refactoring it this way!
localstack-core/localstack/services/iam/resources/policy_simulator.py
Outdated
Show resolved
Hide resolved
localstack-core/localstack/services/iam/resources/policy_simulator.py
Outdated
Show resolved
Hide resolved
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Motivation
This PR refactors the policy simulation logic by introducing an abstract IAMPolicySimulator class and a concrete BasicIAMPolicySimulator implementation, enabling a modular and extensible design. The change allows for easy replacement of simulation behavior and is required for some recent enhancements in the Pro version of LocalStack.
Changes
IAM.simulate_principal_policyoperationTests
Not required since it's a refactoring.