mirror of
https://github.com/awslabs/iam-policy-autopilot.git
synced 2026-04-25 16:05:58 +03:00
[PR #128] feat: variable type tracking for boto3 clients and resources #254
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/iam-policy-autopilot#254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/128
Author: @adpaco-aws
Created: 1/29/2026
Status: 🔄 Open
Base:
main← Head:variable-type-tracking📝 Commits (4)
d8cbee0feat: variable type tracking for boto3 clients and resourcesdac2753fix: fix clippy and dylint errorsa8472b2Merge branch 'main' into variable-type-tracking6888140fix: fix fmt📊 Changes
5 files changed (+1792 additions, -6 deletions)
View changed files
📝
iam-policy-autopilot-policy-generation/src/extraction/python/disambiguation.rs(+17 -2)📝
iam-policy-autopilot-policy-generation/src/extraction/python/extractor.rs(+102 -4)📝
iam-policy-autopilot-policy-generation/src/extraction/python/mod.rs(+1 -0)📝
iam-policy-autopilot-policy-generation/src/extraction/python/node_kinds.rs(+3 -0)➕
iam-policy-autopilot-policy-generation/src/extraction/python/variable_type_tracker.rs(+1669 -0)📄 Description
Description of changes:
Summary
Adds variable type tracking to improve SDK method call extraction precision when boto3 clients and resources are passed across function boundaries. This PR also includes a fix to ensure variable tracking results are properly respected during disambiguation.
What's Tracked
s3_client = boto3.client('s3'),dynamodb = boto3.resource('dynamodb')my_client = s3_clienttable = dynamodb.Table('users'),bucket = s3.Bucket('name')Key Features
Example 1: Direct Client Assignment
Before this PR:
→ Generates 3 policy statements
After this PR:
→ Generates 1 policy statement
Example 2: Function Parameter Tracking
Before:
["acm","iot","transfer"]After:
["acm"]Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.