Project Description:

This module integrates the CaptchEtat API into Drupal, empowering government websites adhering to DSFR (Digital Services for French Republic) standards with enhanced security measures.

CaptchEtat, a robust solution available through Piste Gouv, provides a distorted CAPTCHA string for the user to copy and serves as a pivotal tool in safeguarding online interactions against automated threats.

Key Features and Benefits:

Enhanced Security: CaptchEtat significantly improves the security posture of government websites by preventing automated bots from accessing sensitive data or submitting unauthorized forms.
DSFR Compliance: By integrating CaptchEtat, Drupal websites can ensure compliance with DSFR standards, which mandate robust security measures for digital services offered by the French government.
User-Friendly CAPTCHA: The CAPTCHA strings generated by CaptchEtat are user-friendly yet effective in distinguishing between human users and bots, enhancing the overall user experience on government websites.
Technical Details:
The CaptchEtat module is implemented as a webform plugin element of type "captchetat," seamlessly integrating with Drupal's webform functionality. Administrators can easily add CaptchEtat CAPTCHAs to their webforms through the intuitive Drupal interface and configure settings to suit their specific security requirements.

Usage Instructions:

For detailed instructions on installing and configuring the CaptchEtat module, please refer to the documentation provided on the project page: CaptchEtat Module Documentation.

Visuals:

Below is a screenshot showcasing the CaptchEtat webform plugin in action:

CaptchEtat Webform Plugin

Project link

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

CommentFileSizeAuthor
captchetat-add-element.png40.91 KBewehbe

Comments

ewehbe created an issue. See original summary.

vishal.kadam’s picture

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.

vishal.kadam’s picture

Title: 1.0.x CaptchEtat » [1.0.x] CaptchEtat
Issue summary: View changes
ewehbe’s picture

Issue summary: View changes
ewehbe’s picture

Priority: Normal » Major

I am changing the issue priority as per issue priorities.

solideogloria’s picture

Priority: Major » Normal
Status: Needs review » Needs work

README.md does not follow Drupal's template or best practices.

Remove LICENSE.txt, it will be added by drupal.org packaging automatically.

The captchetat.module file does not implement hook_help().

 ------ ---------------------------------------------------------------------------------------------------
  Line   pareview_temp/src/Plugin/WebformElement/WebformCaptchetatElement.php
 ------ ---------------------------------------------------------------------------------------------------
  24     Class Drupal\captchetat\Plugin\WebformElement\WebformCaptchetatElement extends unknown class
         Drupal\webform\Plugin\WebformElementBase.
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols
  43     Parameter $webform_submission of method
         Drupal\captchetat\Plugin\WebformElement\WebformCaptchetatElement::prepare() has invalid type
         Drupal\webform\WebformSubmissionInterface.
  56     Drupal\captchetat\Plugin\WebformElement\WebformCaptchetatElement::form() calls parent::form() but
         Drupal\captchetat\Plugin\WebformElement\WebformCaptchetatElement does not extend any class.
 ------ ---------------------------------------------------------------------------------------------------

No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

There are a lot of issues with the JS files.

jquery-captcha.js

MANY Unexpected var, use let or const instead
19:28 error '_getCaptchaStyleName' was used before it was defined
53:22 error '_getInstance' was used before it was defined (there are more lines where this happens)
92:1 Put options·||·{} on its own line
101:20 error '_onLoadScriptsSuccess' was used before it was defined
120:22 error 'NULL' is not defined
All 'var' declarations must be at the top of the function scope

And more. I recommend running ESLint on the JS files.

In addition, while this isn't related to the code itself, that old style of captcha can easily be read and defeated by an AI now. It's basically useless at verifying that someone is a human.

vishal.kadam’s picture

LICENSE.txt is not a mandatory file, but it can be left, as long as the license is the same used by Drupal core.

ewehbe’s picture

Status: Needs work » Needs review

Thank you for this review.

  • I have modified the README.md file.
  • Removed the LICENSE.txt.
  • Added the hook_help().
  • Didn't write automated test cases.
  • Fixed the ESLint issues
  • I also added more captcha styles to the captchetat webform plugin which are available in the captchetat API.

Thank you again for your time, I will change the status to Needs review.

avpaderno’s picture

The LICENSE.txt file is added to the package drupal.org automatically creates, but it is still necessary for the repository, although the license for projects hosted on drupal.org cannot be different from the license used for Drupal core.

At the times drupal.org used CVS, the license file was not necessary because a single repository was used for all the projects, including Drupal core, and the license file in the root directory was valid for all the hosted projects. With Git repositories, that is no longer true.

ewehbe’s picture

Thank you @apaderno for this information.

solideogloria’s picture

@apaderno Then I think the PAReview.sh script should be updated. My comment about the LICENSE file is from that script's output.

ewehbe’s picture

Priority: Normal » Major

I am changing the issue priority as per issue priorities.

ewehbe’s picture

Priority: Major » Critical

I am changing the issue priority as per issue priorities.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Priority: Critical » Normal
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution and for your patience with the review process!

I am going to update your account so you can opt into security advisory coverage any project you create, including the projects you already created.

These are some recommended readings to help you with maintainership:

You can find more contributors chatting on Slack or IRC in #drupal-contribute. So, come hang out and stay involved!
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank the dedicated reviewers as well.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed
ewehbe’s picture

Thank you @avpaderno and all the reviewers!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.