Couchbase Lite C
Couchbase Lite C API
Loading...
Searching...
No Matches
CBLURLEndpointListener.h File Reference
#include "CBLBase.h"
#include "CBLTLSIdentity.h"

Go to the source code of this file.

Data Structures

struct  CBLURLEndpointListenerConfiguration
 The configuration for the URLEndpointListener. More...
struct  CBLConnectionStatus
 The connection status of the listener. More...

Typedefs

typedef typedefCBL_CAPI_BEGIN struct CBLListenerAuthenticator CBLListenerAuthenticator
 An opaque object representing the listener authenticator.
typedef bool(* CBLListenerPasswordAuthCallback) (void *context, FLString username, FLString password)
 Password authenticator callback for verifying client credentials when the HTTP Basic Authentication is used.
typedef bool(* CBLListenerCertAuthCallback) (void *context, CBLCert *cert)
 Certificate authenticator callback for verifying client certificate when the TLS client certificate authentication is used.
typedef struct CBLURLEndpointListener CBLURLEndpointListener
 An opaque object representing the listener.

Functions

_cbl_warn_unused CBLListenerAuthenticatorCBLListenerAuth_CreatePassword (CBLListenerPasswordAuthCallback auth, void *_cbl_nullable context)
 Creates a password authenticatorfor verifying client credentials when the HTTP Basic Authentication is used.
_cbl_warn_unused CBLListenerAuthenticatorCBLListenerAuth_CreateCertificate (CBLListenerCertAuthCallback auth, void *_cbl_nullable context)
 Creates a certificate authenticator for verifying client certificate with the specified authentication callback when the TLS client certificate authentication is used.
_cbl_warn_unused CBLListenerAuthenticatorCBLListenerAuth_CreateCertificateWithRootCerts (CBLCert *rootCerts)
 Creates a certificate authenticator for verifying client certificate with the specified root certificate chain to trust when the TLS client certificate authentication is used.
void CBLListenerAuth_Free (CBLListenerAuthenticator *_cbl_nullable)
 Frees a CBLListenerAuthenticator object.
CBLINLINE const CBLURLEndpointListenerCBLURLEndpointListener_Retain (const CBLURLEndpointListener *_cbl_nullable t)
CBLINLINE void CBLURLEndpointListener_Release (const CBLURLEndpointListener *_cbl_nullable t)
_cbl_warn_unused CBLURLEndpointListener *_cbl_nullable CBLURLEndpointListener_Create (const CBLURLEndpointListenerConfiguration *, CBLError *_cbl_nullable outError)
 Creates a URL endpoint listener with the given configuration.
const CBLURLEndpointListenerConfigurationCBLURLEndpointListener_Config (const CBLURLEndpointListener *)
 Gets the listener's configuration.
uint16_t CBLURLEndpointListener_Port (const CBLURLEndpointListener *)
 The listening port of the listener.
CBLTLSIdentityCBLURLEndpointListener_TLSIdentity (const CBLURLEndpointListener *)
 The TLS identity used by the listener for TLS communication.
FLMutableArray CBLURLEndpointListener_Urls (const CBLURLEndpointListener *)
 The possible URLs of the listener.
CBLConnectionStatus CBLURLEndpointListener_Status (const CBLURLEndpointListener *)
 Gets the current connection status of the listener.
bool CBLURLEndpointListener_Start (CBLURLEndpointListener *, CBLError *_cbl_nullable outError)
 Starts the listener.
void CBLURLEndpointListener_Stop (CBLURLEndpointListener *)
 Stops the listener.

Typedef Documentation

◆ CBLListenerAuthenticator

typedef typedefCBL_CAPI_BEGIN struct CBLListenerAuthenticator CBLListenerAuthenticator

An opaque object representing the listener authenticator.

◆ CBLListenerCertAuthCallback

typedef bool(* CBLListenerCertAuthCallback) (void *context, CBLCert *cert)

Certificate authenticator callback for verifying client certificate when the TLS client certificate authentication is used.

Parameters
contextContext
certCertificate

◆ CBLListenerPasswordAuthCallback

typedef bool(* CBLListenerPasswordAuthCallback) (void *context, FLString username, FLString password)

Password authenticator callback for verifying client credentials when the HTTP Basic Authentication is used.

Parameters
contextContext
usernameUsername
passwordPassword

◆ CBLURLEndpointListener

An opaque object representing the listener.

Function Documentation

◆ CBLListenerAuth_CreateCertificate()

_cbl_warn_unused CBLListenerAuthenticator * CBLListenerAuth_CreateCertificate ( CBLListenerCertAuthCallback auth,
void *_cbl_nullable context )

Creates a certificate authenticator for verifying client certificate with the specified authentication callback when the TLS client certificate authentication is used.

◆ CBLListenerAuth_CreateCertificateWithRootCerts()

_cbl_warn_unused CBLListenerAuthenticator * CBLListenerAuth_CreateCertificateWithRootCerts ( CBLCert * rootCerts)

Creates a certificate authenticator for verifying client certificate with the specified root certificate chain to trust when the TLS client certificate authentication is used.

◆ CBLListenerAuth_CreatePassword()

_cbl_warn_unused CBLListenerAuthenticator * CBLListenerAuth_CreatePassword ( CBLListenerPasswordAuthCallback auth,
void *_cbl_nullable context )

Creates a password authenticatorfor verifying client credentials when the HTTP Basic Authentication is used.

◆ CBLListenerAuth_Free()

void CBLListenerAuth_Free ( CBLListenerAuthenticator * _cbl_nullable)

Frees a CBLListenerAuthenticator object.

◆ CBLURLEndpointListener_Config()

const CBLURLEndpointListenerConfiguration * CBLURLEndpointListener_Config ( const CBLURLEndpointListener * )

Gets the listener's configuration.

◆ CBLURLEndpointListener_Create()

Creates a URL endpoint listener with the given configuration.

Note
You are responsible for releasing the returned reference.

◆ CBLURLEndpointListener_Port()

uint16_t CBLURLEndpointListener_Port ( const CBLURLEndpointListener * )

The listening port of the listener.

If the listener is not started, the port will be zero.

◆ CBLURLEndpointListener_Release()

CBLINLINE void CBLURLEndpointListener_Release ( const CBLURLEndpointListener *_cbl_nullable t)

◆ CBLURLEndpointListener_Retain()

CBLINLINE const CBLURLEndpointListener * CBLURLEndpointListener_Retain ( const CBLURLEndpointListener *_cbl_nullable t)

◆ CBLURLEndpointListener_Start()

bool CBLURLEndpointListener_Start ( CBLURLEndpointListener * ,
CBLError *_cbl_nullable outError )

Starts the listener.

◆ CBLURLEndpointListener_Status()

CBLConnectionStatus CBLURLEndpointListener_Status ( const CBLURLEndpointListener * )

Gets the current connection status of the listener.

◆ CBLURLEndpointListener_Stop()

void CBLURLEndpointListener_Stop ( CBLURLEndpointListener * )

Stops the listener.

◆ CBLURLEndpointListener_TLSIdentity()

CBLTLSIdentity * CBLURLEndpointListener_TLSIdentity ( const CBLURLEndpointListener * )

The TLS identity used by the listener for TLS communication.

The value will be nullptr if the listener is not started, or if the TLS is disabled.

Note
The returned identity remains valid until the listener is stopped or released. If you want to keep it longer, retain it with CBLTLSIdentity_Retain.

◆ CBLURLEndpointListener_Urls()

FLMutableArray CBLURLEndpointListener_Urls ( const CBLURLEndpointListener * )

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.