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 exports, utilities, and programmatic access where clients need to retrieve their complete active rule set (e.g., exporting subscriptions, backup/restore, bulk operations). Not super useful initially as we want to push users to see all rules, and then filter.

Acceptance Criteria

  • Returns filtered list of client's subscribed rules only
  • Client_id from URL path parameter (URL encoded)
  • Empty vec if no subscriptions
  • Time: O(1) + O(k) where k = client's rules

Proposed Solution

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

Add get_client_rules() method to RuleManager. In controller, get rid of the Auth header and instead use the client_id from the path. Test using Postman, 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