MCPcopy Create free account
hub / github.com/apache/impala / CookieAuth

Function CookieAuth

be/src/rpc/authentication.cc:665–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

663}
664
665bool CookieAuth(ThriftServer::ConnectionContext* connection_context,
666 const AuthenticationHash& hash, const std::string& cookie_header) {
667 string username;
668 string authMech;
669 Status cookie_status = AuthenticateCookie(hash, cookie_header, &username, &authMech);
670 if (cookie_status.ok()) {
671 connection_context->username = username;
672 if (authMech == HTTP_AUTH_MECH_SPNEGO) {
673 connection_context->kerberos_user_principal = username;
674 connection_context->kerberos_user_short =
675 GetShortUsernameFromKerberosPrincipal(username);
676 VLOG(2) << "Connection authenticated with "
677 << "short username \"" << connection_context->kerberos_user_short << "\" "
678 << "parsed from principal \"" << username << "\" ";
679 }
680 return true;
681 }
682
683 LOG(INFO) << "Invalid cookie provided: " << cookie_header
684 << " from: " << TNetworkAddressToString(connection_context->network_address)
685 << ": " << cookie_status.GetDetail();
686 connection_context->return_headers.push_back(
687 Substitute("Set-Cookie: $0", GetDeleteCookie()));
688 return false;
689}
690
691static bool GetUsernameFromBasicAuthHeader(
692 ThriftServer::ConnectionContext* connection_context, string auth_header) {

Callers

nothing calls this directly

Calls 8

AuthenticateCookieFunction · 0.85
TNetworkAddressToStringFunction · 0.85
SubstituteFunction · 0.85
GetDeleteCookieFunction · 0.85
GetDetailMethod · 0.80
push_backMethod · 0.80
okMethod · 0.45

Tested by

no test coverage detected