17#ifndef ZMQPP_AUTH_HPP_
18#define ZMQPP_AUTH_HPP_
22#include <unordered_set>
23#include <unordered_map>
33#if (ZMQ_VERSION_MAJOR > 3)
71 void allow(
const std::string &address);
80 void deny(
const std::string &address);
92 void configure_plain(
const std::string &username,
const std::string &password);
160# if defined(ZMQPP_NO_CONSTEXPR)
163 constexpr static const char *
const zap_endpoint_ =
"inproc://zeromq.zap.01";
auth - authentication for ZeroMQ security mechanisms
Definition auth.hpp:47
bool authenticate_gssapi(zap_request &request)
Handle a GSSAPI authentication request from libzmq core.
Definition auth.cpp:299
auth(auth const &) ZMQPP_EXPLICITLY_DELETED
void configure_domain(const std::string &domain)
Configure a ZAP domain.
Definition auth.cpp:95
std::string domain
Definition auth.hpp:155
std::unordered_set< std::string > whitelist
Definition auth.hpp:151
std::shared_ptr< actor > authenticator
Definition auth.hpp:149
bool authenticate_curve(zap_request &request, std::string &user_id)
Handle a CURVE authentication request from libzmq core.
Definition auth.cpp:273
auth & operator=(auth const &) NOEXCEPT ZMQPP_EXPLICITLY_DELETED
auth(context &ctx)
Constructor.
Definition auth.cpp:35
void configure_plain(const std::string &username, const std::string &password)
Configure PLAIN authentication.
Definition auth.cpp:103
std::unordered_set< std::string > blacklist
Definition auth.hpp:152
std::unordered_map< std::string, std::string > passwords
Definition auth.hpp:153
void configure_curve(const std::string &client_public_key)
Configure CURVE authentication.
Definition auth.cpp:117
void set_verbose(bool verbose)
Enable verbose tracing of commands and activity.
Definition auth.cpp:142
bool curve_allow_any
Definition auth.hpp:156
std::unordered_set< std::string > client_keys
Definition auth.hpp:154
void allow(const std::string &address)
Allow (whitelist) a single IP address.
Definition auth.cpp:81
void deny(const std::string &address)
Deny (blacklist) a single IP address.
Definition auth.cpp:88
static constexpr const char *const zap_endpoint_
Definition auth.hpp:163
bool verbose
Definition auth.hpp:158
bool terminated
Definition auth.hpp:157
void configure_gssapi()
Configure GSSAPI authentication.
Definition auth.cpp:130
void handle_command(socket &pipe)
Handle an authentication command from calling application.
Definition auth.cpp:155
poller auth_poller
Definition auth.hpp:150
void authenticate(socket &sock)
Authentication.
Definition auth.cpp:307
bool authenticate_plain(zap_request &request, std::string &user_id)
Handle a PLAIN authentication request from libzmq core.
Definition auth.cpp:253
~auth()
Destructor.
Definition auth.cpp:74
The context class represents internal zmq context and io threads.
Definition context.hpp:47
Polling wrapper.
Definition poller.hpp:37
The socket class represents the zmq sockets.
Definition socket.hpp:76
A class for working with ZAP requests and replies.
Definition zap_request.hpp:35
#define NOEXCEPT
Definition compatibility.hpp:122
#define ZMQPP_EXPLICITLY_DELETED
Definition compatibility.hpp:107
C++ wrapper around zmq.
Definition actor.cpp:30