fix: enforce relay member capacity limits from plan definitions #43
Reference in New Issue
Block a user
Delete Branch "userAdityaa/caravel:enforce-member"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The three pricing plans define member limits (free = 10, basic = 100, growth = unlimited) in Query::list_plans() and the UI displays them in RelayDetailCard, but neither the API nor any backend handler validated member count against these limits. A user on a free plan could admit an unlimited number of members.
Solution
Per maintainer guidance, added a
GET /relays/:id/membersendpoint that proxies the member list from zooid and reused that same mechanism to enforce limits on plan changes./relays/:id/members Endpoint ExplainedThe
GET /relays/:id/members endpointretrieves the current member list for a relay.How it works
closes #33
@@ -99,0 +102,4 @@}if self.api_secret.trim().is_empty() {anyhow::bail!("missing ZOOID_API_SECRET");}We should validate this in the constructor
@@ -99,0 +106,4 @@let client = reqwest::Client::new();let base = self.api_url.trim_end_matches('/');let url = format!("{base}/relay/{relay_id}/members");Is this endpoint implemented in zooid or does this depend on a PR to add it?
I just wanted you to confirm that this flow is correct, this change depends on the PR being merged into Zooid first.
d1fe9ff61ctoe17c7481be