Ditto 4.13.1
 
Loading...
Searching...
No Matches
ConnectionRequest.hpp
1#ifndef DITTO_CONNECTION_REQUEST_H
2#define DITTO_CONNECTION_REQUEST_H
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
13using dittoffi_connection_request_t = struct dittoffi_connection_request;
14
15namespace ditto {
16
21class ConnectionRequest {
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
85
93};
94
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.
ConnectionType connection_type() const
The network transport of this connection request.
std::string identity_service_metadata_json_string() const
JSON-encoded metadata for the remote peer that is provided by the identity service.
std::string peer_key_string() const
The unique peer key of the remote peer.
nlohmann::json identity_service_metadata() const
Metadata for the remote peer that is provided by the identity service.
std::string peer_metadata_json_string() const
JSON encoded metadata associated with the remote peer.
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
ConnectionRequestAuthorization
Indicates whether a connection request should be authorized.
Definition ConnectionRequestAuthorization.hpp:9
std::function< ConnectionRequestAuthorization(ConnectionRequest)> ConnectionRequestHandler
Definition ConnectionRequest.hpp:107
ConnectionType
The type of connection between two peers signaling what transport is being used for it.
Definition ConnectionType.hpp:10