Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/src/main/java/tech/ydb/core/grpc/YdbHeaders.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ public class YdbHeaders {
public static final Metadata.Key<String> YDB_SERVER_HINTS =
Metadata.Key.of("x-ydb-server-hints", Metadata.ASCII_STRING_MARSHALLER);

public static final Metadata.Key<String> AUTH_TICKET =
Metadata.Key.of("x-ydb-auth-ticket", Metadata.ASCII_STRING_MARSHALLER);

private YdbHeaders() { }
}
4 changes: 4 additions & 0 deletions core/src/main/java/tech/ydb/core/impl/BaseGrpcTransport.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ private static Status deadlineExpiredStatus(MethodDescriptor<?, ?> method, GrpcR

private Metadata makeMetadataFromSettings(GrpcRequestSettings settings) {
Metadata metadata = new Metadata();
String token = getAuthCallOptions().getToken();
if (token != null) {
metadata.put(YdbHeaders.AUTH_TICKET, token);
}
if (settings.getTraceId() != null) {
metadata.put(YdbHeaders.TRACE_ID, settings.getTraceId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ public AuthCallOptions(
authIdentity = null;
}

if (authIdentity != null) {
options = options.withCallCredentials(new YdbCallCredentials(authIdentity));
}

if (builder.getCallExecutor() != null && builder.getCallExecutor() != MoreExecutors.directExecutor()) {
options = options.withExecutor(builder.getCallExecutor());
}
Expand Down Expand Up @@ -78,6 +74,7 @@ public CallOptions getGrpcCallOptions() {
if (readTimeoutMillis > 0) {
return callOptions.withDeadlineAfter(readTimeoutMillis, TimeUnit.MILLISECONDS);
}

return callOptions;
}
}
43 changes: 0 additions & 43 deletions core/src/main/java/tech/ydb/core/impl/auth/YdbCallCredentials.java

This file was deleted.