plugins: style sweep

This commit is contained in:
Franco Fichtner
2024-04-16 16:54:23 +02:00
parent 7e6bc0ae49
commit cca59e7e4a
10 changed files with 29 additions and 26 deletions
@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2024 Deciso B.V.
* Copyright (C) 2024 Mike Shuey
@@ -39,31 +40,31 @@ class StaticController extends ApiMutableModelControllerBase
public function searchRouteAction()
{
return $this->searchBase('routes.route');
return $this->searchBase('routes.route');
}
public function getRouteAction($uuid = null)
{
return $this->getBase('route', 'routes.route', $uuid);
return $this->getBase('route', 'routes.route', $uuid);
}
public function setRouteAction($uuid)
{
return $this->setBase('route', 'routes.route', $uuid);
return $this->setBase('route', 'routes.route', $uuid);
}
public function addRouteAction()
{
return $this->addBase('route', 'routes.route');
return $this->addBase('route', 'routes.route');
}
public function delRouteAction($uuid)
{
return $this->delBase('routes.route', $uuid);
return $this->delBase('routes.route', $uuid);
}
public function toggleRouteAction($uuid)
{
return $this->toggleBase('routes.route', $uuid);
return $this->toggleBase('routes.route', $uuid);
}
}
@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2024 Deciso B.V.
* Copyright (C) 2024 Mike Shuey
@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2024 Deciso B.V.
* Copyright (C) 2024 Mike Shuey
@@ -27,6 +28,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*
*/
namespace OPNsense\Quagga;
use OPNsense\Base\Messages\Message;
@@ -129,21 +129,21 @@ class Relayd extends BaseModel
case 'send':
if (empty((string)$node->expect)) {
$messages->appendMessage(
new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect")
new Message(gettext('Expect Pattern cannot be empty.'), $key . ".expect")
);
}
break;
case 'script':
if (empty((string)$node->path)) {
$messages->appendMessage(
new Message(gettext('Script path cannot be empty.'), $key . ".path")
new Message(gettext('Script path cannot be empty.'), $key . ".path")
);
}
break;
case 'http':
if (empty((string)$node->path)) {
$messages->appendMessage(
new Message(gettext('Path cannot be empty.'), $key . ".path")
new Message(gettext('Path cannot be empty.'), $key . ".path")
);
}
if (empty((string)$node->code) && empty((string)$node->digest)) {
-1
View File
@@ -7,4 +7,3 @@ OPNsense proxy additions to support more fine grained access management
1.0.4:
* Remove ident support as by default it is denied anyway nowadays
+1 -1
View File
@@ -34,7 +34,7 @@ Plugin Changelog
* Add: HTTP response code and HTTP response message can be set per access list in advanced mode.
* Add: Header functionality added. Multiple header manipulations can be set per handler.
* Cleanup: Update searchBase() in ReverseProxyController.php for easier maintainability.
* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS.
* Fix: Move selectpicker empty option to model in general.volt, using BlankDesc. This fixes the option IPv4+IPv6 not appearing in Dynamic DNS.
* Add: Simple Load Balancing support with the default random policy, by allowing to add multiple Upstream Domains in Handlers.
* Add: Passive Health check for load balancing (Upstream Fail Duration) in Handlers.
* Fix: Input validation so a base domain like "example.com" and a wildcard domain like "*.example.com" can now be created at the same time in domains.
@@ -41,7 +41,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/*ReverseProxy Section*/
public function searchReverseProxyAction($add_empty='0')
public function searchReverseProxyAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.reverse", null, 'description');
}
@@ -74,7 +74,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/*Subdomain Section*/
public function searchSubdomainAction($add_empty='0')
public function searchSubdomainAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.subdomain", null, 'description');
}
@@ -107,7 +107,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/*Handler Section*/
public function searchHandleAction($add_empty='0')
public function searchHandleAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.handle", null, 'description');
}
@@ -140,7 +140,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/* AccessList Section */
public function searchAccessListAction($add_empty='0')
public function searchAccessListAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.accesslist", null, 'description');
}
@@ -168,7 +168,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/* BasicAuth Section */
public function searchBasicAuthAction($add_empty='0')
public function searchBasicAuthAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.basicauth", null, 'description');
}
@@ -216,7 +216,7 @@ class ReverseProxyController extends ApiMutableModelControllerBase
/* Header Section */
public function searchHeaderAction($add_empty='0')
public function searchHeaderAction($add_empty = '0')
{
return $this->searchBase("reverseproxy.header", null, 'description');
}
@@ -46,7 +46,7 @@ class ServiceController extends ApiMutableServiceControllerBase
// Caddy can use a reload action instead
return 0;
}
public function validateAction()
{
$backend = new Backend();
@@ -60,7 +60,7 @@
<source>OPNsense.Caddy.Caddy</source>
<items>reverseproxy.accesslist</items>
<display>accesslistName,description</display>
<display_format>%s - %s</display_format>
<display_format>%s - %s</display_format>
</reverseproxy>
</Model>
</accesslist>
@@ -124,7 +124,7 @@
<source>OPNsense.Caddy.Caddy</source>
<items>reverseproxy.accesslist</items>
<display>accesslistName,description</display>
<display_format>%s - %s</display_format>
<display_format>%s - %s</display_format>
</reverseproxy>
</Model>
</accesslist>
@@ -85,7 +85,7 @@
{#
# Section: Dynamic DNS Global Configuration
# Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with
# Purpose: Sets up global configuration for Dynamic DNS. Caddy needs to be compiled with
# https://github.com/mholt/caddy-dynamicdns and https://github.com/caddy-dns. Otherwise the
# generated Caddyfile won't run. Each DNS Provider that is added below has to be compiled in.
# Some Providers don't support setting A and AAAA-Records, like acmedns.
@@ -284,7 +284,7 @@
{#
# Section: HTTP-01 Challenge Redirection
# Purpose: A small premade reverse_proxy section
# Purpose: A small premade reverse_proxy section
# that can redirect the HTTP-01 challenge to a different webserver.
#}
{% for reverse in helpers.toList('Pischem.caddy.reverseproxy.reverse') %}
@@ -442,7 +442,7 @@
{#
# Macro: header_manipulation
# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers.
# Purpose: Customizes HTTP headers for requests or responses; to add, remove, or modify headers.
# It uses a 'handle' object that specifies which headers to manipulate based on their @UUIDs.
# Each handle can have multiple of these HTTP headers assigned.
# Parameters:
@@ -574,7 +574,7 @@
# Macro: basicauth_configuration
# Purpose: Implements basic authentication with a username and password for access.
# Parameters:
# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to
# @param basicauth_uuids (@string): A comma-separated list of UUIDs, each UUID corresponding to
# a specific user credentials (username and password).
# - @uuid (@string)
# - basicauthuser (@string): The username required for authentication.
@@ -595,7 +595,7 @@
{#
# Section: Reverse Proxy Configurations
# Purpose: Assembles reverse proxy configurations using predefined macros.
# Purpose: Assembles reverse proxy configurations using predefined macros.
# This is the main logic of the whole template, handle with care.
# Macros Used:
# - tls_configuration
@@ -603,7 +603,7 @@
# - access_list_configuration
# - reverse_proxy_configuration
# - indirect: header_manipulation
# Important Details:
# Important Details:
# - Order of Path specific Handles - Prioritizes order of specific path handles over catch-all handles.
# - Order of Wildcard Domains and Subdomains: Handles for wildcard domains come after all subdomains.
#}