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";
std::shared_ptr< actor > authenticator
Definition: auth.hpp:149
void allow(const std::string &address)
Allow (whitelist) a single IP address.
Definition: auth.cpp:81
A class for working with ZAP requests and replies.
Definition: zap_request.hpp:33
bool terminated
Definition: auth.hpp:157
#define ZMQPP_EXPLICITLY_DELETED
Definition: compatibility.hpp:100
C++ wrapper around zmq.
Definition: actor.cpp:29
std::unordered_map< std::string, std::string > passwords
Definition: auth.hpp:153
void configure_gssapi()
Configure GSSAPI authentication.
Definition: auth.cpp:130
bool authenticate_plain(zap_request &request, std::string &user_id)
Handle a PLAIN authentication request from libzmq core.
Definition: auth.cpp:253
bool verbose
Definition: auth.hpp:158
The socket class represents the zmq sockets.
Definition: socket.hpp:75
std::unordered_set< std::string > whitelist
Definition: auth.hpp:151
std::string domain
Definition: auth.hpp:155
bool authenticate_gssapi(zap_request &request)
Handle a GSSAPI authentication request from libzmq core.
Definition: auth.cpp:299
poller auth_poller
Definition: auth.hpp:150
bool authenticate_curve(zap_request &request, std::string &user_id)
Handle a CURVE authentication request from libzmq core.
Definition: auth.cpp:273
#define NOEXCEPT
Definition: compatibility.hpp:104
auth - authentication for ZeroMQ security mechanisms
Definition: auth.hpp:46
std::unordered_set< std::string > client_keys
Definition: auth.hpp:154
void set_verbose(bool verbose)
Enable verbose tracing of commands and activity.
Definition: auth.cpp:142
void configure_domain(const std::string &domain)
Configure a ZAP domain.
Definition: auth.cpp:95
void configure_plain(const std::string &username, const std::string &password)
Configure PLAIN authentication.
Definition: auth.cpp:103
void configure_curve(const std::string &client_public_key)
Configure CURVE authentication.
Definition: auth.cpp:117
std::unordered_set< std::string > blacklist
Definition: auth.hpp:152
The context class represents internal zmq context and io threads.
Definition: context.hpp:46
static constexpr const char *const zap_endpoint_
Definition: auth.hpp:163
auth(context &ctx)
Constructor.
Definition: auth.cpp:35
void handle_command(socket &pipe)
Handle an authentication command from calling application.
Definition: auth.cpp:155
bool curve_allow_any
Definition: auth.hpp:156
void deny(const std::string &address)
Deny (blacklist) a single IP address.
Definition: auth.cpp:88
Polling wrapper.
Definition: poller.hpp:36
~auth()
Destructor.
Definition: auth.cpp:74
void authenticate(socket &sock)
Authentication.
Definition: auth.cpp:307