Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 1fcfd71

Browse files
fix: fix downscoped
1 parent 3230103 commit 1fcfd71

2 files changed

Lines changed: 11 additions & 25 deletions

File tree

google/auth/downscoped.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
import datetime
5252

53+
import six
54+
5355
from google.auth import _helpers
5456
from google.auth import credentials
5557
from google.oauth2 import sts
@@ -221,7 +223,7 @@ def available_resource(self, value):
221223
Raises:
222224
TypeError: If the value is not a string.
223225
"""
224-
if not isinstance(value, str):
226+
if not isinstance(value, six.string_types):
225227
raise TypeError("The provided available_resource is not a string.")
226228
self._available_resource = value
227229

@@ -247,7 +249,7 @@ def available_permissions(self, value):
247249
ValueError: If the value is not valid.
248250
"""
249251
for available_permission in value:
250-
if not isinstance(available_permission, str):
252+
if not isinstance(available_permission, six.string_types):
251253
raise TypeError(
252254
"Provided available_permissions are not a list of strings."
253255
)
@@ -350,7 +352,7 @@ def expression(self, value):
350352
Raises:
351353
TypeError: If the value is not of type string.
352354
"""
353-
if not isinstance(value, str):
355+
if not isinstance(value, six.string_types):
354356
raise TypeError("The provided expression is not a string.")
355357
self._expression = value
356358

@@ -373,7 +375,7 @@ def title(self, value):
373375
Raises:
374376
TypeError: If the value is not of type string or None.
375377
"""
376-
if not isinstance(value, str) and value is not None:
378+
if not isinstance(value, six.string_types) and value is not None:
377379
raise TypeError("The provided title is not a string or None.")
378380
self._title = value
379381

@@ -396,7 +398,7 @@ def description(self, value):
396398
Raises:
397399
TypeError: If the value is not of type string or None.
398400
"""
399-
if not isinstance(value, str) and value is not None:
401+
if not isinstance(value, six.string_types) and value is not None:
400402
raise TypeError("The provided description is not a string or None.")
401403
self._description = value
402404

system_tests/noxfile.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,8 @@ def mtls_http(session):
383383
def external_accounts(session):
384384
session.install(
385385
*TEST_DEPENDENCIES_SYNC,
386-
"google-auth",
386+
LIBRARY_DIR,
387387
"google-api-python-client",
388-
"enum34",
389388
)
390389
default(
391390
session,
@@ -394,26 +393,11 @@ def external_accounts(session):
394393
)
395394

396395

397-
@nox.session(python=["2.7"])
398-
def downscoping_27(session):
399-
session.install(
400-
*TEST_DEPENDENCIES_SYNC,
401-
"enum34",
402-
"google-auth",
403-
"google-cloud-storage",
404-
)
405-
default(
406-
session,
407-
"system_tests_sync/test_downscoping.py",
408-
*session.posargs,
409-
)
410-
411-
412-
@nox.session(python=["3.7"])
413-
def downscoping_37(session):
396+
@nox.session(python=PYTHON_VERSIONS_SYNC)
397+
def downscoping(session):
414398
session.install(
415399
*TEST_DEPENDENCIES_SYNC,
416-
"google-auth",
400+
LIBRARY_DIR,
417401
"google-cloud-storage",
418402
)
419403
default(

0 commit comments

Comments
 (0)