[1.0.x] Fleetview client

Created on 3 March 2025, about 1 month ago

The Fleetview Client Module connects Drupal websites to the Fleetview dashboard, providing real-time monitoring of your sites' module status, system reports, and other useful environment data. This module ensures secure and encrypted data transmission, allowing website administrators to gain insights into their Drupal environments effortlessly.

This module creates a JSON document and makes it available for requests with the correct encryption token. The module is compatible with Drupal 8, 9, 10 and 11.

https://www.drupal.org/project/fleetview_client

📌 Task
Status

Needs review

Component

module

Created by

🇬🇧United Kingdom spencer95@gmail.com Swansea/Cardiff

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @spencer95@gmail.com
  • 🇮🇳India vishal.kadam Mumbai

    Thank you for applying!

    Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

    The important notes are the following.

    • If you have not done it yet, you should run phpcs --standard=Drupal,DrupalPractice on the project, which alone fixes most of what reviewers would report.
    • For the time this application is open, only your commits are allowed.
    • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status won't be changed by this application and no other user will be able to opt projects into security advisory policy.
    • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

    To the reviewers

    Please read How to review security advisory coverage applications , Application workflow , What to cover in an application review , and Tools to use for reviews .

    The important notes are the following.

    • It is preferable to wait for a Code Review Administrator before commenting on newly created applications. Code Review Administrators will do some preliminary checks that are necessary before any change on the project files is suggested.
    • Reviewers should show the output of a CLI tool only once per application.
    • It may be best to have the applicant fix things before further review.

    For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues .

  • 🇮🇳India vishal.kadam Mumbai

    1. FILE: README.md

    The README file is missing the required sections , - Requirements.

    2. FILE: README.txt

    Remove README.txt since README.md is present.

    3. FILE: fleetview_client.module

    /**
     * @file
     * Fleetview client module.
     *
     * @author Dylan James
     */

    The usual description for a .module file is “Hook implementations for the [module name] module”, where [module name] is the module name given in the .info.yml file.

    /**
     * Implements hook_menu().
     */
    function fleetview_client_menu() {
      $items = [];
    
      $items['admin/config/system/fleetview_client'] = [
        'title' => 'System Status',
        'description' => 'Configuration for the Fleetview client module',
        'route_name' => 'fleetview_client.admin_settings',
        'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
      ];
    
      return $items;
    }

    This is deprecated code written in the Drupal 7 and should be removed.

    4. FILE: src/Controller/FleetviewClientController.php

      /**
       * FleetviewClientController constructor.
       *
       * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
       *   The module handler to invoke the alter hook with.
       * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
       *   The theme handler.
       * @param \Drupal\fleetview_client\Services\FleetviewClientEncryption $encrypt
       *   The system status encrypt service.
       * @param \Drupal\update\UpdateManagerInterface $updateManager
       *   The update manager.
       * @param \Drupal\Core\State\StateInterface $state
       *   The state storage service.
       * @param \Drupal\system\SystemManager $systemManager
       *   The system manager.
       */
      public function __construct(ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, FleetviewClientEncryption $encrypt, UpdateManagerInterface $updateManager, StateInterface $state, $systemManager) {

    The documentation comment for constructors is not mandatory anymore, If it is given, the description must be “Constructs a new [class name] object”, where [class name] includes the class namespace.

  • 🇬🇧United Kingdom spencer95@gmail.com Swansea/Cardiff

    Thanks for taking time to review. I've fixed those issues.

  • 🇮🇳India vishal.kadam Mumbai

    Rest looks fine to me.

    Let’s wait for a Code Review Administrator to take a look and if everything goes fine, you will get the role.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    • The following points are just a start and don't necessarily encompass all of the changes that may be necessary
    • A specific point may just be an example and may apply in other places
    • A review is about code that does not follow the coding standards, contains possible security issue, or does not correctly use the Drupal API
    • The single review points are not ordered, not even by importance

    src/Controller/FleetviewClientController.php

       // Add status report data.
        $system_info_controller = new SystemInfoController($this->systemManager);
    

    Controllers are not part of the public API and are not created by directly calling the class constructor.

    src/Form/FleetviewClientSettingsForm.php

        $form['fleetview_client_service'] = [
          '#type' => 'textfield',
          '#title' => $this->t('Connection token'),
          '#description' => $config->get('fleetview_client_token') . "-" . $config->get('fleetview_client_encrypt_token'),
          '#default_value' => $config->get('fleetview_client_token') . "-" . $config->get('fleetview_client_encrypt_token'),
          '#attributes' => ['style' => ['display:none;']],
          '#size' => 60,
          '#maxlength' => 60,
          '#disabled' => TRUE,
        ];
    

    Neither fleetview_client_token nor fleetview_client_encrypt_token is saved.

    src/Services/FleetviewClientEncryption.php

        $encryptionToken = \Drupal::config('fleetview_client.settings')->get('fleetview_client_encrypt_token');
        $key = hash("SHA256", $encryptionToken, TRUE);
    

    fleetview_client_encrypt_token is not saved. Configuration objects are for values that are changed via a form.

    fleetview_client.module

    Either the hook_help() implementation gives more details, or it can be removed.

  • 🇬🇧United Kingdom spencer95@gmail.com Swansea/Cardiff

    Thanks avpaderno. These issues have now been refactored and fixed.
    I have removed the settings form, and replaced the usage of config with state.

Production build 0.71.5 2024