Ditto 4.8.0-rc.2
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
50 nlohmann::json peer_metadata() const;
51
61 std::string peer_metadata_json_string() const;
62
74 nlohmann::json identity_service_metadata() const;
75
84 std::string identity_service_metadata_json_string() const;
85
92 ConnectionType connection_type() const;
93};
94
107typedef std::function<ConnectionRequestAuthorization(ConnectionRequest)>
108 ConnectionRequestHandler;
109
110} // namespace ditto
111
112#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
Definition Presence.cpp:146