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
{{ message }}
Repository navigation
Add safety limit to Cloudflare list_keys pagination #202
The Cloudflare CloudflareKvStore::list_keys implementation paginates through all keys in a KV namespace and accumulates them into a single Vec<String>. On namespaces with a large number of keys, this unbounded accumulation could cause an out-of-memory condition.
What needs to be done
Add a safety limit to list_keys pagination in crates/edgezero-adapter-cloudflare/src/key_value_store.rs:
Cap the total number of keys returned (e.g., 10,000) or the total accumulated size
Return a clear error when the limit is hit, rather than silently truncating
Consider whether list_keys should accept an optional limit parameter at the KvStore trait level
Done when
CloudflareKvStore::list_keys has a configurable or hardcoded safety limit
Exceeding the limit returns a meaningful KvError
Behavior is documented
Affected area
Adapter -- Cloudflare
Context
Identified during PR #165 (KV store feature) review. The current implementation works correctly for small namespaces but poses an OOM risk in production with large key sets.
Activity