File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -134,14 +134,23 @@ def prepare_credentials(
134
134
135
135
if isinstance (credentials , dict ):
136
136
credentials = credentials or {}
137
+
138
+ username = credentials .get ("username" )
139
+ if username :
140
+ password = credentials .get ("password" )
141
+ return ydb .StaticCredentials .from_user_password (
142
+ username ,
143
+ password ,
144
+ )
145
+
137
146
token = credentials .get ("token" )
138
147
if token :
139
148
return ydb .AccessTokenCredentials (token )
140
149
141
150
service_account_json = credentials .get ("service_account_json" )
142
151
if service_account_json :
143
152
return ydb .iam .ServiceAccountCredentials .from_content (
144
- json .dumps (service_account_json )
153
+ json .dumps (service_account_json ),
145
154
)
146
155
147
156
return ydb .AnonymousCredentials ()
You can’t perform that action at this time.
0 commit comments