You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,3 +110,76 @@ Environment variables control implementation selection:
110
110
- Unit tests use mock implementations
111
111
- Integration tests can switch between real and mock implementations
112
112
- Test files follow `*_test.go` pattern alongside implementation files
113
+
114
+
## CEL Filter Feature
115
+
116
+
The service supports Common Expression Language (CEL) filtering for post-query resource filtering.
117
+
118
+
### Overview
119
+
120
+
CEL filtering allows API consumers to filter resources on arbitrary data fields using a safe, non-Turing complete expression language. The filter is applied after the OpenSearch query but before access control checks.
- List membership: `data.category in ["security", "networking"]`
174
+
- Field existence: `has(data.archived)`
175
+
176
+
### Performance Considerations
177
+
178
+
- Compiled CEL programs are cached (100 max entries, 5-minute TTL)
179
+
- Each resource evaluation has 100ms timeout
180
+
- Post-query filtering means pagination may return fewer results than page size
181
+
- For best performance, use specific OpenSearch criteria first, then CEL for refinement
182
+
183
+
### Important Limitations
184
+
185
+
**Pagination**: CEL filters apply only to results from each OpenSearch page. If the target resource is not in the first page of OpenSearch results, it won't be found even if it matches the CEL filter. Always use specific primary search criteria (`type`, `name`, `parent`) to narrow OpenSearch results first.
The `cel_filter` query parameter enables advanced filtering of search results using Common Expression Language (CEL). CEL is a non-Turing complete expression language designed for safe, fast evaluation of expressions in performance-critical applications.
247
+
248
+
**Why CEL Filter?**
249
+
250
+
CEL filtering was added to provide flexible, dynamic filtering capabilities on arbitrary resource data fields without modifying the OpenSearch query structure. This allows API consumers to:
⚠️ **Pagination Consideration**: CEL filters are applied to the results from each OpenSearch page. If you're looking for a specific resource that matches your CEL filter but it's not in the first page of OpenSearch results, it may not be found. For best results when using CEL filters, use more specific primary search parameters (`type`, `name`, `parent`, `tags`) to narrow down the OpenSearch results first.
346
+
347
+
**Error Handling**
348
+
349
+
Invalid CEL expressions return a 400 Bad Request with details:
0 commit comments