mediawiki icon indicating copy to clipboard operation
mediawiki copied to clipboard

Add support for HTTP authentication

Open gbenson opened this issue 5 months ago • 1 comments

This pull request adds support for HTTP authentication, by adding an http_auth argument and property to MediaWiki. Whatever you pass/set as http_auth gets passed to Requests as an auth parameter, so you can do any of these:

from requests.auth import HTTPBasicAuth
wiki = MediaWiki(..., http_auth=HTTPBasicAuth("username", "Pa5sW0rD"))

or:

wiki = MediaWiki(..., http_auth=("username", "Pa5sW0rD"))  # shortcut for basic auth

or:

from requests.auth import HTTPDigestAuth
wiki = MediaWiki(...)
wiki.http_auth=HTTPDigestAuth("username", "Pa5sW0rD")

gbenson avatar Sep 05 '24 10:09 gbenson