Skip to content

update altcha - #369

Merged
slashburygin merged 1 commit into
masterfrom
altcha
Jun 3, 2026
Merged

update altcha#369
slashburygin merged 1 commit into
masterfrom
altcha

Conversation

@slashburygin

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 217 to 221
verified, _error = altcha.verify_solution(
payload,
hmac_key=self.hmac_key,
check_expires=True,
hmac_secret=self.hmac_key,
)
return bool(verified)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
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,
)

@slashburygin
slashburygin force-pushed the altcha branch 6 times, most recently from 72c8d51 to 081b7ff Compare June 3, 2026 12:30
@slashburygin
slashburygin merged commit 8d21565 into master Jun 3, 2026
8 checks passed
@slashburygin
slashburygin deleted the altcha branch June 3, 2026 13:25
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

Successfully merging this pull request may close these issues.

3 participants