From e79cc6984a19639266ccec833479a076f2087853 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 3 Feb 2019 14:39:26 +0100 Subject: [PATCH 1/3] security/acme-client: migrate to mutable controller, closes #1163 --- .../AcmeClient/Api/AccountsController.php | 169 ++---------------- .../AcmeClient/Api/ActionsController.php | 169 ++---------------- .../AcmeClient/Api/CertificatesController.php | 169 ++---------------- .../AcmeClient/Api/ValidationsController.php | 169 ++---------------- .../views/OPNsense/AcmeClient/accounts.volt | 2 +- .../views/OPNsense/AcmeClient/actions.volt | 2 +- .../OPNsense/AcmeClient/certificates.volt | 2 +- .../OPNsense/AcmeClient/validations.volt | 2 +- 8 files changed, 76 insertions(+), 608 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php index a47695edc..843e37db9 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php @@ -1,6 +1,6 @@ "failed","validations" => array()); - // perform validation - $valMsgs = $mdl->performValidation(); - foreach ($valMsgs as $field => $msg) { - // replace absolute path to attribute for relative one at uuid. - if ($node != null) { - $fieldnm = str_replace($node->__reference, $reference, $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } else { - $result["validations"][$msg->getField()] = $msg->getMessage(); - } - } + protected static $internalModelName = 'acmeclient'; + protected static $internalModelClass = '\OPNsense\AcmeClient\AcmeClient'; - // serialize model to config and save when there are no validation errors - if (count($result['validations']) == 0) { - // save config if validated correctly - $mdl->serializeToConfig(); - - Config::getInstance()->save(); - $result = array("result" => "saved"); - } - - return $result; - } - - /** - * retrieve account settings or return defaults - * @param $uuid item unique id - * @return array - */ public function getAction($uuid = null) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('accounts.account.'.$uuid); - if ($node != null) { - // return node - return array("account" => $node->getNodes()); - } - } else { - // generate new node, but don't save to disc - $node = $mdlAcme->accounts->account->add(); - return array("account" => $node->getNodes()); - } - return array(); + $this->sessionClose(); + return $this->getBase('account', 'accounts.account', $uuid); } - /** - * update account with given properties - * @param $uuid item unique id - * @return array - */ - public function setAction($uuid) - { - if ($this->request->isPost() && $this->request->hasPost("account")) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('accounts.account.'.$uuid); - if ($node != null) { - $node->setNodes($this->request->getPost("account")); - return $this->save($mdlAcme, $node, "account"); - } - } - } - return array("result"=>"failed"); - } - - /** - * add new account and set with attributes from post - * @return array - */ public function addAction() { - $result = array("result"=>"failed"); - if ($this->request->isPost() && $this->request->hasPost("account")) { - $mdlAcme = new AcmeClient(); - $node = $mdlAcme->accounts->account->Add(); - $node->setNodes($this->request->getPost("account")); - return $this->save($mdlAcme, $node, "account"); - } - return $result; + return $this->addBase('account', 'accounts.account'); + } + + public function updateAction($uuid) + { + return $this->setBase('account', 'accounts.account', $uuid); } - /** - * delete account by uuid - * @param $uuid item unique id - * @return array status - */ public function delAction($uuid) { - $result = array("result"=>"failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - if ($mdlAcme->accounts->account->del($uuid)) { - // if item is removed, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - $result['result'] = 'deleted'; - } else { - $result['result'] = 'not found'; - } - } - } - return $result; + return $this->delBase('accounts.account', $uuid); } - /** - * toggle account by uuid (enable/disable) - * @param $uuid item unique id - * @param $enabled desired state enabled(1)/disabled(0), leave empty for toggle - * @return array status - */ public function toggleAction($uuid, $enabled = null) { - - $result = array("result" => "failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('accounts.account.' . $uuid); - if ($node != null) { - if ($enabled == "0" || $enabled == "1") { - $node->enabled = (string)$enabled; - } elseif ((string)$node->enabled == "1") { - $node->enabled = "0"; - } else { - $node->enabled = "1"; - } - $result['result'] = $node->enabled; - // if item has toggled, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - } - } - } - return $result; + return $this->toggleBase('accounts.account', $uuid); } - /** - * search accounts - * @return array - */ public function searchAction() { - $this->sessionClose(); - $mdlAcme = new AcmeClient(); - $grid = new UIModelGrid($mdlAcme->accounts->account); - return $grid->fetchBindRequest( - $this->request, - array("enabled", "name", "email"), - "name" - ); + return $this->searchBase('accounts.account', array('enabled', 'name', 'email')); } } diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php index 2c9c666ea..8856b3303 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php @@ -1,6 +1,6 @@ "failed","validations" => array()); - // perform validation - $valMsgs = $mdl->performValidation(); - foreach ($valMsgs as $field => $msg) { - // replace absolute path to attribute for relative one at uuid. - if ($node != null) { - $fieldnm = str_replace($node->__reference, $reference, $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } else { - $result["validations"][$msg->getField()] = $msg->getMessage(); - } - } + protected static $internalModelName = 'acmeclient'; + protected static $internalModelClass = '\OPNsense\AcmeClient\AcmeClient'; - // serialize model to config and save when there are no validation errors - if (count($result['validations']) == 0) { - // save config if validated correctly - $mdl->serializeToConfig(); - - Config::getInstance()->save(); - $result = array("result" => "saved"); - } - - return $result; - } - - /** - * retrieve action settings or return defaults - * @param $uuid item unique id - * @return array - */ public function getAction($uuid = null) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('actions.action.'.$uuid); - if ($node != null) { - // return node - return array("action" => $node->getNodes()); - } - } else { - // generate new node, but don't save to disc - $node = $mdlAcme->actions->action->add(); - return array("action" => $node->getNodes()); - } - return array(); + $this->sessionClose(); + return $this->getBase('action', 'actions.action', $uuid); } - /** - * update action with given properties - * @param $uuid item unique id - * @return array - */ - public function setAction($uuid) - { - if ($this->request->isPost() && $this->request->hasPost("action")) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('actions.action.'.$uuid); - if ($node != null) { - $node->setNodes($this->request->getPost("action")); - return $this->save($mdlAcme, $node, "action"); - } - } - } - return array("result"=>"failed"); - } - - /** - * add new action and set with attributes from post - * @return array - */ public function addAction() { - $result = array("result"=>"failed"); - if ($this->request->isPost() && $this->request->hasPost("action")) { - $mdlAcme = new AcmeClient(); - $node = $mdlAcme->actions->action->Add(); - $node->setNodes($this->request->getPost("action")); - return $this->save($mdlAcme, $node, "action"); - } - return $result; + return $this->addBase('action', 'actions.action'); + } + + public function updateAction($uuid) + { + return $this->setBase('action', 'actions.action', $uuid); } - /** - * delete action by uuid - * @param $uuid item unique id - * @return array status - */ public function delAction($uuid) { - $result = array("result"=>"failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - if ($mdlAcme->actions->action->del($uuid)) { - // if item is removed, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - $result['result'] = 'deleted'; - } else { - $result['result'] = 'not found'; - } - } - } - return $result; + return $this->delBase('actions.action', $uuid); } - /** - * toggle action by uuid (enable/disable) - * @param $uuid item unique id - * @param $enabled desired state enabled(1)/disabled(0), leave empty for toggle - * @return array status - */ public function toggleAction($uuid, $enabled = null) { - - $result = array("result" => "failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('actions.action.' . $uuid); - if ($node != null) { - if ($enabled == "0" || $enabled == "1") { - $node->enabled = (string)$enabled; - } elseif ((string)$node->enabled == "1") { - $node->enabled = "0"; - } else { - $node->enabled = "1"; - } - $result['result'] = $node->enabled; - // if item has toggled, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - } - } - } - return $result; + return $this->toggleBase('actions.action', $uuid); } - /** - * search actions - * @return array - */ public function searchAction() { - $this->sessionClose(); - $mdlAcme = new AcmeClient(); - $grid = new UIModelGrid($mdlAcme->actions->action); - return $grid->fetchBindRequest( - $this->request, - array("enabled", "name", "description"), - "name" - ); + return $this->searchBase('actions.action', array('enabled', 'name', 'description')); } } diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php index 913afdc4c..71e946933 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php @@ -1,6 +1,6 @@ "failed","validations" => array()); - // perform validation - $valMsgs = $mdl->performValidation(); - foreach ($valMsgs as $field => $msg) { - // replace absolute path to attribute for relative one at uuid. - if ($node != null) { - $fieldnm = str_replace($node->__reference, $reference, $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } else { - $result["validations"][$msg->getField()] = $msg->getMessage(); - } - } + protected static $internalModelName = 'acmeclient'; + protected static $internalModelClass = '\OPNsense\AcmeClient\AcmeClient'; - // serialize model to config and save when there are no validation errors - if (count($result['validations']) == 0) { - // save config if validated correctly - $mdl->serializeToConfig(); - - Config::getInstance()->save(); - $result = array("result" => "saved"); - } - - return $result; - } - - /** - * retrieve certificate settings or return defaults - * @param $uuid item unique id - * @return array - */ public function getAction($uuid = null) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('certificates.certificate.'.$uuid); - if ($node != null) { - // return node - return array("certificate" => $node->getNodes()); - } - } else { - // generate new node, but don't save to disc - $node = $mdlAcme->certificates->certificate->add(); - return array("certificate" => $node->getNodes()); - } - return array(); + $this->sessionClose(); + return $this->getBase('certificate', 'certificates.certificate', $uuid); } - /** - * update certificate with given properties - * @param $uuid item unique id - * @return array - */ - public function setAction($uuid) - { - if ($this->request->isPost() && $this->request->hasPost("certificate")) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('certificates.certificate.'.$uuid); - if ($node != null) { - $node->setNodes($this->request->getPost("certificate")); - return $this->save($mdlAcme, $node, "certificate"); - } - } - } - return array("result"=>"failed"); - } - - /** - * add new certificate and set with attributes from post - * @return array - */ public function addAction() { - $result = array("result"=>"failed"); - if ($this->request->isPost() && $this->request->hasPost("certificate")) { - $mdlAcme = new AcmeClient(); - $node = $mdlAcme->certificates->certificate->Add(); - $node->setNodes($this->request->getPost("certificate")); - return $this->save($mdlAcme, $node, "certificate"); - } - return $result; + return $this->addBase('certificate', 'certificates.certificate'); + } + + public function updateAction($uuid) + { + return $this->setBase('certificate', 'certificates.certificate', $uuid); } - /** - * delete certificate by uuid - * @param $uuid item unique id - * @return array status - */ public function delAction($uuid) { - $result = array("result"=>"failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - if ($mdlAcme->certificates->certificate->del($uuid)) { - // if item is removed, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - $result['result'] = 'deleted'; - } else { - $result['result'] = 'not found'; - } - } - } - return $result; + return $this->delBase('certificates.certificate', $uuid); } - /** - * toggle certificate by uuid (enable/disable) - * @param $uuid item unique id - * @param $enabled desired state enabled(1)/disabled(0), leave empty for toggle - * @return array status - */ public function toggleAction($uuid, $enabled = null) { - - $result = array("result" => "failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('certificates.certificate.' . $uuid); - if ($node != null) { - if ($enabled == "0" || $enabled == "1") { - $node->enabled = (string)$enabled; - } elseif ((string)$node->enabled == "1") { - $node->enabled = "0"; - } else { - $node->enabled = "1"; - } - $result['result'] = $node->enabled; - // if item has toggled, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - } - } - } - return $result; + return $this->toggleBase('certificates.certificate', $uuid); } - /** - * search certificates - * @return array - */ public function searchAction() { - $this->sessionClose(); - $mdlAcme = new AcmeClient(); - $grid = new UIModelGrid($mdlAcme->certificates->certificate); - return $grid->fetchBindRequest( - $this->request, - array("enabled", "name", "altNames", "description", "lastUpdate", "statusCode", "statusLastUpdate"), - "name" - ); + return $this->searchBase('certificates.certificate', array('enabled', 'name', 'altNames', 'description', 'lastUpdate', 'statusCode', 'statusLastUpdate')); } /** diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php index 70a3cafc0..5465e8ba0 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php @@ -1,6 +1,6 @@ "failed","validations" => array()); - // perform validation - $valMsgs = $mdl->performValidation(); - foreach ($valMsgs as $field => $msg) { - // replace absolute path to attribute for relative one at uuid. - if ($node != null) { - $fieldnm = str_replace($node->__reference, $reference, $msg->getField()); - $result["validations"][$fieldnm] = $msg->getMessage(); - } else { - $result["validations"][$msg->getField()] = $msg->getMessage(); - } - } + protected static $internalModelName = 'acmeclient'; + protected static $internalModelClass = '\OPNsense\AcmeClient\AcmeClient'; - // serialize model to config and save when there are no validation errors - if (count($result['validations']) == 0) { - // save config if validated correctly - $mdl->serializeToConfig(); - - Config::getInstance()->save(); - $result = array("result" => "saved"); - } - - return $result; - } - - /** - * retrieve validation settings or return defaults - * @param $uuid item unique id - * @return array - */ public function getAction($uuid = null) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('validations.validation.'.$uuid); - if ($node != null) { - // return node - return array("validation" => $node->getNodes()); - } - } else { - // generate new node, but don't save to disc - $node = $mdlAcme->validations->validation->add(); - return array("validation" => $node->getNodes()); - } - return array(); + $this->sessionClose(); + return $this->getBase('validation', 'validations.validation', $uuid); } - /** - * update validation with given properties - * @param $uuid item unique id - * @return array - */ - public function setAction($uuid) - { - if ($this->request->isPost() && $this->request->hasPost("validation")) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('validations.validation.'.$uuid); - if ($node != null) { - $node->setNodes($this->request->getPost("validation")); - return $this->save($mdlAcme, $node, "validation"); - } - } - } - return array("result"=>"failed"); - } - - /** - * add new validation and set with attributes from post - * @return array - */ public function addAction() { - $result = array("result"=>"failed"); - if ($this->request->isPost() && $this->request->hasPost("validation")) { - $mdlAcme = new AcmeClient(); - $node = $mdlAcme->validations->validation->Add(); - $node->setNodes($this->request->getPost("validation")); - return $this->save($mdlAcme, $node, "validation"); - } - return $result; + return $this->addBase('validation', 'validations.validation'); + } + + public function updateAction($uuid) + { + return $this->setBase('validation', 'validations.validation', $uuid); } - /** - * delete validation by uuid - * @param $uuid item unique id - * @return array status - */ public function delAction($uuid) { - $result = array("result"=>"failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - if ($mdlAcme->validations->validation->del($uuid)) { - // if item is removed, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - $result['result'] = 'deleted'; - } else { - $result['result'] = 'not found'; - } - } - } - return $result; + return $this->delBase('validations.validation', $uuid); } - /** - * toggle validation by uuid (enable/disable) - * @param $uuid item unique id - * @param $enabled desired state enabled(1)/disabled(0), leave empty for toggle - * @return array status - */ public function toggleAction($uuid, $enabled = null) { - - $result = array("result" => "failed"); - if ($this->request->isPost()) { - $mdlAcme = new AcmeClient(); - if ($uuid != null) { - $node = $mdlAcme->getNodeByReference('validations.validation.' . $uuid); - if ($node != null) { - if ($enabled == "0" || $enabled == "1") { - $node->enabled = (string)$enabled; - } elseif ((string)$node->enabled == "1") { - $node->enabled = "0"; - } else { - $node->enabled = "1"; - } - $result['result'] = $node->enabled; - // if item has toggled, serialize to config and save - $mdlAcme->serializeToConfig(); - Config::getInstance()->save(); - } - } - } - return $result; + return $this->toggleBase('validations.validation', $uuid); } - /** - * search validations - * @return array - */ public function searchAction() { - $this->sessionClose(); - $mdlAcme = new AcmeClient(); - $grid = new UIModelGrid($mdlAcme->validations->validation); - return $grid->fetchBindRequest( - $this->request, - array("enabled", "name", "description"), - "name" - ); + return $this->searchBase('validations.validation', array('enabled', 'name', 'description')); } } diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt index 116ab79bd..f6d6e8ed3 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/accounts.volt @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. $("#grid-accounts").UIBootgrid( { search:'/api/acmeclient/accounts/search', get:'/api/acmeclient/accounts/get/', - set:'/api/acmeclient/accounts/set/', + set:'/api/acmeclient/accounts/update/', add:'/api/acmeclient/accounts/add/', del:'/api/acmeclient/accounts/del/', toggle:'/api/acmeclient/accounts/toggle/', diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt index 54fd0c35b..dcb794f7e 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/actions.volt @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. $("#grid-actions").UIBootgrid( { search:'/api/acmeclient/actions/search', get:'/api/acmeclient/actions/get/', - set:'/api/acmeclient/actions/set/', + set:'/api/acmeclient/actions/update/', add:'/api/acmeclient/actions/add/', del:'/api/acmeclient/actions/del/', toggle:'/api/acmeclient/actions/toggle/', diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt index 1e2d16bbd..35d2bae83 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/certificates.volt @@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE. var gridParams = { search:'/api/acmeclient/certificates/search', get:'/api/acmeclient/certificates/get/', - set:'/api/acmeclient/certificates/set/', + set:'/api/acmeclient/certificates/update/', add:'/api/acmeclient/certificates/add/', del:'/api/acmeclient/certificates/del/', toggle:'/api/acmeclient/certificates/toggle/', diff --git a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt index 5edf44671..7c5d762d8 100644 --- a/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt +++ b/security/acme-client/src/opnsense/mvc/app/views/OPNsense/AcmeClient/validations.volt @@ -38,7 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. $("#grid-validations").UIBootgrid( { search:'/api/acmeclient/validations/search', get:'/api/acmeclient/validations/get/', - set:'/api/acmeclient/validations/set/', + set:'/api/acmeclient/validations/update/', add:'/api/acmeclient/validations/add/', del:'/api/acmeclient/validations/del/', toggle:'/api/acmeclient/validations/toggle/', From 6a01a1d9d270360ef5f2d0a662250e3ed3cce271 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Sun, 3 Feb 2019 14:39:52 +0100 Subject: [PATCH 2/3] security/acme-client: bump version --- security/acme-client/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/acme-client/Makefile b/security/acme-client/Makefile index 7013df934..b44d12c9b 100644 --- a/security/acme-client/Makefile +++ b/security/acme-client/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= acme-client -PLUGIN_VERSION= 1.20 +PLUGIN_VERSION= 1.21 PLUGIN_COMMENT= Let's Encrypt client PLUGIN_MAINTAINER= opnsense@moov.de PLUGIN_DEPENDS= acme.sh bind912 From 7973eb166ce65ecb373e5902d069ea811c2b0a61 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Mon, 4 Feb 2019 22:09:10 +0100 Subject: [PATCH 3/3] security/acme-client: restore item sort order --- .../controllers/OPNsense/AcmeClient/Api/AccountsController.php | 2 +- .../controllers/OPNsense/AcmeClient/Api/ActionsController.php | 2 +- .../OPNsense/AcmeClient/Api/CertificatesController.php | 2 +- .../OPNsense/AcmeClient/Api/ValidationsController.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php index 843e37db9..c7f8fb0ef 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/AccountsController.php @@ -71,6 +71,6 @@ class AccountsController extends ApiMutableModelControllerBase public function searchAction() { - return $this->searchBase('accounts.account', array('enabled', 'name', 'email')); + return $this->searchBase('accounts.account', array('enabled', 'name', 'email'), 'name'); } } diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php index 8856b3303..48682f8b3 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ActionsController.php @@ -71,6 +71,6 @@ class ActionsController extends ApiMutableModelControllerBase public function searchAction() { - return $this->searchBase('actions.action', array('enabled', 'name', 'description')); + return $this->searchBase('actions.action', array('enabled', 'name', 'description'), 'name'); } } diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php index 71e946933..88df62cdc 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/CertificatesController.php @@ -72,7 +72,7 @@ class CertificatesController extends ApiMutableModelControllerBase public function searchAction() { - return $this->searchBase('certificates.certificate', array('enabled', 'name', 'altNames', 'description', 'lastUpdate', 'statusCode', 'statusLastUpdate')); + return $this->searchBase('certificates.certificate', array('enabled', 'name', 'altNames', 'description', 'lastUpdate', 'statusCode', 'statusLastUpdate'), 'name'); } /** diff --git a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php index 5465e8ba0..ce052d789 100644 --- a/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php +++ b/security/acme-client/src/opnsense/mvc/app/controllers/OPNsense/AcmeClient/Api/ValidationsController.php @@ -71,6 +71,6 @@ class ValidationsController extends ApiMutableModelControllerBase public function searchAction() { - return $this->searchBase('validations.validation', array('enabled', 'name', 'description')); + return $this->searchBase('validations.validation', array('enabled', 'name', 'description'), 'name'); } }