Skip to content

feat: create reCAPTCHA validation utility#1204

Open
rboixaderg wants to merge 6 commits intomasterfrom
recaptcha-utility
Open

feat: create reCAPTCHA validation utility#1204
rboixaderg wants to merge 6 commits intomasterfrom
recaptcha-utility

Conversation

@rboixaderg
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors reCAPTCHA validation by converting it from a directly instantiated class to a proper utility pattern using the existing IAsyncUtility interface framework. This follows the established patterns in the codebase for utilities like cache, queue, and session management.

Key Changes

  • Created IRecaptchaValidationUtility interface extending IAsyncUtility for standardized reCAPTCHA validation
  • Refactored three endpoints (@login, @register, @info-access) to use the new utility pattern via get_utility() instead of direct instantiation
  • Added optional validation checks that gracefully handle cases where the utility is not configured

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
guillotina/interfaces/async_util.py Defines the new IRecaptchaValidationUtility interface with a validate() method
guillotina/interfaces/init.py Exports the new interface for external use
guillotina/auth/init.py Removes direct export of RecaptchaValidator class
guillotina/api/login.py Updates three endpoints to use utility pattern with optional validation via get_utility()
guillotina/_settings.py Registers the reCAPTCHA validator as a loadable utility in default settings
CHANGELOG.rst Documents the feature addition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.rst
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread guillotina/interfaces/async_util.py
Comment thread guillotina/interfaces/async_util.py
Comment thread guillotina/tests/test_recaptcha.py Outdated
Comment thread guillotina/tests/test_recaptcha.py Outdated
Comment thread guillotina/tests/test_recaptcha.py Outdated
Comment thread guillotina/tests/test_recaptcha.py Outdated
Comment thread CHANGELOG.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants