Closed (fixed)
Project:
reCAPTCHA v3
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2019 at 09:59 UTC
Updated:
7 Jan 2020 at 16:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dench0I'm don't know. If someone does not do it before, then I'm planing to do 8 version at the next month.
Comment #3
finex commentedIt should be very useful because reCaptha v2 is almost unusable, a lot of spambot are able to solve it :-(
Comment #4
majid.ali commentedI have ported this module to D8, can you please make me co maintainer of this module so i can push the code.
Comment #5
breidert commented+1
It would be great to see the ported version of the module in this namespace.
Comment #6
b-prod commentedMaintainers, could it be possible to create a D8 branch, so we could provide patches against it?
A simple empty README file would be enough :-)
@majid.ali already made a port for D8, it would be great that he could provide a patch on such D8 branch, so we can go on.
It would be great to use this existing project, instead of creating a new project apart...
@majid.ali Could you please create an issue for becoming a project maintainer, as stated in the Drupal documentation:
https://www.drupal.org/node/251466#procedure---own-project
Comment #7
majid.ali commentedThanks @b-prod i have created an issue to to be co maintainer as stated in the Drupal documentation. https://www.drupal.org/project/recaptcha_v3/issues/3094424
I would be happy to use this existing namespace rather creating a new one.
Comment #8
b-prod commented@majid.ali great, I also created such a request: https://www.drupal.org/project/recaptcha_v3/issues/3094620
Comment #9
b-prod commentedAnd a request to the d.org project ownership queue, hoping they could create the D8 branch do unblock us : https://www.drupal.org/project/projectownership/issues/3094622
Comment #10
b-prod commented@majid.ali I created the new D8 branch: https://www.drupal.org/project/recaptcha_v3/releases/8.x-1.x-dev
So you can now provide a patch with your code for review here.
You are also now a co-maintainer of this module, so we can go further now.
Comment #11
dench0@majid.ali, B-Prod I attached archive with my code for poring this module to d8. I'm not remembering at which phase I stopped, because this code was written like 5-6 month ago. Maybe you would find something useful.
Comment #12
b-prod commented@dench0 Thank you for the source code!
@majid.ali Should I use the @dench0 code or wait for yours?
Comment #14
b-prod commentedComment #15
b-prod commented@dench0 your code has been integrated and adapted, we will perform tests and reviews next week, thanks again for your contribution!
Comment #16
majid.ali commented@drench0 @b-prod I have merged code from my module and created a patch. Its working with latest captcha /8.x-1.0-beta4 and reCaptcha 8.x-2.4 please review it.
Comment #18
dench0Here the new patch.
Short list of changes from the last commit:
1. Removed directory "src/Entity/Controller". @majid.ali why you are moved list builder there?
2. Modified and moved Entity interface to the
Drupal\recaptcha_v3namespace3. Removed methods not related to the entity from
ReCaptchaV3Actionentity (token verification and creating empty action).4. Updated
ReCaptchaV3Actionentity definition (replace route_provider class and remove local_task_provider - previously used classes from contrib moduleentity).5. Added function for recaptcha token verification to the
recaptcha_v3.modulefile.@majid.ali question about this line:
in
recaptcha_v3_pre_captcha_element_processfunction.I'm not understood for which purposes this line added?
Comment #19
majid.ali commented@dench0 According to the documentation https://www.drupal.org/docs/8/api/entity-api/creating-a-content-entity-t... list builder is in "src/Entity/Controller"
$form_state->setRebuild(TRUE); can be removed.
Comment #20
dench0@majid.ali
1. In our module we have config entity, not content entity.
2. I'm thinking in that API documentation page confused different things. Exist two classes related to the entity list building:
EntityListControllerandEntityListBuilder. I'm thinking from the names of these two classes you can understand purposes of the each one. Then you can check core moduleblock, which using exactly that 2 classes: first one in the namespaceDrupal\block\Controller(not inDrupal\block\Entity\Controller) and second -Drupal\block3. I never saw before using of that strange namespace: neither in core nor in contributed modules (except captcha).
Comment #22
majid.ali commented@dench0 I was doing testing and found two issues, first one is more critical.
On line 208 of module file we are setting response in $form_state
$form_state->set('recaptcha_v3', $verification_response);$form_state dose not retain this value after validation function. Therefore on a fallback challenge when you submit the form again it again sets recaptcha_v3 validation
And fallback challenge fails. I am struggling to find a solution. I am not sure if its right to put the response in session with captcha sid and not to use $form_state for that?
Second issue is if you enable recaptcha module and use it as fallback challenge then we get into trouble of different "google/recaptcha" library version. We are using the latest one and recpatcha has an old one which has a different structure. Should we use the same version of create a patch for recaptcha ?
Comment #24
dench0I pushed code with some changes, sorry that I done this without any discussion - I'm thinking in this stage it not big deal, because module does not have even alpha release.
You can check current solution to force form state caching starting from this line https://git.drupalcode.org/project/recaptcha_v3/commit/1996cfe#d011fd961... (line 209). There in comment you can see my concern about it.
Right now I don't know if this solution is bullet proof and will it correct for all cases. Maybe better in this function recaptcha_v3_pre_captcha_element_process on input processing add extra form element with captcha response.
Comment #25
dench0So now need to check current form state caching solution.
Also need to write some js code for repeating token request after some time interval (it seems like after 2 minutes captcha response became outdated and token validation failed).
Comment #26
majid.ali commentedComment #27
majid.ali commented