@@ -635,8 +635,8 @@ class Endpoint {
635635 ) {
636636 $ this ->log (
637637 level: LOG_WARNING ,
638- message: "Denied {$ this ->client ->username }@ {$ this ->client ->ip_address } access to $ this ->url for REST " .
639- " API access list violation. "
638+ message: "Denied {$ this ->client ->username }@ {$ this ->client ->ip_address } access to $ this ->url for REST " .
639+ ' API access list violation. ' ,
640640 );
641641 throw new ForbiddenError (
642642 message: 'The requested action is not allowed by admin policy ' ,
@@ -652,10 +652,7 @@ class Endpoint {
652652 $ client_ip = $ _SERVER ['REMOTE_ADDR ' ];
653653
654654 if (!$ this ->restapi_settings ->enabled ->value and !$ this ->ignore_enabled ) {
655- $ this ->log (
656- level: LOG_WARNING ,
657- message: "Denied $ client_ip access to $ this ->url as REST API is disabled. "
658- );
655+ $ this ->log (level: LOG_WARNING , message: "Denied $ client_ip access to $ this ->url as REST API is disabled. " );
659656 throw new ServiceUnavailableError (
660657 message: 'The REST API is currently not enabled. ' ,
661658 response_id: 'ENDPOINT_REST_API_IS_NOT_ENABLED ' ,
@@ -683,10 +680,7 @@ class Endpoint {
683680 }
684681
685682 # Loop through each allowed interface and check if the server IP is allowed to answer API calls
686- foreach (
687- $ this ->restapi_settings ->allowed_interfaces ->get_related_models ()->model_objects
688- as $ allowed_if
689- ) {
683+ foreach ($ this ->restapi_settings ->allowed_interfaces ->get_related_models ()->model_objects as $ allowed_if ) {
690684 # Allow the server IP if it matches the current interface's IPv4 or IPv6 address
691685 if ($ server_ip === $ allowed_if ->get_current_ipv4 ()) {
692686 return ;
@@ -705,7 +699,7 @@ class Endpoint {
705699 # Throw a forbidden error if this API call was made to a non-API enabled interface
706700 $ this ->log (
707701 level: LOG_WARNING ,
708- message:"Denied $ client_ip access to $ this ->url as interface IP $ server_ip is not allowed to respond. "
702+ message: "Denied $ client_ip access to $ this ->url as interface IP $ server_ip is not allowed to respond. " ,
709703 );
710704 throw new ForbiddenError (
711705 message: 'The requested action is not allowed by admin policy ' ,
0 commit comments