Neo4j-Client
view release on metacpan or search on metacpan
build/lib/src/neo4j-client.h view on Meta::CPAN
* Set the username in the neo4j client configuration.
*
* @param [config] The neo4j client configuration to update.
* @param [username] The username to authenticate with. The string will be
* duplicated, and thus may point to temporary memory.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_username(neo4j_config_t *config, const char *username);
/**
* Get the username in the neo4j client configuration.
*
* The returned username will only be valid whilst the configuration is
* unchanged.
*
* @param [config] The neo4j client configuration.
* @return A pointer to the username, or `NULL` if one is not set.
*/
__neo4j_pure
const char *neo4j_config_get_username(const neo4j_config_t *config);
#define NEO4J_MAXPASSWORDLEN 1023
/**
* Set the password in the neo4j client configuration.
*
* @param [config] The neo4j client configuration to update.
* @param [password] The password to authenticate with. The string will be
* duplicated, and thus may point to temporary memory.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_password(neo4j_config_t *config, const char *password);
/**
* Set the basic authentication callback.
*
* If a username and/or password is required for basic authentication and
* isn't available in the configuration or connection URI, then this callback
* will be invoked to obtain the username and/or password.
*
* @param [config] The neo4j client configuration to update.
* @param [callback] The callback to be invoked.
* @param [userdata] User data that will be supplied to the callback.
* @return 0 on success, or -1 on error (errno will be set).
*/
int neo4j_config_set_basic_auth_callback(neo4j_config_t *config,
neo4j_basic_auth_callback_t callback, void *userdata);
/**
* Set the location of a TLS private key and certificate chain.
*
* @param [config] The neo4j client configuration to update.
* @param [path] The path to the PEM file containing the private key
* and certificate chain. The string will be
* duplicated, and thus may point to temporary memory.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_TLS_private_key(neo4j_config_t *config,
const char *path);
/**
* Obtain the path to the TLS private key and certificate chain.
*
* @param [config] The neo4j client configuration.
* @return The path set in the config, or `NULL` if none.
*/
const char *neo4j_config_get_TLS_private_key(const neo4j_config_t *config);
/**
* Set the password callback for the TLS private key file.
*
* @param [config] The neo4j client configuration to update.
* @param [callback] The callback to be invoked whenever a password for
* the certificate file is required.
* @param [userdata] User data that will be supplied to the callback.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_TLS_private_key_password_callback(neo4j_config_t *config,
neo4j_password_callback_t callback, void *userdata);
/**
* Set the password for the TLS private key file.
*
* This is a simpler alternative to using
* neo4j_config_set_TLS_private_key_password_callback().
*
* @param [config] The neo4j client configuration to update.
* @param [password] The password for the certificate file. This string should
* remain allocated whilst the config is allocated _or if any
* connections opened with the config remain active_.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_TLS_private_key_password(neo4j_config_t *config,
const char *password);
/**
* Set the location of a file containing TLS certificate authorities (and CRLs).
*
* The file should contain the certificates of the trusted CAs and CRLs. The
* file must be in base64 privacy enhanced mail (PEM) format.
*
* @param [config] The neo4j client configuration to update.
* @param [path] The path to the PEM file containing the trusted CAs and CRLs.
* The string will be duplicated, and thus may point to temporary memory.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_TLS_ca_file(neo4j_config_t *config, const char *path);
/**
* Obtain the path to the TLS certificate authority file.
*
* @param [config] The neo4j client configuration.
* @return The path set in the config, or `NULL` if none.
*/
const char *neo4j_config_get_TLS_ca_file(const neo4j_config_t *config);
/**
* Set the location of a directory of TLS certificate authorities (and CRLs).
*
* The specified directory should contain the certificates of the trusted CAs
* and CRLs, named by hash according to the `c_rehash` tool.
*
* @param [config] The neo4j client configuration to update.
* @param [path] The path to the directory of CAs and CRLs. The string will be
* duplicated, and thus may point to temporary memory.
* @return 0 on success, or -1 on error (errno will be set).
*/
__neo4j_must_check
int neo4j_config_set_TLS_ca_dir(neo4j_config_t *config, const char *path);
/**
* Obtain the path to the TLS certificate authority directory.
*
* @param [config] The neo4j client configuration.
* @return The path set in the config, or `NULL` if none.
*/
const char *neo4j_config_get_TLS_ca_dir(const neo4j_config_t *config);
/**
* Enable or disable trusting of known hosts.
*
* When enabled, the neo4j client will check if a host has been previously
* trusted and stored into the "known hosts" file, and that the host
* fingerprint still matches the previously accepted value. This is enabled by
* default.
*
* If verification fails, the callback set with
* neo4j_config_set_unverified_host_callback() will be invoked.
*
* @param [config] The neo4j client configuration to update.
* @param [enable] `true` to enable trusting of known hosts, and `false` to
* disable this behaviour.
( run in 0.912 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )