Skip to content

Commit 4eb9a05

Browse files
whummerclaude
andcommitted
add AppSync read-only operations support and update AGENTS.md
Add EvaluateCode and EvaluateMappingTemplate to the list of read-only operations for AppSync, and document guidelines for identifying non-standard read-only operations in AGENTS.md. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4ae81b8 commit 4eb9a05

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

aws-proxy/AGENTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ To run a single test via `pytest` (say, `test_my_logic` in `test_s3.py`), use th
3232
TEST_PATH=tests/test_s3.py::test_my_logic make test
3333
```
3434

35+
### Read-Only Mode Support
36+
37+
Some services have operations that are functionally read-only (don't modify state) but don't follow the standard naming conventions (`Describe*`, `Get*`, `List*`, `Query*`). When adding tests or support for a new service with `read_only: true` configuration, check the [AWS Service Authorization Reference](https://docs.aws.amazon.com/service-authorization/latest/reference/) for the service and identify any operations that:
38+
- Are classified as "Read" access level but don't match the standard prefixes
39+
- Evaluate or simulate something without modifying state (e.g., `Evaluate*`, `Simulate*`, `Test*`, `Check*`, `Validate*`)
40+
41+
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.
42+
43+
Example services with non-standard read-only operations:
44+
- **AppSync**: `EvaluateCode`, `EvaluateMappingTemplate`
45+
- **IAM**: `SimulateCustomPolicy`, `SimulatePrincipalPolicy`
46+
- **Cognito**: `InitiateAuth`
47+
3548
When adding new integration tests, consider the following:
3649
* Include a mix of positive and negative assertions (i.e., presence and absence of resources).
3750
* Include a mix of different configuration options, e.g., the `read_only: true` flag can be specified in the proxy service configuration YAML, enabling read-only mode (which should be covered by tests as well).

aws-proxy/aws_proxy/server/aws_request_forwarder.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ def _is_read_request(self, context: RequestContext) -> bool:
223223
"PartiQLSelect",
224224
}:
225225
return True
226+
if context.service.service_name == "appsync" and operation_name in {
227+
"EvaluateCode",
228+
"EvaluateMappingTemplate",
229+
}:
230+
return True
226231
# TODO: add more rules
227232
return False
228233

0 commit comments

Comments
 (0)