update altcha - #369
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades the altcha dependency from version 0.2.0 to 2.0.0 and updates the verify_solution call parameters. However, a critical issue was identified: in altcha 2.0.0, verify_solution returns a boolean instead of a tuple, which will cause a runtime TypeError during unpacking. A code suggestion has been provided to fix this by returning the result directly.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| verified, _error = altcha.verify_solution( | ||
| payload, | ||
| hmac_key=self.hmac_key, | ||
| check_expires=True, | ||
| hmac_secret=self.hmac_key, | ||
| ) | ||
| return bool(verified) |
There was a problem hiding this comment.
In altcha version 2.0.0, the verify_solution function returns a simple boolean (bool) instead of a tuple of (verified, error). Attempting to unpack the return value as verified, _error will raise a TypeError: cannot unpack non-iterable bool object at runtime. You should return the result of verify_solution directly.
| verified, _error = altcha.verify_solution( | |
| payload, | |
| hmac_key=self.hmac_key, | |
| check_expires=True, | |
| hmac_secret=self.hmac_key, | |
| ) | |
| return bool(verified) | |
| return altcha.verify_solution( | |
| payload, | |
| hmac_secret=self.hmac_key, | |
| ) |
72c8d51 to
081b7ff
Compare
No description provided.