Skip to content
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

make v2 key and v3 key configureable / check their usage #365

Open
grosser opened this issue Aug 29, 2020 · 6 comments
Open

make v2 key and v3 key configureable / check their usage #365

grosser opened this issue Aug 29, 2020 · 6 comments

Comments

@grosser
Copy link
Collaborator

grosser commented Aug 29, 2020

see discussion in #352 and then revert it
/cc @rbarreca @SvcDptDev

@yuh-pen
Copy link
Contributor

yuh-pen commented Aug 28, 2022

@grosser
v2 and v3 have same site key formats.
But only v3 needs action. So I think it would be better to separate the 2 config keys and change verify_recaptcha method to use v3 key when it has the argument action. What do you think?

@grosser
Copy link
Collaborator Author

grosser commented Aug 28, 2022

that would force all users to update their config ?
... can we set an optional version = :v3 config and than raise when we think it's used wrong ?

@yuh-pen
Copy link
Contributor

yuh-pen commented Aug 29, 2022

I have been thinking about the following

  • Add optional v2_site_key and v3_site_key to config
  • Use v3_site_key if argument action is present, use site_key if v3_site_key is not set
  • Use v2_site_key if there is no action argument, or use the site_key if the v2_site_key is not set

But I suppose we could also do the following

  • Add optional v2_site_key and v3_site_key to config
  • Add an optional argument version (default: nil) to the verify_recaptcha method
  • Use the site_key when version = nil
  • Use the v2_site_key when version = :v2
  • Use the v3_site_key when version = :v3
  • version = :v3 raise if the v3_site_key is not set to config and not passed or the argument action is not passed

I am thinking that adding version to config may not be a good idea since v3 and v2 may both be used in the same application.

@grosser
Copy link
Collaborator Author

grosser commented Aug 30, 2022

the first option sounds like a smooth transition from the unified key
and will allow using both in the same app :)

@yuh-pen
Copy link
Contributor

yuh-pen commented Aug 30, 2022

Thank you.
I would like to implement this in the first option

Add optional v2_site_key and v3_site_key to config
Use v3_site_key if argument action is present, use site_key if v3_site_key is not set
Use v2_site_key if there is no action argument, or use the site_key if the v2_site_key is not set

@grosser
Copy link
Collaborator Author

grosser commented Aug 30, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants