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

Method THttpServerTransportFactory

be/src/transport/THttpServer.cpp:52–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50using strings::Substitute;
51
52THttpServerTransportFactory::THttpServerTransportFactory(const std::string& server_name,
53 impala::MetricGroup* metrics, bool has_ldap, bool has_kerberos, bool use_cookies,
54 bool check_trusted_domain, bool check_trusted_auth_header, bool has_saml,
55 bool has_jwt, bool has_oauth)
56 : has_ldap_(has_ldap),
57 has_kerberos_(has_kerberos),
58 use_cookies_(use_cookies),
59 check_trusted_domain_(check_trusted_domain),
60 check_trusted_auth_header_(check_trusted_auth_header),
61 has_saml_(has_saml),
62 has_jwt_(has_jwt),
63 has_oauth_(has_oauth),
64 metrics_enabled_(metrics != nullptr) {
65 if (metrics_enabled_) {
66 if (has_ldap_) {
67 http_metrics_.total_basic_auth_success_ =
68 metrics->AddCounter(Substitute("$0.total-basic-auth-success", server_name), 0);
69 http_metrics_.total_basic_auth_failure_ =
70 metrics->AddCounter(Substitute("$0.total-basic-auth-failure", server_name), 0);
71 }
72 if (has_kerberos_) {
73 http_metrics_.total_negotiate_auth_success_ = metrics->AddCounter(
74 Substitute("$0.total-negotiate-auth-success", server_name), 0);
75 http_metrics_.total_negotiate_auth_failure_ = metrics->AddCounter(
76 Substitute("$0.total-negotiate-auth-failure", server_name), 0);
77 }
78 if (use_cookies_) {
79 http_metrics_.total_cookie_auth_success_ =
80 metrics->AddCounter(Substitute("$0.total-cookie-auth-success", server_name), 0);
81 http_metrics_.total_cookie_auth_failure_ =
82 metrics->AddCounter(Substitute("$0.total-cookie-auth-failure", server_name), 0);
83 }
84 if (check_trusted_domain_) {
85 http_metrics_.total_trusted_domain_check_success_ = metrics->AddCounter(
86 Substitute("$0.total-trusted-domain-check-success", server_name), 0);
87 }
88 if (check_trusted_auth_header_) {
89 http_metrics_.total_trusted_auth_header_check_success_ = metrics->AddCounter(
90 Substitute("$0.total-trusted-auth-header-check-success", server_name), 0);
91 }
92 if (has_saml_) {
93 http_metrics_.total_saml_auth_success_ =
94 metrics->AddCounter(Substitute("$0.total-saml-auth-success", server_name), 0);
95 http_metrics_.total_saml_auth_failure_ =
96 metrics->AddCounter(Substitute("$0.total-saml-auth-failure", server_name), 0);
97 }
98 if (has_jwt_) {
99 http_metrics_.total_jwt_token_auth_success_ = metrics->AddCounter(
100 Substitute("$0.total-jwt-token-auth-success", server_name), 0);
101 http_metrics_.total_jwt_token_auth_failure_ = metrics->AddCounter(
102 Substitute("$0.total-jwt-token-auth-failure", server_name), 0);
103 }
104 if (has_oauth_) {
105 http_metrics_.total_oauth_token_auth_success_ = metrics->AddCounter(
106 Substitute("$0.total-oauth-token-auth-success", server_name), 0);
107 http_metrics_.total_oauth_token_auth_failure_ = metrics->AddCounter(
108 Substitute("$0.total-oauth-token-auth-failure", server_name), 0);
109 }

Callers

nothing calls this directly

Calls 2

SubstituteFunction · 0.85
AddCounterMethod · 0.80

Tested by

no test coverage detected