Refactor IP allowance checks in request processing#406
Conversation
… to improve clarity and logic for endpoint IP access control, including enhanced logging for blocked requests.
| } | ||
|
|
||
| func IsEndpointIpAllowed(instance *instance.RequestProcessorInstance) bool { | ||
| func GetEndpointIpAllowed(instance *instance.RequestProcessorInstance) int { |
There was a problem hiding this comment.
GetEndpointIpAllowed suggests a boolean result but returns an int status. Rename to indicate it returns a status (e.g., GetEndpointIpAllowedStatus) or change it to return a boolean for clarity.
Details
✨ AI Reasoning
A function was added/renamed whose identifier implies a boolean "allowed" check but its actual return type is an int status code. This mismatch can confuse callers and future maintainers about expected semantics; a clear name should indicate that it returns a status value instead of a boolean, or the function should return a boolean. The change affects cross-function usage and alters the contract of endpoint-IP checks.
🔧 How do I fix it?
Use descriptive names for variables (except standard loop counters i, j, k and math variables x, y).
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
Summary by Aikido
🔧 Refactors
More info