From 4d2b257808debc62811d46acb591db3f81be3f3e Mon Sep 17 00:00:00 2001 From: Andras Iklody Date: Fri, 16 Dec 2022 08:08:17 +0100 Subject: [PATCH 1/3] Update INSTALL.md --- INSTALL/INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL/INSTALL.md b/INSTALL/INSTALL.md index 8a9c901..8f18ce6 100644 --- a/INSTALL/INSTALL.md +++ b/INSTALL/INSTALL.md @@ -1,6 +1,6 @@ ## Requirements -An Ubuntu server (18.04/20.04 should both work fine) - though other linux installations should work too. +An Ubuntu server (20.04/22.04 should both work fine) - though other linux installations should work too. - apache2 (or nginx), mysql/mariadb, sqlite need to be installed and running - php version 8+ is required From 256bfa8702c5005dd02b0ed45bdd3a295b662bdb Mon Sep 17 00:00:00 2001 From: iglocska Date: Fri, 16 Dec 2022 15:32:29 +0100 Subject: [PATCH 2/3] fix: [users] handle saving of a user without KC --- src/Model/Table/UsersTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Table/UsersTable.php b/src/Model/Table/UsersTable.php index 8f74390..00c53f0 100644 --- a/src/Model/Table/UsersTable.php +++ b/src/Model/Table/UsersTable.php @@ -264,7 +264,7 @@ class UsersTable extends AppTable public function handleUserUpdateRouter(\App\Model\Entity\User $user): bool { - if (!empty(Configure::read('keycloak'))) { + if (!empty(Configure::read('keycloak.enabled'))) { $success = $this->handleUserUpdate($user); // return $success; } From f12102766092771e2ede2a9a5a7dfe05a25206de Mon Sep 17 00:00:00 2001 From: iglocska Date: Fri, 16 Dec 2022 16:45:28 +0100 Subject: [PATCH 3/3] chg: [skeleton module] added extra explanations --- .../SkeletonConnectorExample.php | 59 ++++++++++++++++--- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/src/Lib/default/local_tool_connectors/SkeletonConnectorExample.php b/src/Lib/default/local_tool_connectors/SkeletonConnectorExample.php index eefbd7a..2f441b8 100644 --- a/src/Lib/default/local_tool_connectors/SkeletonConnectorExample.php +++ b/src/Lib/default/local_tool_connectors/SkeletonConnectorExample.php @@ -90,7 +90,14 @@ class SkeletonConnector extends CommonConnectorTools // filter $data } - // return the data embedded in a generic index parameter array + /* + * return the data embedded in a generic index parameter array + * + * For more information on the structure of the index, refer to the cerebrate/src/templates/element/genericElements/IndexTable/index_table.php factory + * Valid form field types can be found at cerebrate/src/templates/element/genericElements/IndexTable/Fields + * Be aware that some form fields require additional parameters, so make sure that you check the available parameters in the form field template file + * + */ return [ 'type' => 'index', @@ -135,6 +142,14 @@ class SkeletonConnector extends CommonConnectorTools public function myFormAction(array $params): array { if ($params['request']->is(['get'])) { + /* + * Usually on get requests we return a form to the user + * + * This form can either simply be a confirmation prompt (such as the example below), or a full fledged form with diverse form fields + * In the latter case, refer to the cerebrate/src/templates/element/Form/genericForm.php library + * For individual form field types, see cerebrate/src/templates/element/Form/Fields/*.php + * + */ return [ 'data' => [ 'title' => __('My Form Title'), @@ -146,7 +161,17 @@ class SkeletonConnector extends CommonConnectorTools ] ]; } elseif ($params['request']->is(['post'])) { - // handle posted data + /* + * Handle the posted data here. + * The response should be in the following format: + * [ + * "success": 0|1, + * "message": "your_message_to_the_user" + * ] + * + * The message can be hard coded or derived from the output of your interactions with the local tool + * + */ if ($success) { return ['success' => 1, 'message' => __('Action successful.')]; } else { @@ -164,22 +189,40 @@ class SkeletonConnector extends CommonConnectorTools public function initiateConnection(array $params): array { - // encode initial connection in local tool - // build and return initiation payload + /* + * Encode initial connection in local tool + * + * This function is invoked by the REQUESTOR side. + * In some cases, this function doesn't interact with the local tool yet, but it is an option that can be handy for 2-way exchanges + * Construct the initial payload to be sent to the inbox of the REQUESTEE's Cerebrate node. + * + */ return $payload; } public function acceptConnection(array $params): array { - // encode acceptance of the connection request in local tool, based on the payload from the initiation - // return payload for remote to encode the connection + /* + * Encode the actions to be taken if the REQUESTEE accepts the interconnection request + * + * The $params parameter will include the payload generated on the REQUESTOR side via the initiateConnection() function + * Generate access credentials, configurations, whatever is needed on the REQUESTEE's local tool instance and encode the outcome in the payload + * Make sure that the payload includes everything needed by finaliseConnection() to interconnect the REQUESTOR's tool to that of REQUESTEE + * + */ return $payload; } public function finaliseConnection(array $params): bool { - // based on the payload from the acceptance, finalise the connection - // return true on success + /* + * Encode the actions to be taken once the positive response from the REQUESTEE arrives back at the REQUESTOR's instance + * + * At this point both parties have agreed to the interconnection, REQUESTEE has sent their credentials / access information back to REQUESTOR + * The REQUESTOR needs to encode the connection based on the instructions generated by acceptConnection() on the REQUESTEE side + * It is sufficient to return true on success. + * + */ return $success; } }