Added onetime_password to create_authorization

github.AuthenticatedUser.create_authorization has been modified to
support two-factor authentication. When two-factor authentication
is enabled create_authorization will throw an TwoFactorException.
The onetime password can be then be passed to create_authorization
on a subsequent call.
This commit is contained in:
Cameron White
2013-12-19 04:05:26 -08:00
parent 66edeb601f
commit 36352598ae
3 changed files with 19 additions and 5 deletions
+5 -1
View File
@@ -60,7 +60,6 @@ class BadCredentialsException(GithubException):
Exception raised in case of bad credentials (when Github API replies with a 401 or 403 HTML status)
"""
class UnknownObjectException(GithubException):
"""
Exception raised when a non-existing object is requested (when Github API replies with a 404 HTML status)
@@ -108,3 +107,8 @@ class BadAttributeException(Exception):
The exception raised when PyGithub tried to parse the value
"""
return self.__transformationException
class TwoFactorException(GithubException):
"""
Exception raised when Github requires a onetime password for two-factor authentication
"""