| 2414 | } |
| 2415 | |
| 2416 | bool ImpalaServer::IsAuthorizedProxyUser(const string& user) { |
| 2417 | if (user.empty()) return false; |
| 2418 | |
| 2419 | // Get the short version of the user name (the user name up to the first '/' or '@') |
| 2420 | // from the full principal name. |
| 2421 | size_t end_idx = min(user.find('/'), user.find('@')); |
| 2422 | // If neither are found (or are found at the beginning of the user name), |
| 2423 | // return the username. Otherwise, return the username up to the matching character. |
| 2424 | string short_user( |
| 2425 | end_idx == string::npos || end_idx == 0 ? user : user.substr(0, end_idx)); |
| 2426 | |
| 2427 | return authorized_proxy_user_config_.find(short_user) |
| 2428 | != authorized_proxy_user_config_.end() |
| 2429 | || authorized_proxy_group_config_.find(short_user) |
| 2430 | != authorized_proxy_group_config_.end(); |
| 2431 | } |
| 2432 | |
| 2433 | void ImpalaServer::CatalogUpdateVersionInfo::UpdateCatalogVersionMetrics() { |
| 2434 | ImpaladMetrics::CATALOG_VERSION->SetValue(catalog_version); |