Description

The secfilter module in kamcmd currently allows duplicate entries when adding values to certain lists (e.g., blacklists, whitelists). This can lead to unexpected behavior and potential inconsistencies. Could you clarify the reason behind accepting duplicate values?

Recently, I submitted a pull request to add delete commands to the secfilter module #4089. When a user, for example, executes:

kamcmd secfilter.del_bl user 1005

I iterate through the entire list to ensure all occurrences of 1005 are removed, as I realized duplicates might exist. This is inefficient and could be avoided by preventing duplicates in the first place.

Proposed Solutions

  1. Prevent Duplicates in Existing add Commands:

  2. Introduce New add_unique Commands:

Recommendation

I recommend implementing the first solution (preventing duplicates in existing add commands) as it provides the most straightforward and efficient approach.

Further Considerations

I would appreciate your feedback and guidance on the best course of action.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/4091@github.com>