aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/tls/authorization_mode.cpp
blob: 755f6778e43ac7f66251e3d0601b749e893795c3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "authorization_mode.h"

#include <iostream>

namespace vespalib::net::tls {

const char* enum_name(AuthorizationMode mode) noexcept {
    switch (mode) {
    case AuthorizationMode::Disable: return "Disable";
    case AuthorizationMode::LogOnly: return "LogOnly";
    case AuthorizationMode::Enforce: return "Enforce";
    }
    abort();
}

std::ostream& operator<<(std::ostream& os, AuthorizationMode mode) {
    os << enum_name(mode);
    return os;
}

}