fix(assets): validate parent_qualified_name in DynamoDBAttribute creator#820
Conversation
…_name is provided The DynamoDBAttribute creator skipped parent_qualified_name shape validation when an explicit connection_qualified_name was supplied. This could produce an IndexError for short qualified names or silently build malformed assets for overly long ones. Validate segment count upfront regardless of which branch is taken.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Code ReviewThis PR fixes a validation gap in Confidence Score: 5/5
Important Files Changed
Change FlowA sequence diagram is not needed for this change. The fix adds an upfront guard (
FindingsNo issues found. Checked for bugs, security, and code standards compliance. -- |
Summary
parent_qualified_namehas exactly 4 segments upfront inDynamoDBAttribute.Attributes.create(), regardless of whetherconnection_qualified_nameis providedconnection_qualified_namebypassed theget_connector_name(..., qualified_name_len=4)call, which was the only check onparent_qualified_nameshape. This could produce anIndexErroratfields[3]for short names or silently build malformed assets for overly long onesparent_qualified_namewhenconnection_qualified_nameis explicitly setTest plan
pytest tests/unit/model/dynamo_db_attribute_test.py -x -q)ValueErroris raised for invalidparent_qualified_nameeven whenconnection_qualified_nameis provided