-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix/requirements/captcha and zora #619
Conversation
Reviewer's Guide by SourceryThis pull request makes minor adjustments to the Zora NFT minting constraint and the CAPTCHA verification process. The changes improve the flexibility of the DidMintZoraNFT class initialization and expand the CAPTCHA token retrieval to support multiple sources. File-Level Changes
Tips
|
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.
Hey @alimaktabi - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
@@ -60,7 +60,7 @@ def is_observed(self, *args, **kwargs) -> bool: | |||
context["request"] | |||
) | |||
|
|||
turnstile_token = request_context.data.get("cf-turnstile-response") | |||
turnstile_token = request_context.data.get("hc-turnstile-response") or request_context.data.get("cf-turnstile-response") |
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.
suggestion: Consider adding a comment explaining the reason for supporting multiple CAPTCHA providers
It would be helpful to add a brief comment explaining why both 'hc-turnstile-response' and 'cf-turnstile-response' are being checked. Additionally, consider defining these as constants to avoid string duplication and improve maintainability.
turnstile_token = request_context.data.get("hc-turnstile-response") or request_context.data.get("cf-turnstile-response") | |
HC_TURNSTILE_KEY = "hc-turnstile-response" | |
CF_TURNSTILE_KEY = "cf-turnstile-response" | |
turnstile_token = request_context.data.get(HC_TURNSTILE_KEY) or request_context.data.get(CF_TURNSTILE_KEY) |
Summary by Sourcery
Fix initialization issues in the DidMintZoraNFT class by adding an optional 'obj' parameter and correct the token retrieval logic in the captcha constraint to handle 'hc-turnstile-response' and 'cf-turnstile-response'.
Bug Fixes: