Skip to content

Upgrade couchbase-lite-c to 3.2.3 #41

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "couchbase_lite"
description = "Rust bindings for Couchbase Lite C"
# The first three numbers correspond to the Couchbase Lite C release, the fourth number corresponds to the Rust release
version = "3.2.2-1"
version = "3.2.3-0"

edition = "2024"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nigh

[CBL_DOCS]: https://docs.couchbase.com/couchbase-lite/current/introduction.html

[CBL_API_REFERENCE]: https://docs.couchbase.com/mobile/3.2.2/couchbase-lite-c/C/html/modules.html
[CBL_API_REFERENCE]: https://docs.couchbase.com/mobile/3.2.3/couchbase-lite-c/C/html/modules.html

[CBL_EDITIONS_DIFF]: https://www.couchbase.com/products/editions/

Expand Down
2 changes: 2 additions & 0 deletions libcblite_community/include/cbl/CBLBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ typedef struct CBLReplicator CBLReplicator;
property decryptor callback when the document is pulled from the remote server. */
typedef struct CBLEncryptable CBLEncryptable;
/** @} */

typedef struct CBLCert CBLCert;
#endif

/** \defgroup listeners Listeners
Expand Down
4 changes: 3 additions & 1 deletion libcblite_community/include/cbl/CBLLogSinks.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ typedef CBL_ENUM(uint8_t, CBLLogDomain) {
kCBLLogDomainDatabase, ///< Logging domain for the database subsystem.
kCBLLogDomainQuery, ///< Logging domain for the query subsystem.
kCBLLogDomainReplicator, ///< Logging domain for the replicator subsystem.
kCBLLogDomainNetwork ///< Logging domain for the network subsystem.
kCBLLogDomainNetwork, ///< Logging domain for the network subsystem.
kCBLLogDomainListener ///< Logging domain for the listener subsystem.
};

/** A bitmask representing a set of logging domains.
Expand All @@ -57,6 +58,7 @@ typedef CBL_OPTIONS(uint16_t, CBLLogDomainMask) {
kCBLLogDomainMaskQuery = 1 << kCBLLogDomainQuery,
kCBLLogDomainMaskReplicator = 1 << kCBLLogDomainReplicator,
kCBLLogDomainMaskNetwork = 1 << kCBLLogDomainNetwork,
kCBLLogDomainMaskListener = 1 << kCBLLogDomainListener,
kCBLLogDomainMaskAll = 0xFF
};

Expand Down
29 changes: 28 additions & 1 deletion libcblite_community/include/cbl/CBLReplicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#pragma once
#include "CBLBase.h"
#include "CBLTLSIdentity.h"

CBL_CAPI_BEGIN

Expand Down Expand Up @@ -66,10 +67,20 @@ _cbl_warn_unused
CBLAuthenticator* CBLAuth_CreatePassword(FLString username, FLString password) CBLAPI;

/** Creates an authenticator using a Couchbase Sync Gateway login session identifier,
and optionally a cookie name (pass NULL for the default.) */
and optionally a cookie name (pass NULL for the default.)
@note You are responsible for freeing the returned reference. */
_cbl_warn_unused
CBLAuthenticator* CBLAuth_CreateSession(FLString sessionID, FLString cookieName) CBLAPI;

#ifdef COUCHBASE_ENTERPRISE

/** Creates an authenticator that presents a client certificate to the server during the initial SSL/TLS
handshake. This is currently used for authenticating with CBLURLEndpointListener only.*/
_cbl_warn_unused
CBLAuthenticator* CBLAuth_CreateCertificate(CBLTLSIdentity* identity) CBLAPI;

#endif

/** Frees a CBLAuthenticator object. */
void CBLAuth_Free(CBLAuthenticator* _cbl_nullable) CBLAPI;

Expand Down Expand Up @@ -442,6 +453,12 @@ typedef struct {
This option is disabled by default (see \ref kCBLDefaultReplicatorAcceptParentCookies) which means
that the parent-domain cookies are not permitted to save by default. */
bool acceptParentDomainCookies;

#ifdef COUCHBASE_ENTERPRISE
/** Specify the replicator to accept only self-signed certs. Any non-self-signed certs will be rejected
to avoid accidentally using this mode with the non-self-signed certs in production. */
bool acceptOnlySelfSignedServerCertificate;
#endif
} CBLReplicatorConfiguration;


Expand Down Expand Up @@ -634,6 +651,16 @@ CBLListenerToken* CBLReplicator_AddDocumentReplicationListener(CBLReplicator*,
CBLDocumentReplicationListener,
void* _cbl_nullable context) CBLAPI;

#ifdef COUCHBASE_ENTERPRISE

/** Gets the TLS certificate received when connecting to the server.
@note You are responsible for releasing the returned key reference. */
_cbl_warn_unused
CBLCert* _cbl_nullable CBLReplicator_ServerCertificate(CBLReplicator*) CBLAPI;


#endif

/** @} */
/** @} */

Expand Down
399 changes: 399 additions & 0 deletions libcblite_community/include/cbl/CBLTLSIdentity.h

Large diffs are not rendered by default.

128 changes: 128 additions & 0 deletions libcblite_community/include/cbl/CBLURLEndpointListener.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
//
// CBLURLEndpointListener.h
//
// Copyright (c) 2025 Couchbase, Inc All rights reserved.
//
// 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.
//

#pragma once
#include "CBLBase.h"

#ifdef COUCHBASE_ENTERPRISE

#include "CBLTLSIdentity.h"

CBL_CAPI_BEGIN

/** An opaque object representing the listener authenticator. */
typedef struct CBLListenerAuthenticator CBLListenerAuthenticator;

/** Password authenticator callback for verifying client credentials when the HTTP Basic Authentication is used. */
typedef bool (*CBLListenerPasswordAuthCallback) (
void* context, ///< Context
FLString username, ///< Username
FLString password ///< Password
);

/** Creates a password authenticatorfor verifying client credentials when the HTTP Basic Authentication is used. */
_cbl_warn_unused CBLListenerAuthenticator* CBLListenerAuth_CreatePassword(CBLListenerPasswordAuthCallback auth,
void* _cbl_nullable context) CBLAPI;

/** Certificate authenticator callback for verifying client certificate when the TLS client certificate authentication is used. */
typedef bool (*CBLListenerCertAuthCallback) (
void* context, ///< Context
CBLCert* cert ///< Certificate
);

/** Creates a certificate authenticator for verifying client certificate with the specified authentication callback
when the TLS client certificate authentication is used. */
_cbl_warn_unused CBLListenerAuthenticator* CBLListenerAuth_CreateCertificate(CBLListenerCertAuthCallback auth,
void* _cbl_nullable context) CBLAPI;

/** Creates a certificate authenticator for verifying client certificate with the specified root certificate chain to trust
when the TLS client certificate authentication is used. */
_cbl_warn_unused CBLListenerAuthenticator* CBLListenerAuth_CreateCertificateWithRootCerts(CBLCert* rootCerts) CBLAPI;

/** Frees a CBLListenerAuthenticator object. */
void CBLListenerAuth_Free(CBLListenerAuthenticator* _cbl_nullable) CBLAPI;

/** The configuration for the URLEndpointListener. */
typedef struct {
/** (Required) The collections available for replication . */
CBLCollection* _cbl_nonnull * _cbl_nonnull collections;

/** (Required) The number of collections (Required). */
size_t collectionCount;

/** The port that the listener will listen to. Default value is zero which means that the listener will automatically
select an available port to listen to when the listener is started. */
uint16_t port;

/** The network interface in the form of the IP Address or network interface name such as en0 that the listener will
listen to. The default value is null slice which means that the listener will listen to all network interfaces. */
FLString networkInterface;

/** Disable TLS communication. The default value is false which means that TLS will be enabled by default. */
bool disableTLS;

/** TLSIdentity required for TLS communication. */
CBLTLSIdentity* _cbl_nullable tlsIdentity;

/** The authenticator used by the listener to authenticate clients. */
CBLListenerAuthenticator* _cbl_nullable authenticator;

/** Allow delta sync when replicating with the listener. The default value is false. */
bool enableDeltaSync;

/** Allow only pull replication to pull changes from the listener. The default value is false. */
bool readOnly;
} CBLURLEndpointListenerConfiguration;

/** An opaque object representing the listener. */
typedef struct CBLURLEndpointListener CBLURLEndpointListener;

CBL_REFCOUNTED(CBLURLEndpointListener*, URLEndpointListener);

/** Creates a URL endpoint listener with the given configuration.
@note You are responsible for releasing the returned reference. */
_cbl_warn_unused CBLURLEndpointListener* _cbl_nullable CBLURLEndpointListener_Create(const CBLURLEndpointListenerConfiguration*, CBLError* _cbl_nullable outError) CBLAPI;

/** Gets the listener's configuration. */
const CBLURLEndpointListenerConfiguration* CBLURLEndpointListener_Config(const CBLURLEndpointListener*) CBLAPI;

/** The listening port of the listener. If the listener is not started, the port will be zero. */
uint16_t CBLURLEndpointListener_Port(const CBLURLEndpointListener*) CBLAPI;

/** The possible URLs of the listener. If the listener is not started, NULL will be returned.
@note You are responsible for releasing the returned reference. */
FLMutableArray CBLURLEndpointListener_Urls(const CBLURLEndpointListener*) CBLAPI;

/** The connection status of the listener */
typedef struct {
uint64_t connectionCount; ///< The total number of connections.
uint64_t activeConnectionCount; ///< The number of the connections that are in active or busy state.
} CBLConnectionStatus;

/** Gets the current connection status of the listener. */
CBLConnectionStatus CBLURLEndpointListener_Status(const CBLURLEndpointListener*) CBLAPI;

/** Starts the listener. */
bool CBLURLEndpointListener_Start(CBLURLEndpointListener*, CBLError* _cbl_nullable outError) CBLAPI;

/** Stops the listener. */
void CBLURLEndpointListener_Stop(CBLURLEndpointListener*) CBLAPI;

CBL_CAPI_END

#endif
10 changes: 5 additions & 5 deletions libcblite_community/include/cbl/CBL_Edition.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
/* #undef COUCHBASE_ENTERPRISE */
#endif

#define CBLITE_VERSION "3.2.2"
#define CBLITE_VERSION_NUMBER 3002002
#define CBLITE_BUILD_NUMBER 9
#define CBLITE_SOURCE_ID "92f79e8"
#define CBLITE_BUILD_TIMESTAMP "2025-02-24T19:44:42Z"
#define CBLITE_VERSION "3.2.3"
#define CBLITE_VERSION_NUMBER 3002003
#define CBLITE_BUILD_NUMBER 30
#define CBLITE_SOURCE_ID "b3b6dc0"
#define CBLITE_BUILD_TIMESTAMP "2025-04-29T06:42:35Z"
2 changes: 2 additions & 0 deletions libcblite_community/include/cbl/CouchbaseLite.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@
#include "CBLQueryIndex.h"
#include "CBLQueryIndexTypes.h"
#include "CBLQueryTypes.h"
#include "CBLTLSIdentity.h"
#include "CBLReplicator.h"
#include "CBLScope.h"
#include "CBLURLEndpointListener.h"
Binary file modified libcblite_community/lib/aarch64-linux-android/libcblite.so
Binary file not shown.
Binary file not shown.
Binary file modified libcblite_community/lib/arm-linux-androideabi/libcblite.so
Binary file not shown.
Binary file not shown.
Binary file modified libcblite_community/lib/i686-linux-android/libcblite.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ typedef struct CBLReplicator CBLReplicator;
property decryptor callback when the document is pulled from the remote server. */
typedef struct CBLEncryptable CBLEncryptable;
/** @} */

typedef struct CBLCert CBLCert;
#endif

/** \defgroup listeners Listeners
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ typedef CBL_ENUM(uint8_t, CBLLogDomain) {
kCBLLogDomainDatabase, ///< Logging domain for the database subsystem.
kCBLLogDomainQuery, ///< Logging domain for the query subsystem.
kCBLLogDomainReplicator, ///< Logging domain for the replicator subsystem.
kCBLLogDomainNetwork ///< Logging domain for the network subsystem.
kCBLLogDomainNetwork, ///< Logging domain for the network subsystem.
kCBLLogDomainListener ///< Logging domain for the listener subsystem.
};

/** A bitmask representing a set of logging domains.
Expand All @@ -57,6 +58,7 @@ typedef CBL_OPTIONS(uint16_t, CBLLogDomainMask) {
kCBLLogDomainMaskQuery = 1 << kCBLLogDomainQuery,
kCBLLogDomainMaskReplicator = 1 << kCBLLogDomainReplicator,
kCBLLogDomainMaskNetwork = 1 << kCBLLogDomainNetwork,
kCBLLogDomainMaskListener = 1 << kCBLLogDomainListener,
kCBLLogDomainMaskAll = 0xFF
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#pragma once
#include <CouchbaseLite/CBLBase.h>
#include <CouchbaseLite/CBLTLSIdentity.h>

CBL_CAPI_BEGIN

Expand Down Expand Up @@ -66,10 +67,20 @@ _cbl_warn_unused
CBLAuthenticator* CBLAuth_CreatePassword(FLString username, FLString password) CBLAPI;

/** Creates an authenticator using a Couchbase Sync Gateway login session identifier,
and optionally a cookie name (pass NULL for the default.) */
and optionally a cookie name (pass NULL for the default.)
@note You are responsible for freeing the returned reference. */
_cbl_warn_unused
CBLAuthenticator* CBLAuth_CreateSession(FLString sessionID, FLString cookieName) CBLAPI;

#ifdef COUCHBASE_ENTERPRISE

/** Creates an authenticator that presents a client certificate to the server during the initial SSL/TLS
handshake. This is currently used for authenticating with CBLURLEndpointListener only.*/
_cbl_warn_unused
CBLAuthenticator* CBLAuth_CreateCertificate(CBLTLSIdentity* identity) CBLAPI;

#endif

/** Frees a CBLAuthenticator object. */
void CBLAuth_Free(CBLAuthenticator* _cbl_nullable) CBLAPI;

Expand Down Expand Up @@ -442,6 +453,12 @@ typedef struct {
This option is disabled by default (see \ref kCBLDefaultReplicatorAcceptParentCookies) which means
that the parent-domain cookies are not permitted to save by default. */
bool acceptParentDomainCookies;

#ifdef COUCHBASE_ENTERPRISE
/** Specify the replicator to accept only self-signed certs. Any non-self-signed certs will be rejected
to avoid accidentally using this mode with the non-self-signed certs in production. */
bool acceptOnlySelfSignedServerCertificate;
#endif
} CBLReplicatorConfiguration;


Expand Down Expand Up @@ -634,6 +651,16 @@ CBLListenerToken* CBLReplicator_AddDocumentReplicationListener(CBLReplicator*,
CBLDocumentReplicationListener,
void* _cbl_nullable context) CBLAPI;

#ifdef COUCHBASE_ENTERPRISE

/** Gets the TLS certificate received when connecting to the server.
@note You are responsible for releasing the returned key reference. */
_cbl_warn_unused
CBLCert* _cbl_nullable CBLReplicator_ServerCertificate(CBLReplicator*) CBLAPI;


#endif

/** @} */
/** @} */

Expand Down
Loading