Page MenuHomePhabricator

Pywikibot: Handle OAuth/BotPassword errors in Superset authentication
Closed, ResolvedPublic

Description

Currently, when users attempt to authenticate to Superset using OAuth or BotPassword credentials, Pywikibot enters an HTTP redirect loop without clear error messaging. This creates a poor user experience and makes hard to understand why login fails.

Proposed Solution:
Add explicit error handling and user-friendly error messages in pywikibot.data.superset.SupersetQuery login() to detect when OAuth or BotPassword authentication is being used and inform users that these methods are not supported for Superset authentication.

Example error message:

Error: Superset authentication does not support OAuth or BotPassword. 
Please use standard username/password authentication in user-config.py:
usernames["meta"]["meta"] = "WIKIMEDIA_USERNAME"

Code Review Requirements:
For the patch to pass Pywikibot code review, please ensure:

  1. Follow Gerrit guidelines:
  2. Code quality:
  3. Patch must follow the Pywikibot style guide
  4. No flake8 errors or warnings
    • Commit message must follow style guidelines
  5. Testing:
  6. Added error handling must include unit tests
  7. Tests should verify proper error detection and messaging for OAuth/BotPassword scenarios

Event Timeline

Change #1202211 had a related patch set uploaded (by Ezra yendau; author: Ezra yendau):

[pywikibot/core@master] Fix(superset): Prevent login loop with unsupported auth methods

https://gerrit.wikimedia.org/r/1202211

Change #1202211 merged by Xqt:

[pywikibot/core@master] Fix(superset): Prevent login loop with unsupported auth methods

https://gerrit.wikimedia.org/r/1202211

Xqt claimed this task.
Xqt subscribed.

Change #1203214 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] superset: add attention admonition for account requirements

https://gerrit.wikimedia.org/r/1203214

Change #1203261 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] tests: avoid Pytest 9.0.0

https://gerrit.wikimedia.org/r/1203261

Change #1203214 merged by jenkins-bot:

[pywikibot/core@master] superset: add attention admonition for account requirements

https://gerrit.wikimedia.org/r/1203214