Coverage Report

Created: 2025-05-09 19:27

/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:
27
0
        return CredProviderType::Default;
28
0
    case cloud::CredProviderTypePB::SIMPLE:
29
0
        return CredProviderType::Simple;
30
0
    case cloud::CredProviderTypePB::INSTANCE_PROFILE:
31
0
        return CredProviderType::InstanceProfile;
32
0
    default:
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
}