Skip to content

Endpoint to get client's subscribed rules #501

@bracyw

Description

@bracyw

Description

Return only the rules the client is currently subscribed to (uses BiMultiMap for O(1) client lookup). Used for "My Rules" view where clients want to see only their active subscriptions without the noise of all system rules, or for quick rule management focused on the user's current subscriptions and notifications they'll receive.

Acceptance Criteria

  • Returns filtered list of client's subscribed rules only
  • Empty vec if client has no subscriptions
  • Time: O(1) to get rule_ids + O(k) to fetch rules, where k = client's subscribed rules

Proposed Solution

GET /rules/subscribed/{client_id}
Response: Vec<Rule>

Add get_client_rules() method to RuleManager in rule_structs.rs, add endpoint to rule_controller.rs. Reference get_all_clients() for BiMap access pattern: subscriptions.read().await.get_right(&client_id) to get rule_ids, then fetch from rules. Test using Postman for basic functionality, then add tests to rule_structs_test.rs.

Mocks

No response

Metadata

Metadata

Assignees

Labels

mediumA more complex taskscylla-serverDevelopment Focused in the Backend

Type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions