Can set a list of allowed IP
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -67,6 +67,16 @@ where
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
if !AppConfig::get().is_allowed_ip(remote_ip.0) {
|
||||
log::error!("An attempt to access VirtWeb from an unauthorized network has been intercepted! {:?}", remote_ip);
|
||||
return Ok(req
|
||||
.into_response(
|
||||
HttpResponse::MethodNotAllowed()
|
||||
.json("I am sorry, but your IP is not allowed to access this service!"),
|
||||
)
|
||||
.map_into_right_body());
|
||||
}
|
||||
|
||||
let auth_disabled = AppConfig::get().unsecure_disable_auth;
|
||||
|
||||
// Check API authentication
|
||||
|
Reference in New Issue
Block a user