MCPcopy Create free account
hub / github.com/apache/cassandra-nodejs-driver / init

Function init

lib/datastax/cloud/index.js:40–56  ·  view source on GitHub ↗

* When the user sets the cloud options, it uses the secure bundle or endpoint to access the metadata service and * setting the connection options * @param {ClientOptions} options * @returns {Promise }

(options)

Source from the content-addressed store, hash-verified

38 * @returns {Promise<void>}
39 */
40async function init(options) {
41 if (!options.cloud) {
42 return;
43 }
44
45 const cloudOptions = new CloudOptions(options);
46 await parseZipFile(cloudOptions);
47 await getMetadataServiceInfoAsync(cloudOptions);
48
49 if (!cloudOptions.clientOptions.sslOptions.checkServerIdentity) {
50 // With SNI enabled, hostname (uuid) and CN will not match
51 // Use a custom validation function to validate against the proxy address.
52 // Note: this function is only called if the certificate passed all other checks, like CA validation.
53 cloudOptions.clientOptions.sslOptions.checkServerIdentity = (_, cert) =>
54 checkServerIdentity(cert, cloudOptions.clientOptions.sni.address);
55 }
56}
57
58class CloudOptions {
59 constructor(clientOptions) {

Callers

nothing calls this directly

Calls 2

parseZipFileFunction · 0.85
checkServerIdentityFunction · 0.85

Tested by

no test coverage detected