Rename transport service method to clarify a user is always used, but

not necessarily the system user

Original commit: elastic/x-pack-elasticsearch@0357d3718d
This commit is contained in:
Ryan Ernst 2016-08-18 08:03:31 -07:00
parent 49ac29f2e3
commit 9da4d827c1
1 changed files with 4 additions and 4 deletions

View File

@ -73,15 +73,15 @@ public class SecurityServerTransportService extends TransportService {
if (AuthorizationUtils.shouldReplaceUserWithSystem(threadPool.getThreadContext(), action)) {
try (ThreadContext.StoredContext ctx = threadPool.getThreadContext().stashContext()) {
final ThreadContext.StoredContext original = threadPool.getThreadContext().newStoredContext();
sendWithSystemUser(node, action, request, options, new ContextRestoreResponseHandler<>(original, handler));
sendWithUser(node, action, request, options, new ContextRestoreResponseHandler<>(original, handler));
}
} else {
sendWithSystemUser(node, action, request, options, handler);
sendWithUser(node, action, request, options, handler);
}
}
private <T extends TransportResponse> void sendWithSystemUser(DiscoveryNode node, String action, TransportRequest request,
TransportRequestOptions options, TransportResponseHandler<T> handler) {
private <T extends TransportResponse> void sendWithUser(DiscoveryNode node, String action, TransportRequest request,
TransportRequestOptions options, TransportResponseHandler<T> handler) {
try {
// this will check if there's a user associated with the request. If there isn't,
// the system user will be attached. There cannot be a request outgoing from this