Ditto 4.7.4
Loading...
Searching...
No Matches
ConnectionRequest.hpp
1#ifndef _DITTO_CONNECTION_REQUEST_
2#define _DITTO_CONNECTION_REQUEST_
3
4#include "ConnectionRequestAuthorization.hpp"
5#include "ConnectionType.hpp"
6#include "any.hpp"
7#include "json.hpp"
8
9#include <memory>
10#include <string>
11#include <unordered_map>
12
13typedef struct dittoffi_connection_request dittoffi_connection_request_t;
14
15namespace ditto {
16
22 friend class OnConnectingWrapper;
23
24 dittoffi_connection_request_t *ffi_connection_request;
25
26 explicit ConnectionRequest(
27 dittoffi_connection_request_t *ffi_connection_request);
28 dittoffi_connection_request_t *to_ffi() const;
29 void authorize(ConnectionRequestAuthorization authorization) const;
30
31public:
37 std::string peer_key_string() const;
38
53
64 std::string peer_metadata_json_string() const;
65
78
87 std::string identity_service_metadata_json_string() const;
88
95 ConnectionType connection_type() const;
96};
97
110typedef std::function<ConnectionRequestAuthorization(ConnectionRequest)>
111 ConnectionRequestHandler;
112
113} // namespace ditto
114
115#endif
Contains information about a remote peer that has requested a connection.
Definition ConnectionRequest.hpp:21
nlohmann::json peer_metadata() const
Metadata associated with the remote peer.
Definition ConnectionRequest.cpp:36
ConnectionType connection_type() const
The network transport of this connection request.
Definition ConnectionRequest.cpp:57
std::string identity_service_metadata_json_string() const
JSON-encoded metadata for the remote peer that is provided by the identity service.
Definition ConnectionRequest.cpp:50
std::string peer_key_string() const
The unique peer key of the remote peer.
Definition ConnectionRequest.cpp:28
nlohmann::json identity_service_metadata() const
Metadata for the remote peer that is provided by the identity service.
Definition ConnectionRequest.cpp:46
std::string peer_metadata_json_string() const
JSON encoded metadata associated with the remote peer.
Definition ConnectionRequest.cpp:40
basic_json<> json
default JSON class
Definition json.hpp:2933
Definition Presence.cpp:146