-
Notifications
You must be signed in to change notification settings - Fork 71
Add ReCaptcha coverage for Contact GraphQL (SwiftOtter's SOP-348) #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ReCaptcha coverage for Contact GraphQL (SwiftOtter's SOP-348) #335
Conversation
|
@magento run all tests |
|
@ihor-sviziev Can you take a look? |
|
Tagging @nathanjosiah, maybe he'll be able to move this PR forward |
| public function getConfigFor(EndpointInterface $endpoint): ?ValidationConfigInterface | ||
| { | ||
| if ($endpoint->getServiceMethod() === 'resolve' | ||
| && $endpoint->getServiceClass() === ContactUs::class) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see in other places we have a || here. are you sure it should be &&?
Example: https://github.com/magento/security-package/blob/develop/ReCaptchaCustomer/Model/WebapiConfigProvider.php#L65-L69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ihor-sviziev After the research, I found out that \Magento\ReCaptchaSendFriend\Model\WebapiConfigProvider::getConfigFor is the most in-line with Contact form, that's why it's && not ||
ReCaptchaContact/etc/di.xml
Outdated
| <type name="Magento\ReCaptchaWebapiApi\Model\CompositeWebapiValidationConfigProvider"> | ||
| <arguments> | ||
| <argument name="providers" xsi:type="array"> | ||
| <item name="contactUs" xsi:type="object">Magento\ReCaptchaContact\Model\WebapiConfigProvider</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not "Contact", as a module name?
| <item name="contactUs" xsi:type="object">Magento\ReCaptchaContact\Model\WebapiConfigProvider</item> | |
| <item name="contact" xsi:type="object">Magento\ReCaptchaContact\Model\WebapiConfigProvider</item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced change in the codebase.
Description (*)
According to the official documentation, Magento 2.4.7 comes without ReCaptcha coverage for Contact form GraphQL endpoint.
This Pull Requests fills this incomprehensible gap.
Fixed Issues (if relevant)
Manual testing scenarios (*)
GraphQL call to verify:
Questions or comments
Contribution checklist (*)