com.yandex.ydb.core.grpc.YdbCallCredentials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
Show all versions of ydb-sdk-jdbc-uberjar Show documentation
JDBC client implementation over Table client, single jar
package com.yandex.ydb.core.grpc;
import java.util.concurrent.Executor;
import com.yandex.ydb.core.auth.AuthProvider;
import io.grpc.CallCredentials;
import io.grpc.Metadata;
/**
* @author Sergey Polovko
*/
public class YdbCallCredentials extends CallCredentials {
private final AuthProvider authProvider;
public YdbCallCredentials(AuthProvider authProvider) {
this.authProvider = authProvider;
}
@Override
public void applyRequestMetadata(
RequestInfo requestInfo,
Executor appExecutor,
MetadataApplier applier)
{
Metadata headers = new Metadata();
headers.put(YdbHeaders.AUTH_TICKET, authProvider.getToken());
applier.apply(headers);
}
@Override
public void thisUsesUnstableApi() {
}
}