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

Function TrustedDomainCheck

be/src/rpc/authentication.cc:731–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

729}
730
731static bool TrustedDomainCheck(ThriftServer::ConnectionContext* connection_context,
732 const AuthenticationHash& hash, const std::string& origin,
733 const string& auth_header) {
734 if (!IsTrustedDomain(origin, FLAGS_trusted_domain,
735 FLAGS_trusted_domain_strict_localhost)) {
736 return false;
737 }
738
739 if (!GetUsernameFromBasicAuthHeader(connection_context, auth_header)) {
740 return false;
741 }
742 // Create a cookie to return.
743 connection_context->return_headers.push_back(
744 Substitute("Set-Cookie: $0",
745 GenerateCookie(connection_context->username, hash,
746 HTTP_AUTH_MECH_TRUSTED_DOMAIN)));
747 return true;
748}
749
750static bool HandleTrustedAuthHeader(ThriftServer::ConnectionContext* connection_context,
751 const AuthenticationHash& hash, const string& auth_header) {

Callers 1

BeginRequestCallbackMethod · 0.85

Calls 5

IsTrustedDomainFunction · 0.85
SubstituteFunction · 0.85
GenerateCookieFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected