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

Support for reCAPTCHA Enterprise #11

Open
mixxorz opened this issue Aug 13, 2021 · 4 comments
Open

Support for reCAPTCHA Enterprise #11

mixxorz opened this issue Aug 13, 2021 · 4 comments

Comments

@mixxorz
Copy link

mixxorz commented Aug 13, 2021

At the moment, the library only supports reCAPTCHA v2 and v3. It would be great if this library also supported reCAPTCHA Enterprise.

@llybin
Copy link
Owner

llybin commented Aug 13, 2021

Attach the manual please, PR welcome also ;)

@mixxorz
Copy link
Author

mixxorz commented Aug 13, 2021

Here is the the REST API documentation

I need this for a project I'm working on now. I will try and see if I can build this in a way that can be backported to drf-recaptcha then open a PR. 😄

@mixxorz
Copy link
Author

mixxorz commented Aug 13, 2021

It's looking like I will need to use Google's official client library python-recaptcha-enterprise which is a completely different way of interacting with the Google Cloud APIs from what's currently in drf-recaptcha.

The annoying thing about it (aside from requiring another library) is that it requires a Google service account to use. The credentials used for service accounts are in JSON format. It's not just an API key.

It also communicates via an RPC and not through a JSON API.

@llybin
Copy link
Owner

llybin commented Aug 13, 2021

They are have REST also, https://cloud.google.com/recaptcha-enterprise/docs/reference/rest
Choose the simpliest way for your project ;) I'm not sure that we need additional depends in drf-recaptcha, but it's also possibe, if using their library will much better instead REST. But I'm not sure :)
Just create new Field class here https://github.com/llybin/drf-recaptcha/blob/master/drf_recaptcha/fields.py#L62 and write validator using their library I think it's will quicklier for u. And can to add tests, next we can rewrite it on using rest api for example.
If to use REST I think will need to write similar client https://github.com/llybin/drf-recaptcha/blob/master/drf_recaptcha/client.py because interfaces are diffrent.
Yes look like usage not similar with not enterprise captcha, so will need to create a special credentionals settings for enterpise.

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

No branches or pull requests

2 participants