aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-06-18 12:04:19 +0200
committerGitHub <noreply@github.com>2024-06-18 12:04:19 +0200
commit6d15171aad7457bc7a3c9cc3efc681de669275b9 (patch)
tree6d88bb39f533ca7fc94ca3d75d163b94c6c7d073
parentd52533aeee6841e90a688ed1133ba5954d0ac534 (diff)
downloadydb-6d15171aad7457bc7a3c9cc3efc681de669275b9.tar.gz
Enable YC IAM auth in YDB OSS tests (#5663)
-rw-r--r--contrib/python/ydb/py3/ydb/iam/auth.py9
-rw-r--r--ydb/tests/oss/ydb_sdk_import/ya.make1
2 files changed, 8 insertions, 2 deletions
diff --git a/contrib/python/ydb/py3/ydb/iam/auth.py b/contrib/python/ydb/py3/ydb/iam/auth.py
index 7b4fa4e8d9..dac9fb6c1c 100644
--- a/contrib/python/ydb/py3/ydb/iam/auth.py
+++ b/contrib/python/ydb/py3/ydb/iam/auth.py
@@ -16,8 +16,13 @@ try:
from yandex.cloud.iam.v1 import iam_token_service_pb2_grpc
from yandex.cloud.iam.v1 import iam_token_service_pb2
except ImportError:
- iam_token_service_pb2_grpc = None
- iam_token_service_pb2 = None
+ try:
+ # This attempt is to enable the IAM auth inside the YDB repository on GitHub
+ from ydb.public.api.client.yc_public.iam import iam_token_service_pb2_grpc
+ from ydb.public.api.client.yc_public.iam import iam_token_service_pb2
+ except ImportError:
+ iam_token_service_pb2_grpc = None
+ iam_token_service_pb2 = None
try:
import requests
diff --git a/ydb/tests/oss/ydb_sdk_import/ya.make b/ydb/tests/oss/ydb_sdk_import/ya.make
index 254ed37111..521b3867eb 100644
--- a/ydb/tests/oss/ydb_sdk_import/ya.make
+++ b/ydb/tests/oss/ydb_sdk_import/ya.make
@@ -13,6 +13,7 @@ ENDIF()
PEERDIR(
ydb/tests/oss/canonical
+ ydb/public/api/client/yc_public/iam
)
END()