Skip to content

Commit dbd3e14

Browse files
committed
add switches to detect read_only APIs
1 parent 7b6afe3 commit dbd3e14

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

aws-proxy/AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ Some services have operations that are functionally read-only (don't modify stat
4040

4141
If you find such operations, add them to the service-specific rules in `aws_proxy/server/aws_request_forwarder.py` in the `_is_read_request` method. This ensures that read-only proxy configurations correctly forward these operations rather than blocking them.
4242

43+
**IMPORTANT**: This step is mandatory when adding a new service. Failure to identify non-standard read-only operations will cause `read_only: true` configurations to incorrectly block legitimate read requests.
44+
4345
Example services with non-standard read-only operations:
4446
- **AppSync**: `EvaluateCode`, `EvaluateMappingTemplate`
4547
- **IAM**: `SimulateCustomPolicy`, `SimulatePrincipalPolicy`
4648
- **Cognito**: `InitiateAuth`
49+
- **DynamoDB**: `Scan`, `BatchGetItem`, `PartiQLSelect`
4750

4851
When adding new integration tests, consider the following:
4952
* Include a mix of positive and negative assertions (i.e., presence and absence of resources).

aws-proxy/aws_proxy/server/aws_request_forwarder.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,18 @@ def _is_read_request(self, context: RequestContext) -> bool:
262262
"EvaluateMappingTemplate",
263263
}:
264264
return True
265+
if context.service.service_name == "logs" and operation_name in {
266+
"FilterLogEvents",
267+
"StartQuery",
268+
"GetQueryResults",
269+
"TestMetricFilter",
270+
}:
271+
return True
272+
if context.service.service_name == "monitoring" and operation_name in {
273+
"BatchGetServiceLevelObjectiveBudgetReport",
274+
"BatchGetServiceLevelIndicatorReport",
275+
}:
276+
return True
265277
# TODO: add more rules
266278
return False
267279

0 commit comments

Comments
 (0)