Skip to content

Commit fae9f5b

Browse files
feat: update CredentialProvider
1 parent 04c471f commit fae9f5b

17 files changed

+329
-294
lines changed

src/Ydb.Sdk/src/Ado/YdbConnectionStringBuilder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,14 +220,12 @@ public override object this[string keyword]
220220

221221
internal Task<Driver> BuildDriver()
222222
{
223-
var credentialsProvider = CredentialsProvider ??
224-
(User != null ? new StaticCredentialsProvider(User, Password) : null);
225223
var cert = RootCertificate != null ? X509Certificate.CreateFromCertFile(RootCertificate) : null;
226224

227225
return Driver.CreateInitialized(new DriverConfig(
228226
endpoint: Endpoint,
229227
database: Database,
230-
credentials: credentialsProvider,
228+
credentials: CredentialsProvider,
231229
customServerCertificate: cert,
232230
customServerCertificates: ServerCertificates
233231
)
@@ -237,7 +235,9 @@ internal Task<Driver> BuildDriver()
237235
: TimeSpan.FromSeconds(KeepAlivePingDelay),
238236
KeepAlivePingTimeout = KeepAlivePingTimeout == 0
239237
? Timeout.InfiniteTimeSpan
240-
: TimeSpan.FromSeconds(KeepAlivePingTimeout)
238+
: TimeSpan.FromSeconds(KeepAlivePingTimeout),
239+
User = User,
240+
Password = Password
241241
}, LoggerFactory);
242242
}
243243

src/Ydb.Sdk/src/Auth/AnonymousProvider.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
using Ydb.Sdk.Services.Auth;
2-
3-
namespace Ydb.Sdk.Auth;
1+
namespace Ydb.Sdk.Auth;
42

53
public interface ICredentialsProvider
64
{
7-
// For removal in 1.*
8-
string? GetAuthInfo();
9-
10-
ValueTask<string?> GetAuthInfoAsync() => ValueTask.FromResult(GetAuthInfo());
11-
12-
Task ProvideAuthClient(AuthClient authClient) => Task.CompletedTask;
5+
ValueTask<string> GetAuthInfoAsync();
136
}
7+
8+
public interface IAuthClient
9+
{
10+
ValueTask<TokenResponse> FetchToken();
11+
}

src/Ydb.Sdk/src/Auth/StaticCredentialsProvider.cs

Lines changed: 0 additions & 199 deletions
This file was deleted.

0 commit comments

Comments
 (0)