Created on 25 June 2024, 3 days ago

Integrates Drupal with BankID (https://www.bankid.com/en) used for user authentication.

Project link

https://www.drupal.org/project/bankid →

📌 Task
Status

Needs work

Component

module

Created by

🇸🇪Sweden Alsén

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

Comments & Activities

  • Issue created by @Alsén
  • 🇮🇳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
  • Status changed to Needs work 3 days ago
  • 🇮🇳India vishal.kadam Mumbai

    1. Fix PHPCS issues.

    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml bankid/
    
    FILE: bankid/bankid.info.yml
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -------------------------------------------------------------------------------
     1 | WARNING | [ ] Remove "version" from the info file, it will be added by drupal.org packaging automatically
     8 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/assets/FPTestcert4_20230629_passphrase.txt
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     1 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/bankid.services.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     12 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bankid/README.md
    -------------------------------------------------------------------------
    FOUND 1 ERROR AND 5 WARNINGS AFFECTING 6 LINES
    -------------------------------------------------------------------------
      48 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
      80 | WARNING | [ ] Line exceeds 80 characters; contains 88 characters
      83 | WARNING | [ ] Line exceeds 80 characters; contains 112 characters
      88 | WARNING | [ ] Line exceeds 80 characters; contains 99 characters
      89 | WARNING | [ ] Line exceeds 80 characters; contains 115 characters
     105 | ERROR   | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------
    
    FILE: bankid/bankid.links.task.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     4 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bankid/bankid.module
    -------------------------------------------------------------------------------
    FOUND 7 ERRORS AFFECTING 7 LINES
    -------------------------------------------------------------------------------
      1 | ERROR | [x] Missing file doc comment
      6 | ERROR | [x] Additional blank lines found at end of doc comment
     16 | ERROR | [ ] bankid_install() is an installation hook and must be declared in an install file
     23 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     24 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     30 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
     41 | ERROR | [ ] bankid_uninstall() is an installation hook and must be declared in an install file
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/Plugin/Block/BankIDAuthenticateBlock.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Block\BlockPluginInterface.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/BankIDClient.php
    -------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -------------------------------------------------------------------------------
       6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\key\KeyRepository.
     330 | ERROR | [ ] Private method name "BankIDClient::requestExceptionToBankIDResponse" is not in lowerCamel format
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/IntegrationManager.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\bankid\Annotation\Integration.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/IntegrationBase.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Database\Connection.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/Form/BankidSettingsForm.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/Form/BankIDAuthenticateForm.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormBase.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/src/Controller/BankIDController.php
    -------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Symfony\Component\DependencyInjection\ContainerInterface.
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------
    
    FILE: bankid/bankid.libraries.yml
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     14 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    FILE: bankid/css/bankid.css
    -------------------------------------------------------------------------------
    FOUND 24 ERRORS AFFECTING 21 LINES
    -------------------------------------------------------------------------------
      5 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
      8 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     11 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     14 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     17 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     20 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
     23 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     26 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     29 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     32 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     35 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     38 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     41 | ERROR | [x] Selectors must be on a single line
     42 | ERROR | [x] Blank lines are not allowed between class names
     42 | ERROR | [x] Expected 1 space before opening brace of class definition; newline found
     43 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     44 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     46 | ERROR | [x] Selectors must be on a single line
     47 | ERROR | [x] Blank lines are not allowed between class names
     47 | ERROR | [x] Expected 1 space before opening brace of class definition; newline found
     48 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     49 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
     51 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 24 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------

    2. FILE: bankid.info.yml

    package: Custom

    This line is used by custom modules created for specific sites. It is not a package name used for projects hosted on drupal.org.

    3. FILE: bankid.routing.yml

    #_permission: true

    Remove commented code.

    4. FILE: bankid.module

    /**
     * Implements hook_install().
     */
    function bankid_install() {
      // Create the database table.
      \Drupal::database()->schema()->createTable('bankid_mapping', [
        'description' => 'Stores BankID user mappings.',
        'fields' => [
          'uid' => [
            'type' => 'int',
            'unsigned' => true,
            'not null' => true,
            'description' => 'User ID',
          ],
          'id' => [
            'type' => 'varchar',
            'length' => 255,
            'not null' => true,
            'description' => 'ID',
          ],
        ],
        'primary key' => ['uid'],
      ]);
    }
    
    /**
     * Implements hook_uninstall().
     */
    function bankid_uninstall() {
      // Drop the database table.
      \Drupal::database()->schema()->dropTable('bankid_mapping');
    }

    The install and uninstall hook must be implemented in the module's .install file.

    5. FILE: src/BankIDClient.php

      /**
       * BankIDClient constructor.
       *
       * @param \Drupal\Core\Config\ConfigFactory $config_factory
       *   The config factory.
       * @param \Drupal\key\KeyRepository $key_repository
       *   The key repository.
       */
      public function __construct(ConfigFactory $config_factory, KeyRepository $key_repository) {

    FILE: src/BankIDResponse.php

      /**
       * BankIDResponse constructor.
       *
       * @param string $status
       *   The status of the response.
       * @param null|array $body
       *   The body of the response.
       */
      public function __construct($status, $body = NULL) {

    FILE: src/IntegrationBase.php

      /**
       * {@inheritdoc}
       */
      public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory, UserStorageInterface $user_storage, DefaultPasswordGenerator $password_generator, Connection $connection) {

    FILE: src/IntegrationManager.php

      /**
       * Creates the discovery object.
       *
       * @param \Traversable $namespaces
       *   An object that implements \Traversable which contains the root paths
       *   keyed by the corresponding namespace to look for plugin implementations.
       * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
       *   Cache backend instance to use.
       * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
       *   The module handler to invoke the alter hook with.
       */
      public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {

    FILE: src/Controller/BankIDController.php

      /**
       * Class constructor.
       *
       * @param \Drupal\bankid\BankIDClient $bankid
       *   The BankID service.
       */
      public function __construct(BankIDClient $bankid) {

    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.

Production build 0.69.0 2024