Conversation
Uses the target instance's own wbcheckconstraints API action (from the WikibaseQualityConstraints extension) instead of a hardcoded, Wikidata-specific rule set, so it works against any Wikibase instance with the extension installed. Closes #154 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 3-legged OAuth1 handshake (Special:OAuth/initiate, authenticate, token) is reimplemented with requests_oauthlib.OAuth1 and requests, mirroring what mwoauth did internally, removing the extra dependency. Also fixes continue_oauth(), which previously crashed with an AttributeError because mediawiki_api_url/instantiation_time were never initialized after completing the handshake. Fixes #318 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Special:OAuth/initiate→authenticate→token) directly withrequests_oauthlib.OAuth1+requests, mirroring whatmwoauthdid under the hood, so themwoauthdependency can be dropped.mwoauthfrompyproject.toml/poetry.lock.OAuth1.continue_oauth():mediawiki_api_url,instantiation_time, and the sessionUser-Agentheader were never initialized after completing the handshake, which would raiseAttributeErroron the very firstget_edit_token()call.continue_oauth()now delegates to_Login.__init__()like the owner-only flow already does.Test plan
pytest test/test_wbi_login.py— added coverage for the full 3-legged OAuth1 flow (test_three_legged_flow,test_three_legged_flow_wrong_request_token) plus existing owner-only/CSRF-error testspytest test/— full suite passes (193 passed)mypy wikibaseintegrator/wbi_login.py— no issuesisort --check-onlyon changed filesFixes #318
🤖 Generated with Claude Code