Skip to content

Commit

Permalink
Revert "feat: Retry behavior (googleapis#1113)"
Browse files Browse the repository at this point in the history
This reverts commit 06fff40.
  • Loading branch information
BigTailWolf committed Sep 22, 2022
1 parent 06fff40 commit b4a1ae6
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 841 deletions.
111 changes: 0 additions & 111 deletions google/auth/_exponential_backoff.py

This file was deleted.

17 changes: 2 additions & 15 deletions google/auth/exceptions.py
Expand Up @@ -18,15 +18,6 @@
class GoogleAuthError(Exception):
"""Base class for all google.auth errors."""

def __init__(self, *args, **kwargs):
super(GoogleAuthError, self).__init__(*args)
retryable = kwargs.get("retryable", False)
self._retryable = retryable

@property
def retryable(self):
return self._retryable


class TransportError(GoogleAuthError):
"""Used to indicate an error occurred during an HTTP request."""
Expand All @@ -53,10 +44,6 @@ class MutualTLSChannelError(GoogleAuthError):
class ClientCertError(GoogleAuthError):
"""Used to indicate that client certificate is missing or invalid."""

@property
def retryable(self):
return False


class OAuthError(GoogleAuthError):
"""Used to indicate an error occurred during an OAuth related HTTP
Expand All @@ -66,9 +53,9 @@ class OAuthError(GoogleAuthError):
class ReauthFailError(RefreshError):
"""An exception for when reauth failed."""

def __init__(self, message=None, **kwargs):
def __init__(self, message=None):
super(ReauthFailError, self).__init__(
"Reauthentication failed. {0}".format(message), **kwargs
"Reauthentication failed. {0}".format(message)
)


Expand Down
14 changes: 1 addition & 13 deletions google/auth/transport/__init__.py
Expand Up @@ -29,21 +29,9 @@
import six
from six.moves import http_client

TOO_MANY_REQUESTS = 429 # Python 2.7 six is missing this status code.

DEFAULT_RETRYABLE_STATUS_CODES = (
http_client.INTERNAL_SERVER_ERROR,
http_client.SERVICE_UNAVAILABLE,
http_client.REQUEST_TIMEOUT,
TOO_MANY_REQUESTS,
)
"""Sequence[int]: HTTP status codes indicating a request can be retried.
"""


DEFAULT_REFRESH_STATUS_CODES = (http_client.UNAUTHORIZED,)
"""Sequence[int]: Which HTTP status code indicate that credentials should be
refreshed.
refreshed and a request should be retried.
"""

DEFAULT_MAX_REFRESH_ATTEMPTS = 2
Expand Down

0 comments on commit b4a1ae6

Please sign in to comment.