MCPcopy Index your code
hub / github.com/scality/cloudserver / getVaultClient

Function getVaultClient

lib/auth/vault.js:13–42  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

11let implName;
12
13function getVaultClient(config) {
14 const { host, port } = config.vaultd;
15 let vaultClient;
16
17 if (config.https) {
18 const { key, cert, ca } = config.https;
19 logger.info('vaultclient configuration', {
20 host,
21 port,
22 https: true,
23 });
24 vaultClient = new vaultclient.Client(host, port, true, key, cert, ca);
25 } else {
26 logger.info('vaultclient configuration', {
27 host,
28 port,
29 https: false,
30 });
31 vaultClient = new vaultclient.Client(host, port);
32 }
33
34 if (config.log) {
35 vaultClient.setLoggerConfig({
36 level: config.log.logLevel,
37 dump: config.log.dumpLevel,
38 });
39 }
40
41 return vaultClient;
42}
43
44function getMemBackend(config) {
45 config.on('authdata-update', () => {

Callers 1

vault.jsFile · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected