[1.0.x] TFA Headless

Created on 13 May 2024, about 1 month ago
Updated 27 May 2024, 29 days ago

Tfa Headless is a module that creates endpoints that can be used to use the Google Authenticator flow for Headless use. It depends on the TFA module: https://www.drupal.org/project/tfa .
This headless functionality was not possible using other modules (or this one). In the future there will be other methods added, depending on the requests from users.

Project link

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

📌 Task
Status

Needs work

Component

module

Created by

🇳🇱Netherlands arlanschouwstra

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

Comments & Activities

  • Issue created by @arlanschouwstra
  • 🇮🇳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 .

  • 🇺🇸United States cmlara

    To Reviewers:

    Please ensure this module has mitigated the concerns raised in SA-CONTRIB-2023-030 when considering if this module properly uses Drupal API’s.

    The TFA policy is that REST and similar authentication should be disabled with the 8.x-1.x branch for a secure deployment due to known architectural issues that the 2.x branch has been addressing.

    Also worth mentioning a feature request that exists in the TFA module queue TFA module with headless Drupal Active which notes part of this module may be unnecessary with the 2.x branch and is looking for scoping details for the remainder of the issue.

    I have performed no review of the submitted modules code.

  • Status changed to Needs work about 1 month ago
  • 🇮🇳India vishal.kadam Mumbai

    1. main will be a supported branch in future, but for the moment it is better not to use it. It is not wrong, but it is not completely supported on drupal.org. For now, the branch names must follow what is reported in Release branches .

    2. FILE: tfa_headless.info.yml

    core_version_requirement: ^8 || ^9 || ^10

    The Drupal Core versions before 8.7.7 do not recognize the core_version_requirement key.

    3. FILE: src/Service/TfaHeadlessService.php

      /**
       * Class constructor.
       *
       * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
       *   The configuration factory.
       * @param \Drupal\Core\Session\AccountInterface $current_user
       *   The current user.
       * @param \Drupal\user\UserDataInterface $user_data
       *   The user data.
       * @param \Drupal\encrypt\EncryptionProfileManagerInterface $encryption_profile_manager
       *   Encryption profile manager.
       * @param \Drupal\encrypt\EncryptServiceInterface $encrypt_service
       *   Encryption service.
       * @param \Drupal\Component\Datetime\TimeInterface $time
       *   The time service.
       */
      public function __construct(

    FILE: src/Plugin/rest/resource/Generate.php

      /**
       * Class constructor.
       *
       * @param array $configuration
       *   The configuration array.
       * @param string $plugin_id
       *   The plugin id.
       * @param array $plugin_definition
       *   The plugin definition.
       * @param array $serializer_formats
       *   The serializer formats.
       * @param \Psr\Log\LoggerInterface $logger
       *   The plugin logger service.
       * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
       *   The configuration factory.
       * @param \Drupal\Core\Session\AccountInterface $current_user
       *   The current user.
       */
      public function __construct(

    FILE: src/Plugin/rest/resource/Login.php

      /**
       * Class constructor.
       *
       * @param array $configuration
       *   The configuration array.
       * @param string $plugin_id
       *   The plugin id.
       * @param array $plugin_definition
       *   The plugin definition.
       * @param array $serializer_formats
       *   The serializer formats.
       * @param \Psr\Log\LoggerInterface $logger
       *   The plugin logger service.
       * @param \Drupal\tfa_headless\Service\TfaHeadlessService $tfa_service
       *   The Headless TFA service.
       * @param \Drupal\Core\Session\AccountInterface $current_user
       *   The current user.
       */
      public function __construct(

    FILE: src/Plugin/rest/resource/Register.php

      /**
       * Class constructor.
       *
       * @param array $configuration
       *   The configuration array.
       * @param string $plugin_id
       *   The plugin id.
       * @param array $plugin_definition
       *   The plugin definition.
       * @param array $serializer_formats
       *   The serializer formats.
       * @param \Psr\Log\LoggerInterface $logger
       *   The plugin logger service.
       * @param \Drupal\tfa_headless\Service\TfaHeadlessService $tfa_service
       *   The Headless TFA service.
       * @param \Drupal\Core\Session\AccountInterface $current_user
       *   The current user.
       */
      public function __construct(

    FILE: src/Plugin/rest/resource/Status.php

      /**
       * Class constructor.
       *
       * @param array $configuration
       *   The configuration array.
       * @param string $plugin_id
       *   The plugin id.
       * @param array $plugin_definition
       *   The plugin definition.
       * @param array $serializer_formats
       *   The serializer formats.
       * @param \Psr\Log\LoggerInterface $logger
       *   The plugin logger service.
       * @param \Drupal\Core\Session\AccountInterface $current_user
       *   The current user.
       * @param \Drupal\user\UserDataInterface $user_data
       *   The user data.
       */
      public function __construct(

    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.

  • 🇳🇱Netherlands arlanschouwstra

    @vishal.kadam I updated everything based on your feedback.

    I also removed Drupal 8 support from the 1.0.x branch, as

  • 🇮🇳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.

  • Status changed to Needs review 30 days ago
  • Status changed to Needs work 29 days ago
  • 🇺🇸United States cmlara

    I’ve given a very cursory glance at the code and would like to see some documentation on how this is suppose to be deployed given the TFA module policy that REST authentication should be prohibited.

Production build 0.69.0 2024