/opt/canhelp/node_modules/gel/dist
NameSizeModeActions
codecs/-0755rm
datatypes/-0755rm
errors/-0755rm
primitives/-0755rm
reflection/-0755rm
baseClient.d.ts58870644editdlrm
baseClient.js198870644editdlrm
baseConn.d.ts48900644editdlrm
baseConn.js315880644editdlrm
browserClient.d.ts2000644editdlrm
browserClient.js12120644editdlrm
browserCrypto.d.ts910644editdlrm
browserCrypto.js7240644editdlrm
cli.mjs74390755editdlrm
codecTypeRegistry.d.ts1950644editdlrm
codecTypeRegistry.js770644editdlrm
conUtils.d.ts55400644editdlrm
conUtils.js362590644editdlrm
conUtils.server.d.ts5550644editdlrm
conUtils.server.js32660644editdlrm
credentials.d.ts5610644editdlrm
credentials.js41580644editdlrm
cryptoUtils.d.ts1060644editdlrm
cryptoUtils.js8110644editdlrm
fetchConn.d.ts28000644editdlrm
fetchConn.js75450644editdlrm
httpScram.d.ts2290644editdlrm
httpScram.js39700644editdlrm
ifaces.d.ts25300644editdlrm
ifaces.js28470644editdlrm
index.browser.d.ts8670644editdlrm
index.browser.js19730644editdlrm
index.node.d.ts12750644editdlrm
index.node.js32660644editdlrm
index.shared.d.ts18960644editdlrm
index.shared.js54860644editdlrm
nodeClient.d.ts2400644editdlrm
nodeClient.js15290644editdlrm
nodeCrypto.d.ts910644editdlrm
nodeCrypto.js9170644editdlrm
options.d.ts42540644editdlrm
options.js112490644editdlrm
platform.d.ts1240644editdlrm
platform.js17310644editdlrm
rawConn.d.ts12180644editdlrm
rawConn.js173140644editdlrm
retry.d.ts11530644editdlrm
retry.js39250644editdlrm
scram.d.ts17230644editdlrm
scram.js60040644editdlrm
systemUtils.d.ts4830644editdlrm
systemUtils.js38400644editdlrm
transaction.d.ts17380644editdlrm
transaction.js81130644editdlrm
typeutil.d.ts2430644editdlrm
typeutil.js770644editdlrm
utils.d.ts19250644editdlrm
utils.js37270644editdlrm
Edit: /opt/canhelp/node_modules/gel/dist/credentials.js (4158B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCredentialsPath = getCredentialsPath; exports.readCredentialsFile = readCredentialsFile; exports.validateCredentials = validateCredentials; const conUtils_1 = require("./conUtils"); const errors_1 = require("./errors"); async function getCredentialsPath(instanceName, serverUtils) { return serverUtils.searchConfigDir("credentials", instanceName + ".json"); } async function readCredentialsFile(file, serverUtils) { try { const data = await serverUtils.readFileUtf8(file); return validateCredentials(JSON.parse(data)); } catch (e) { throw new errors_1.InterfaceError(`cannot read credentials file ${file}: ${e}`); } } function validateCredentials(data) { const port = data.port; if (port != null && (typeof port !== "number" || port < 1 || port > 65535)) { throw new errors_1.InterfaceError("invalid `port` value"); } const user = data.user; if (user == null) { throw new errors_1.InterfaceError("`user` key is required"); } if (typeof user !== "string") { throw new errors_1.InterfaceError("`user` must be string"); } const result = { user, port }; const host = data.host; if (host != null) { if (typeof host !== "string") { throw new errors_1.InterfaceError("`host` must be string"); } result.host = host; } const database = data.database; if (database != null) { if (typeof database !== "string") { throw new errors_1.InterfaceError("`database` must be string"); } result.database = database; } const branch = data.branch; if (branch != null) { if (typeof branch !== "string") { throw new errors_1.InterfaceError("`branch` must be string"); } if (database != null && branch !== database) { throw new errors_1.InterfaceError("`database` and `branch` cannot both be set"); } result.branch = branch; } const password = data.password; if (password != null) { if (typeof password !== "string") { throw new errors_1.InterfaceError("`password` must be string"); } result.password = password; } const caData = data.tls_ca; if (caData != null) { if (typeof caData !== "string") { throw new errors_1.InterfaceError("`tls_ca` must be string"); } result.tlsCAData = caData; } const certData = data.tls_cert_data; if (certData != null) { if (typeof certData !== "string") { throw new errors_1.InterfaceError("`tls_cert_data` must be string"); } if (caData != null && certData !== caData) { throw new errors_1.InterfaceError(`both 'tls_ca' and 'tls_cert_data' are defined, ` + `and are not in agreement`); } result.tlsCAData = certData; } let verifyHostname = data.tls_verify_hostname; const tlsSecurity = data.tls_security; if (verifyHostname != null) { if (typeof verifyHostname === "boolean") { verifyHostname = verifyHostname ? "strict" : "no_host_verification"; } else { throw new errors_1.InterfaceError("`tls_verify_hostname` must be boolean"); } } if (tlsSecurity != null && (typeof tlsSecurity !== "string" || !conUtils_1.validTlsSecurityValues.includes(tlsSecurity))) { throw new errors_1.InterfaceError(`\`tls_security\` must be one of ${conUtils_1.validTlsSecurityValues .map((val) => `"${val}"`) .join(", ")}`); } if (verifyHostname && tlsSecurity && verifyHostname !== tlsSecurity && !(verifyHostname === "no_host_verification" && tlsSecurity === "insecure")) { throw new errors_1.InterfaceError(`both 'tls_security' and 'tls_verify_hostname' are defined, ` + `and are not in agreement`); } if (tlsSecurity || verifyHostname) { result.tlsSecurity = tlsSecurity ?? verifyHostname; } return result; }