mirror of
https://github.com/kennethreitz/python-github3.git
synced 2026-06-05 23:10:17 +00:00
basic auth -- that was easy :)
This commit is contained in:
+6
-1
@@ -22,9 +22,14 @@ def no_auth():
|
||||
return gh
|
||||
|
||||
|
||||
def basic_auth():
|
||||
def basic_auth(username, password):
|
||||
"""Returns an authenticated Github object, via HTTP Basic."""
|
||||
|
||||
def enable_auth(*args, **kwargs):
|
||||
kwargs['auth'] = (username, password)
|
||||
return args, kwargs
|
||||
|
||||
gh = Github()
|
||||
gh._requests_pre_hook = enable_auth
|
||||
|
||||
return gh
|
||||
Reference in New Issue
Block a user