X-Git-Url: https://projects.mako.cc/source/twitter-api-cdsw/blobdiff_plain/043b63c67557591f1e85b53d17fc8a1a797f48ca..HEAD:/oauthlib/oauth2/rfc6749/errors.py diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py index a21d0bd..88f5375 100644 --- a/oauthlib/oauth2/rfc6749/errors.py +++ b/oauthlib/oauth2/rfc6749/errors.py @@ -3,7 +3,7 @@ oauthlib.oauth2.rfc6749.errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Error used both by OAuth 2 clients and provicers to represent the spec +Error used both by OAuth 2 clients and providers to represent the spec defined error responses for all four core grant types. """ from __future__ import unicode_literals @@ -122,24 +122,32 @@ class FatalClientError(OAuth2Error): pass -class InvalidRedirectURIError(FatalClientError): - error = 'invalid_redirect_uri' +class InvalidRequestFatalError(FatalClientError): + """For fatal errors, the request is missing a required parameter, includes + an invalid parameter value, includes a parameter more than once, or is + otherwise malformed. + """ + error = 'invalid_request' + +class InvalidRedirectURIError(InvalidRequestFatalError): + description = 'Invalid redirect URI.' -class MissingRedirectURIError(FatalClientError): - error = 'missing_redirect_uri' +class MissingRedirectURIError(InvalidRequestFatalError): + description = 'Missing redirect URI.' -class MismatchingRedirectURIError(FatalClientError): - error = 'mismatching_redirect_uri' +class MismatchingRedirectURIError(InvalidRequestFatalError): + description = 'Mismatching redirect URI.' -class MissingClientIdError(FatalClientError): - error = 'invalid_client_id' +class InvalidClientIdError(InvalidRequestFatalError): + description = 'Invalid client_id parameter value.' -class InvalidClientIdError(FatalClientError): - error = 'invalid_client_id' + +class MissingClientIdError(InvalidRequestFatalError): + description = 'Missing client_id parameter.' class InvalidRequestError(OAuth2Error): @@ -151,6 +159,10 @@ class InvalidRequestError(OAuth2Error): error = 'invalid_request' +class MissingResponseTypeError(InvalidRequestError): + description = 'Missing response_type parameter.' + + class AccessDeniedError(OAuth2Error): """The resource owner or authorization server denied the request."""