Fix OAuth2 credentials to inherit from ReadOnlyScoped instead of Scoped. (#200)
* Fix OAuth2 credentials to inherit from ReadOnlyScoped instead of Scoped.
* Remove unused pytest
diff --git a/google/oauth2/credentials.py b/google/oauth2/credentials.py
index 6a635dd..f1df887 100644
--- a/google/oauth2/credentials.py
+++ b/google/oauth2/credentials.py
@@ -36,7 +36,7 @@
from google.oauth2 import _client
-class Credentials(credentials.Scoped, credentials.Credentials):
+class Credentials(credentials.ReadOnlyScoped, credentials.Credentials):
"""Credentials using OAuth 2.0 access and refresh tokens."""
def __init__(self, token, refresh_token=None, id_token=None,
@@ -109,15 +109,6 @@
the initial token is requested and can not be changed."""
return False
- def with_scopes(self, scopes):
- """Unavailable, OAuth 2.0 credentials can not be re-scoped.
-
- OAuth 2.0 credentials have their scopes set when the initial token is
- requested and can not be changed.
- """
- raise NotImplementedError(
- 'OAuth 2.0 Credentials can not modify their scopes.')
-
@_helpers.copy_docstring(credentials.Credentials)
def refresh(self, request):
access_token, refresh_token, expiry, grant_response = (