zmqpp  4.1.2
C++ bindings for 0mq (libzmq)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
zap_request.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * This file is part of zmqpp.
7  * Copyright (c) 2011-2015 Contributors as noted in the AUTHORS file.
8  */
9 
17 #ifndef ZMQPP_ZAP_REQUEST_HPP_
18 #define ZMQPP_ZAP_REQUEST_HPP_
19 
20 #include <string>
21 #include "socket.hpp"
22 
23 #if (ZMQ_VERSION_MAJOR > 3)
24 
25 namespace zmqpp
26 {
27 
33 class zap_request {
34 public:
38  zap_request(socket& handler, bool logging);
39 
43  void reply(const std::string &status_code, const std::string &status_text,
44  const std::string &user_id);
45 
49  const std::string & get_version() const {
50  return version;
51  }
52 
56  const std::string & get_domain() const {
57  return domain;
58  }
59 
63  const std::string & get_address() const {
64  return address;
65  }
66 
70  const std::string & get_identity() const {
71  return identity;
72  }
73 
77  const std::string & get_mechanism() const {
78  return mechanism;
79  }
80 
84  const std::string & get_username() const {
85  return username;
86  }
87 
91  const std::string & get_password() const {
92  return password;
93  }
94 
99  const std::string & get_client_key() const {
100  return client_key;
101  }
102 
106  const std::string & get_principal() const {
107  return principal;
108  }
109 
110 private:
112  std::string version;
113  std::string sequence;
114  std::string domain;
115  std::string address;
116  std::string identity;
117  std::string mechanism;
118  std::string username;
119  std::string password;
120  std::string client_key;
121  std::string principal;
122  bool verbose;
123 
124  // No copy - private and not implemented
126  zap_request& operator=(zap_request const&) NOEXCEPT ZMQPP_EXPLICITLY_DELETED;
127 };
128 
129 }
130 
131 #endif
132 
133 #endif /* ZMQPP_ZAP_REQUEST_HPP_ */
const std::string & get_principal() const
Get principal for GSSAPI security mechanism.
Definition: zap_request.hpp:106
const std::string & get_identity() const
Get Identity.
Definition: zap_request.hpp:70
A class for working with ZAP requests and replies.
Definition: zap_request.hpp:33
#define ZMQPP_EXPLICITLY_DELETED
Definition: compatibility.hpp:100
C++ wrapper around zmq.
Definition: actor.cpp:29
bool verbose
Log ZAP requests and replies?
Definition: zap_request.hpp:122
The socket class represents the zmq sockets.
Definition: socket.hpp:75
std::string principal
GSSAPI client principal.
Definition: zap_request.hpp:121
const std::string & get_mechanism() const
Get Security Mechanism.
Definition: zap_request.hpp:77
const std::string & get_password() const
Get password for PLAIN security mechanism.
Definition: zap_request.hpp:91
const std::string & get_version() const
Get Version.
Definition: zap_request.hpp:49
std::string version
Version number, must be "1.0".
Definition: zap_request.hpp:112
void reply(const std::string &status_code, const std::string &status_text, const std::string &user_id)
Send a ZAP reply to the handler socket.
Definition: zap_request.cpp:72
#define NOEXCEPT
Definition: compatibility.hpp:104
std::string domain
Server socket domain.
Definition: zap_request.hpp:114
const std::string & get_domain() const
Get Domain.
Definition: zap_request.hpp:56
const std::string & get_username() const
Get username for PLAIN security mechanism.
Definition: zap_request.hpp:84
std::string address
Client IP address.
Definition: zap_request.hpp:115
std::string identity
Server socket idenntity.
Definition: zap_request.hpp:116
socket & zap_socket
Socket we're talking to.
Definition: zap_request.hpp:111
std::string mechanism
Security mechansim.
Definition: zap_request.hpp:117
std::string sequence
Sequence number of request.
Definition: zap_request.hpp:113
zap_request(socket &handler, bool logging)
Receive a ZAP valid request from the handler socket.
Definition: zap_request.cpp:30
std::string password
PLAIN password, in clear text.
Definition: zap_request.hpp:119
std::string client_key
CURVE client public key in ASCII.
Definition: zap_request.hpp:120
std::string username
PLAIN user name.
Definition: zap_request.hpp:118
const std::string & get_address() const
Get Address.
Definition: zap_request.hpp:63
const std::string & get_client_key() const
Definition: zap_request.hpp:99