Skip to content

Commit 84aeb20

Browse files
committed
fix: Remove all IP address examples to resolve SonarCloud security hotspots
- Remove all IP address examples from sourceIp fields and headers - Keep comprehensive field descriptions for developer guidance - Maintain functionality while ensuring complete security compliance - Final resolution of all SonarCloud security hotspots
1 parent 2b04ec0 commit 84aeb20

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • aws_lambda_powertools/utilities/parser/models

aws_lambda_powertools/utilities/parser/models/appsync.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class AppSyncIamIdentity(BaseModel):
1919
description=(
2020
"The source IP address of the caller that AWS AppSync receives. "
2121
"If the request includes a x-forwarded-for header, this is a list of IP addresses."
22-
),
23-
examples=[["127.0.0.1"], ["10.0.0.1", "10.0.0.2"]],
22+
)
2423
)
2524
username: str = Field(
2625
description="The IAM user principal name.", examples=["AIDAAAAAAAAAAAAAAAAAA", "appsync-user"]
@@ -71,8 +70,7 @@ class AppSyncCognitoIdentity(BaseModel):
7170
description=(
7271
"The source IP address of the caller that AWS AppSync receives. "
7372
"If the request includes a x-forwarded-for header, this is a list of IP addresses."
74-
),
75-
examples=[["127.0.0.1"], ["10.0.0.1"]],
73+
)
7674
)
7775
defaultAuthStrategy: str = Field(
7876
description="The default authorization strategy for this caller (ALLOW or DENY).", examples=["ALLOW", "DENY"]
@@ -132,7 +130,6 @@ class AppSyncRequestModel(BaseModel):
132130
description="HTTP headers from the GraphQL request, including custom headers.",
133131
examples=[
134132
{
135-
"x-forwarded-for": "10.0.0.1, 10.0.0.2",
136133
"cloudfront-viewer-country": "US",
137134
"host": "example.appsync-api.us-east-1.amazonaws.com",
138135
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)",

0 commit comments

Comments
 (0)