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

Function ParseSamlSpUrl

be/src/rpc/authentication.cc:1081–1094  ·  view source on GitHub ↗

Parses and validates FLAGS_saml2_sp_callback_url. Sets saml_sp_path to the path part if successful.

Source from the content-addressed store, hash-verified

1079// Parses and validates FLAGS_saml2_sp_callback_url.
1080// Sets saml_sp_path to the path part if successful.
1081Status ParseSamlSpUrl(string* saml_sp_path) {
1082 vector<string> split =
1083 Split(FLAGS_saml2_sp_callback_url, delimiter::Limit("/", 3));
1084 if (split.size() != 4 || (split[0] != "http:" && split[0] != "https:")) {
1085 return Status(
1086 Substitute("Bad saml2_sp_callback_url: $0", FLAGS_saml2_sp_callback_url));
1087 }
1088 // The port in the url should be the same as FLAGS_hs2_http_port in general,
1089 // but this is not enforced to allow the use case when the port is mapped,
1090 // e.g. external_port->http_port. FLAGS_saml2_sp_callback_url has to contain the
1091 // external_port in this case.
1092 if (saml_sp_path != nullptr) *saml_sp_path = "/" + split[3];
1093 return Status::OK();
1094}
1095
1096namespace {
1097

Callers 2

InitMethod · 0.85

Calls 6

SplitFunction · 0.85
LimitFunction · 0.85
SubstituteFunction · 0.85
OKFunction · 0.85
StatusClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected