/root/doris/common/cpp/aws_common.cpp
| Line | Count | Source (jump to first uncovered line) | 
| 1 |  | // Licensed to the Apache Software Foundation (ASF) under one | 
| 2 |  | // or more contributor license agreements.  See the NOTICE file | 
| 3 |  | // distributed with this work for additional information | 
| 4 |  | // regarding copyright ownership.  The ASF licenses this file | 
| 5 |  | // to you under the Apache License, Version 2.0 (the | 
| 6 |  | // "License"); you may not use this file except in compliance | 
| 7 |  | // with the License.  You may obtain a copy of the License at | 
| 8 |  | // | 
| 9 |  | //   http://www.apache.org/licenses/LICENSE-2.0 | 
| 10 |  | // | 
| 11 |  | // Unless required by applicable law or agreed to in writing, | 
| 12 |  | // software distributed under the License is distributed on an | 
| 13 |  | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
| 14 |  | // KIND, either express or implied.  See the License for the | 
| 15 |  | // specific language governing permissions and limitations | 
| 16 |  | // under the License. | 
| 17 |  |  | 
| 18 |  | #include "aws_common.h" | 
| 19 |  |  | 
| 20 |  | #include <glog/logging.h> | 
| 21 |  |  | 
| 22 |  | namespace doris { | 
| 23 |  |  | 
| 24 | 0 | CredProviderType cred_provider_type_from_pb(cloud::CredProviderTypePB cred_provider_type) { | 
| 25 | 0 |     switch (cred_provider_type) { | 
| 26 | 0 |     case cloud::CredProviderTypePB::DEFAULT:   Branch (26:5): [True: 0, False: 0]
 | 
| 27 | 0 |         return CredProviderType::Default; | 
| 28 | 0 |     case cloud::CredProviderTypePB::SIMPLE:   Branch (28:5): [True: 0, False: 0]
 | 
| 29 | 0 |         return CredProviderType::Simple; | 
| 30 | 0 |     case cloud::CredProviderTypePB::INSTANCE_PROFILE:   Branch (30:5): [True: 0, False: 0]
 | 
| 31 | 0 |         return CredProviderType::InstanceProfile; | 
| 32 | 0 |     default:   Branch (32:5): [True: 0, False: 0]
 | 
| 33 | 0 |         __builtin_unreachable(); | 
| 34 | 0 |         LOG(WARNING) << "Invalid CredProviderTypePB value: " << cred_provider_type | 
| 35 | 0 |                      << ", use default instead."; | 
| 36 | 0 |         return CredProviderType::Default; | 
| 37 | 0 |     } | 
| 38 | 0 | } | 
| 39 |  |  | 
| 40 | 2 | std::string get_valid_ca_cert_path(const std::vector<std::string>& ca_cert_file_paths) { | 
| 41 | 2 |     for (const auto& path : ca_cert_file_paths) {  Branch (41:27): [True: 2, False: 0]
 | 
| 42 | 2 |         if (std::filesystem::exists(path)) {  Branch (42:13): [True: 2, False: 0]
 | 
| 43 | 2 |             return path; | 
| 44 | 2 |         } | 
| 45 | 2 |     } | 
| 46 | 0 |     return ""; | 
| 47 | 2 | } | 
| 48 |  | } |