Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RCPP-6, RCPP-83: Improve networking #216

Merged
merged 41 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
33f499c
Begin adding flexible networking
leemaguire Jun 7, 2024
316bedc
Move network code into its own files
leemaguire Jun 10, 2024
72f3cd2
Add bones for platform networking
leemaguire Jun 10, 2024
e1a9840
Add factory for http transport
leemaguire Jun 10, 2024
5671bdd
cleanup default network transport
leemaguire Jun 10, 2024
6b5ee3c
Add platform networking
leemaguire Jun 13, 2024
2c12b8f
Cleanup, add docs
leemaguire Jun 17, 2024
143bb35
Playing with proxy
leemaguire Jun 25, 2024
509aefd
Networking checkpoint
leemaguire Jul 3, 2024
aec653a
Networking checkpoint
leemaguire Jul 5, 2024
81034b1
Cleanup
leemaguire Jul 8, 2024
df84751
Cleanup
leemaguire Jul 8, 2024
0768165
Add boost to GHA runners
leemaguire Jul 8, 2024
7c90688
Dont use boost for asio
leemaguire Jul 8, 2024
621bb1c
Fix tests
leemaguire Jul 8, 2024
0507774
Fix tests
leemaguire Jul 8, 2024
b4c3031
Fix tests
leemaguire Jul 8, 2024
e28f613
Fix tests
leemaguire Jul 8, 2024
ba0320e
Fix tests
leemaguire Jul 8, 2024
a9d57ea
Begin cleanup
leemaguire Jul 10, 2024
85796b8
Add SSL configuration
leemaguire Jul 10, 2024
bfeb61c
Update tests
leemaguire Jul 10, 2024
3cc3d0b
Update tests
leemaguire Jul 10, 2024
c93dfcd
Cleanup
leemaguire Jul 11, 2024
f874f9a
Cleanup
leemaguire Jul 11, 2024
c62ef0a
Fix tests
leemaguire Jul 11, 2024
0bfd4bb
point to yg/openssl-native-ca
leemaguire Jul 11, 2024
9a2e507
Try out use_default_verify
leemaguire Jul 11, 2024
9ffec41
Add back use_included_certificate_roots
leemaguire Jul 12, 2024
b61d9fe
Cleanup TODO
leemaguire Jul 12, 2024
65af4a1
Cleanup, add SSL verify callback
leemaguire Jul 15, 2024
5bd2e6b
Fix compilation
leemaguire Jul 15, 2024
8cf8fd2
Fix compilation
leemaguire Jul 15, 2024
cf7119d
split interfaces into http and websocket headers
leemaguire Jul 15, 2024
4389342
split interfaces into http and websocket headers
leemaguire Jul 15, 2024
4fb16ec
split interfaces into http and websocket headers
leemaguire Jul 15, 2024
e443f39
split interfaces into http and websocket headers
leemaguire Jul 15, 2024
5ddcab1
split interfaces into http and websocket headers
leemaguire Jul 16, 2024
8ec6316
split interfaces into http and websocket headers
leemaguire Jul 16, 2024
97ea134
Address feedback
leemaguire Jul 16, 2024
71e658c
Address feedback, remove curl and NSURLSession transport
leemaguire Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,30 @@ NEXT-RELEASE Release notes (YYYY-MM-DD)
Supported operators are `==`, `!=`, `>`, `<`, `>=`, `<=` and `contains(const std::string&)`.
* Add `managed<std::map<std::string, T>>::contains_key` for conveniently checking if a managed map
contains a given key. Use this method in the Type Safe Query API instead of `managed<std::map<std::string, T>>::find`.
* Add `realm::networking` namespace which contains interfaces for providing your own custom network transport
implementations. The following interfaces are exposed:
* `websocket_interface`
* `websocket_observer`
* `sync_socket_provider`
* `sync_socket_provider::timer`
* `http_transport_client`
* Add `default_http_transport` for built-in HTTP transport.
* Add `default_socket_provider` a built-in class for providing the components necessary for transport via WebSocket.
* A custom WebSocket & HTTP transport implementation can be used by passing
the instance via `realm::app::App::configuration.http_transport_client` & `realm::app::App::configuration.sync_socket_provider`.
* Network configuration for the built-in http transport must be supplied via it's constructor using the
`realm::networking::default_http_transport::configuration` struct.
* Network configuration for the built-in websocket provider must be supplied via it's constructor using the
`realm::networking::default_socket_provider::configuration` struct.

### Deprecations
* Proxy and custom http headers should no longer be set via `realm::app::App::configuration`.

### Compatibility
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10.

### Internals
* None
* Upgraded to Core v14.10.4

2.1.0 Release notes (2024-06-27)
=============================================================
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription

let sdkVersion = Version("2.1.0")
let coreVersion = Version("14.9.0")
let coreVersion = Version("14.10.4")

var cxxSettings: [CXXSetting] = [
.define("REALM_ENABLE_SYNC", to: "1"),
Expand Down
36 changes: 31 additions & 5 deletions include/cpprealm/app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@
#include <cpprealm/internal/bridge/sync_manager.hpp>
#include <cpprealm/internal/bridge/sync_session.hpp>
#include <cpprealm/internal/bridge/utils.hpp>
#include <cpprealm/networking/http.hpp>
#include <cpprealm/networking/websocket.hpp>

#include <future>
#include <utility>

namespace realm {

using proxy_config = sync_config::proxy_config;
using sync_session = internal::bridge::sync_session;

Expand Down Expand Up @@ -222,20 +225,43 @@

class App {
public:
/**
* Properties representing the configuration of a client
* that communicate with a particular Realm application.
*
* `App::configuration` options cannot be modified once the `App` using it
* is created. App's configuration values are cached when the App is created so any modifications after it
* will not have any effect.
*/
struct configuration {

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 8.3)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 11.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 9.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Release (gcc 12.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::proxy_configuration' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]

Check warning on line 236 in include/cpprealm/app.hpp

View workflow job for this annotation

GitHub Actions / Linux Debug (gcc 10.1)

'realm::App::configuration::custom_http_headers' is deprecated: Network options must be supplied via custom network implementations. [-Wdeprecated-declarations]
/// The App ID for your Atlas Device Sync Application.
std::string app_id;
/// A custom base URL to request against. If not set or set to nil, the default base url for app services will be returned.
std::optional<std::string> base_url;
/// Custom location for Realm files.
std::optional<std::string> path;
[[deprecated("Network options must be supplied via custom network implementations.")]]
std::optional<std::map<std::string, std::string>> custom_http_headers;
/// Custom encryption key for the metadata Realm.
std::optional<std::array<char, 64>> metadata_encryption_key;
/// Caches an App and its configuration for a given App ID. On by default.
bool enable_caching = true;
[[deprecated("Network options must be supplied via custom network implementations.")]]
std::optional<sync_config::proxy_config> proxy_configuration;
/**
* Optionally provide a custom HTTP transport for network calls to the server.
*
* Alternatively use `realm::networking::set_http_client_factory` to globally set
* the default HTTP transport client.
*/
std::shared_ptr<networking::http_transport_client> http_transport_client;
/**
* Optionally provide a custom WebSocket interface for sync.
*/
std::shared_ptr<networking::sync_socket_provider> sync_socket_provider;

};

[[deprecated("Use App(const configuration&) instead.")]]
explicit App(const std::string& app_id,
const std::optional<std::string>& base_url = {},
const std::optional<std::string>& path = {},
const std::optional<std::map<std::string, std::string>>& custom_http_headers = {});

App(const configuration&);

Expand Down
11 changes: 4 additions & 7 deletions include/cpprealm/db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,16 @@
#define CPPREALM_DB_HPP

#include <cpprealm/accessors.hpp>

#include <cpprealm/macros.hpp>
#include <cpprealm/results.hpp>
#include <cpprealm/scheduler.hpp>
#include <cpprealm/schema.hpp>
#include <cpprealm/types.hpp>

#include <cpprealm/internal/bridge/sync_session.hpp>
#include <cpprealm/internal/bridge/thread_safe_reference.hpp>
#include <cpprealm/internal/bridge/sync_session.hpp>

#include <cpprealm/scheduler.hpp>

#include <cpprealm/macros.hpp>
#include <cpprealm/results.hpp>
#include <cpprealm/types.hpp>

#include <filesystem>
#include <optional>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions include/cpprealm/internal/bridge/status.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace realm::internal::bridge {
};

struct status {

static status ok();
status(const ::realm::Status&);
status(::realm::Status&&);
status(const status&);
Expand All @@ -73,7 +73,7 @@ namespace realm::internal::bridge {
bool is_ok() const noexcept;
const std::string& reason() const noexcept;
std::string_view code_string() const noexcept;

operator ::realm::Status() const noexcept;
private:
#ifdef CPPREALM_HAVE_GENERATED_BRIDGE_TYPES
storage::Status m_status[1];
Expand Down
52 changes: 0 additions & 52 deletions include/cpprealm/internal/generic_network_transport.hpp

This file was deleted.

39 changes: 39 additions & 0 deletions include/cpprealm/internal/networking/shims.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2024 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#ifndef CPPREALM_SHIMS_HPP
#define CPPREALM_SHIMS_HPP

#include <cpprealm/networking/http.hpp>
#include <cpprealm/networking/websocket.hpp>

namespace realm {
namespace sync {
class SyncSocketProvider;
}
namespace app {
struct GenericNetworkTransport;
}
}

namespace realm::internal::networking {
std::shared_ptr<app::GenericNetworkTransport> create_http_client_shim(const std::shared_ptr<::realm::networking::http_transport_client>&);
std::unique_ptr<::realm::sync::SyncSocketProvider> create_sync_socket_provider_shim(const std::shared_ptr<::realm::networking::sync_socket_provider>& provider);
}

#endif //CPPREALM_SHIMS_HPP
50 changes: 50 additions & 0 deletions include/cpprealm/internal/networking/utils.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2024 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

#ifndef CPPREALM_NETWORKING_UTILS_HPP
#define CPPREALM_NETWORKING_UTILS_HPP

#include <cpprealm/networking/websocket.hpp>

#include <optional>

namespace realm {
namespace app {
struct Request;
struct Response;
}
namespace sync {
struct WebSocketEndpoint;
}

namespace networking {
struct request;
struct response;
}
}

namespace realm::internal::networking {
::realm::networking::request to_request(const ::realm::app::Request&);
::realm::app::Response to_core_response(const ::realm::networking::response&);

::realm::sync::WebSocketEndpoint to_core_websocket_endpoint(const ::realm::networking::websocket_endpoint& ep,
const std::optional<::realm::networking::default_socket_provider::configuration>& config);
::realm::networking::websocket_endpoint to_websocket_endpoint(const ::realm::sync::WebSocketEndpoint& ep);
} //namespace realm::internal::networking

#endif //CPPREALM_NETWORKING_UTILS_HPP
Loading
Loading