aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/vespa/vespalib/net/connection_auth_context.h
blob: f5f978da96d051fb3f2c91d40a9b1c53b3a91068 (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
24
25
26
27
28
29
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

// TODO consider moving out of tls sub-namespace
#include <vespa/vespalib/net/tls/peer_credentials.h>
#include <vespa/vespalib/net/tls/capability_set.h>

namespace vespalib::net {

class ConnectionAuthContext {
    tls::PeerCredentials _peer_credentials;
    tls::CapabilitySet   _capabilities;
public:
    ConnectionAuthContext(tls::PeerCredentials peer_credentials,
                          tls::CapabilitySet capabilities) noexcept;

    ConnectionAuthContext(const ConnectionAuthContext&);
    ConnectionAuthContext& operator=(const ConnectionAuthContext&);
    ConnectionAuthContext(ConnectionAuthContext&&) noexcept;
    ConnectionAuthContext& operator=(ConnectionAuthContext&&) noexcept;

    ~ConnectionAuthContext();

    const tls::PeerCredentials& peer_credentials() const noexcept { return _peer_credentials; }
    const tls::CapabilitySet& capabilities() const noexcept { return _capabilities; }
};

}