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

Function HttpPathFn

be/src/rpc/authentication.cc:988–1005  ·  view source on GitHub ↗

Takes the path component of an HTTP request and parses it. The followings are inspected in the path: - the 'doAs' parameter if it exists - if SAML auth is enabled then the path is checked whether it matches the SP callback URL, if yes, then the whole body has to be read for, authentication purposes, not just the headers

Source from the content-addressed store, hash-verified

986// the SP callback URL, if yes, then the whole body has to be read for,
987// authentication purposes, not just the headers
988bool HttpPathFn(ThriftServer::ConnectionContext* connection_context,
989 const string& saml_path, const string& path, string* err_msg,
990 bool* read_whole_body) {
991 TWrappedHttpRequest* request = connection_context->request.get();
992 // 'path' should be of the form '/.*[?<key=value>[&<key=value>...]]'
993 vector<string> split = Split(path, delimiter::Limit("?", 1));
994 bool is_saml_response = !saml_path.empty() && split[0] == saml_path;
995 *read_whole_body = is_saml_response;
996
997 if (request) request->path = split[0];
998
999 if (split.size() != 2) return true;
1000
1001 std::map<string, string*> params_to_check;
1002 params_to_check["doAs"] = &connection_context->do_as_user;
1003
1004 return ParseParams(params_to_check, path, split[1], err_msg);
1005}
1006
1007TWrappedHttpResponse* GetSaml2Redirect(
1008 ThriftServer::ConnectionContext* connection_context) {

Callers

nothing calls this directly

Calls 6

SplitFunction · 0.85
LimitFunction · 0.85
ParseParamsFunction · 0.85
getMethod · 0.65
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected