PR changed-lines coverage: 60.55% (66/109, 0 noise lines excluded) Uncovered changed code (with context): ================================================================================ src/Databases/DataLake/RestCatalog.cpp ================================================================================ --- uncovered block 1121-1128 --- 1119 | auto storage_type = parseStorageTypeFromLocation(location); 1120 | switch (storage_type) >> 1121 | { >> 1122 | case StorageType::S3: >> 1123 | { >> 1124 | static constexpr auto gcs_token_str = "gcs.oauth2.token"; >> 1125 | static constexpr auto access_key_id_str = "s3.access-key-id"; >> 1126 | static constexpr auto secret_access_key_str = "s3.secret-access-key"; >> 1127 | static constexpr auto session_token_str = "s3.session-token"; >> 1128 | static constexpr auto storage_endpoint_str = "s3.endpoint"; 1129 | 1130 | if (object->has(gcs_token_str)) --- uncovered block 1130-1135 --- 1128 | static constexpr auto storage_endpoint_str = "s3.endpoint"; 1129 | >> 1130 | if (object->has(gcs_token_str)) >> 1131 | { >> 1132 | auto gcs_token = object->get(gcs_token_str).extract(); >> 1133 | LOG_DEBUG(log, "Using GCS OAuth2 token for location {}", location); >> 1134 | return {std::make_shared(gcs_token), ""}; >> 1135 | } 1136 | 1137 | std::string access_key_id; --- uncovered block 1137-1139 --- 1135 | } 1136 | >> 1137 | std::string access_key_id; >> 1138 | std::string secret_access_key; >> 1139 | std::string session_token; 1140 | std::string storage_endpoint; 1141 | if (object->has(access_key_id_str)) ================================================================================ src/Disks/DiskObjectStorage/ObjectStorages/S3/diskSettings.cpp ================================================================================ --- uncovered block 219-224 --- 217 | 218 | if (refresh_credentials_callback) >> 219 | { >> 220 | auto updated_credentials = (*refresh_credentials_callback)(); >> 221 | if (updated_credentials) >> 222 | { >> 223 | if (auto gcs_creds = std::dynamic_pointer_cast(updated_credentials)) >> 224 | { 225 | /// GCS Bearer token: replace the Authorization header with the refreshed token. 226 | /// no_sign_request is already set from the initial configuration. --- uncovered block 227-246 --- 225 | /// GCS Bearer token: replace the Authorization header with the refreshed token. 226 | /// no_sign_request is already set from the initial configuration. >> 227 | headers.erase( >> 228 | std::remove_if(headers.begin(), headers.end(), [](const auto & h) { return h.name == "Authorization"; }), >> 229 | headers.end()); >> 230 | headers.push_back({"Authorization", "Bearer " + gcs_creds->getToken()}); >> 231 | } >> 232 | else if (auto s3_creds = std::dynamic_pointer_cast(updated_credentials)) >> 233 | { >> 234 | access_key_id = s3_creds->getAccessKeyId(); >> 235 | secret_access_key = s3_creds->getSecretAccessKey(); >> 236 | session_token = s3_creds->getSessionToken(); >> 237 | LOG_DEBUG(getLogger("getClient"), "Got new S3 access tokens"); >> 238 | } >> 239 | else >> 240 | { >> 241 | throw DB::Exception( >> 242 | DB::ErrorCodes::BAD_ARGUMENTS, >> 243 | "Unexpected credentials type for S3 storage"); >> 244 | } >> 245 | } >> 246 | } 247 | context->getHTTPHeaderFilter().checkAndNormalizeHeaders(headers); 248 | WARNING: Failed to get start time for [Print Uncovered Code] - start time and duration won't be set