-
-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IsClientAllowed in RedisInformationMiddleware #430
Comments
It's a break change but makes some sense. Do you think it's a chance to change it when we're preparing for .NET 9 release? @imperugo private bool IsClientAllowed(HttpContext context)
{
// Make `AllowFunction` higher priority so that users can use `AllowedIPs` in their own logic.
var allowFunc = options.AllowFunction;
if (allowFunc != null)
return allowFunc.Invoke(context);
var allowIPs = options.AllowedIPs;
// TODO: The IP isn't real in a reverse-proxy environment. Maybe we can improve it and handle more simple scenarios.
if (allowIPs is { Length: > 0 })
return Array.Exists(allowIPs, p => p.Equals(context.Connection.RemoteIpAddress));
return false; // If both are null, return T or F?
} |
@LeaFrock yes is something that we can add to the next major release. |
imperugo
added a commit
that referenced
this issue
Nov 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using app.UseRedisInformation we are required to send an empty array of Allowed IP's even when we just want to use lambda function for IsClientAllowed in RedisInformationMiddleware to access /redis/connectionInfo and /redis/info.
Ideally, we should be able to skip the IP as needed.
Right now the source code is written that if there is no IP list provided it completely ignores the lambda function. Perhaps we can break IsClientAllowed in RedisInformationMiddleware to 3 different scenarios?
1). Both IP and lambda function are provided
2). Only IP list check
3). Only lambda function check
The text was updated successfully, but these errors were encountered: