Comparing version 1.5.11 to 1.5.12
@@ -49,2 +49,3 @@ /*! | ||
tlsSecurity?: TlsSecurity; | ||
tlsServerName?: string; | ||
timeout?: number; | ||
@@ -62,3 +63,3 @@ waitUntilAvailable?: Duration | number; | ||
export declare function getConnectArgumentsParser(utils: ServerUtils | null): ConnectArgumentsParser; | ||
type ConnectConfigParams = "host" | "port" | "database" | "branch" | "user" | "password" | "secretKey" | "cloudProfile" | "tlsCAData" | "tlsSecurity" | "waitUntilAvailable"; | ||
type ConnectConfigParams = "host" | "port" | "database" | "branch" | "user" | "password" | "secretKey" | "cloudProfile" | "tlsCAData" | "tlsSecurity" | "tlsServerName" | "waitUntilAvailable"; | ||
export type ResolvedConnectConfigReadonly = Readonly<Pick<ResolvedConnectConfig, Exclude<keyof ResolvedConnectConfig, `${"_" | "set" | "add"}${string}`> | "address">>; | ||
@@ -86,2 +87,4 @@ export declare class ResolvedConnectConfig { | ||
_tlsSecuritySource: string | null; | ||
_tlsServerName: string | null; | ||
_tlsServerNameSource: string | null; | ||
_waitUntilAvailable: number | null; | ||
@@ -105,2 +108,3 @@ _waitUntilAvailableSource: string | null; | ||
setTlsCAFile(caFile: string | null, source: string, readFile: (fn: string) => Promise<string>): Promise<boolean>; | ||
setTlsServerName(serverName: string | null, source: string): boolean; | ||
setTlsSecurity(tlsSecurity: string | null, source: string): boolean; | ||
@@ -118,2 +122,3 @@ setWaitUntilAvailable(duration: string | number | Duration | null, source: string): boolean; | ||
get cloudProfile(): string; | ||
get tlsServerName(): string | undefined; | ||
get tlsSecurity(): Exclude<TlsSecurity, "default">; | ||
@@ -120,0 +125,0 @@ get waitUntilAvailable(): number; |
@@ -96,2 +96,4 @@ "use strict"; | ||
_tlsSecuritySource = null; | ||
_tlsServerName = null; | ||
_tlsServerNameSource = null; | ||
_waitUntilAvailable = null; | ||
@@ -110,2 +112,3 @@ _waitUntilAvailableSource = null; | ||
this.setTlsCAFile = this.setTlsCAFile.bind(this); | ||
this.setTlsServerName = this.setTlsServerName.bind(this); | ||
this.setTlsSecurity = this.setTlsSecurity.bind(this); | ||
@@ -183,2 +186,5 @@ this.setWaitUntilAvailable = this.setWaitUntilAvailable.bind(this); | ||
} | ||
setTlsServerName(serverName, source) { | ||
return this._setParam("tlsServerName", serverName, source, validateHost); | ||
} | ||
setTlsSecurity(tlsSecurity, source) { | ||
@@ -247,2 +253,5 @@ return this._setParam("tlsSecurity", tlsSecurity, source, (_tlsSecurity) => { | ||
} | ||
get tlsServerName() { | ||
return this._tlsServerName ?? undefined; | ||
} | ||
get tlsSecurity() { | ||
@@ -283,2 +292,3 @@ return this._tlsSecurity && this._tlsSecurity !== "default" | ||
outputLine("tlsSecurity", this.tlsSecurity, this._tlsSecurity, this._tlsSecuritySource); | ||
outputLine("tlsServerName", this.tlsServerName, this._tlsServerName, this._tlsServerNameSource); | ||
outputLine("waitUntilAvailable", this.waitUntilAvailable, this._waitUntilAvailable, this._waitUntilAvailableSource); | ||
@@ -371,2 +381,3 @@ return output.join("\n"); | ||
tlsCAFile: config.tlsCAFile, | ||
tlsServerName: config.tlsServerName, | ||
tlsSecurity: config.tlsSecurity, | ||
@@ -393,2 +404,3 @@ serverSettings: config.serverSettings, | ||
tlsSecurity: `'tlsSecurity' option`, | ||
tlsServerName: `'tlsServerName' option`, | ||
serverSettings: `'serverSettings' option`, | ||
@@ -419,2 +431,3 @@ waitUntilAvailable: `'waitUntilAvailable' option`, | ||
tlsCAFile: (0, adapter_shared_node_1.getEnv)("EDGEDB_TLS_CA_FILE"), | ||
tlsServerName: (0, adapter_shared_node_1.getEnv)("EDGEDB_TLS_SERVER_NAME"), | ||
tlsSecurity: (0, adapter_shared_node_1.getEnv)("EDGEDB_CLIENT_TLS_SECURITY"), | ||
@@ -436,2 +449,3 @@ waitUntilAvailable: (0, adapter_shared_node_1.getEnv)("EDGEDB_WAIT_UNTIL_AVAILABLE"), | ||
tlsCAFile: `'EDGEDB_TLS_CA_FILE' environment variable`, | ||
tlsServerName: `'EDGEDB_TLS_SERVER_NAME' environment variable`, | ||
tlsSecurity: `'EDGEDB_CLIENT_TLS_SECURITY' environment variable`, | ||
@@ -462,3 +476,3 @@ waitUntilAvailable: `'EDGEDB_WAIT_UNTIL_AVAILABLE' environment variable`, | ||
if (instName !== null) { | ||
const [cloudProfile, database] = await Promise.all([ | ||
const [cloudProfile, _database, branch] = await Promise.all([ | ||
serverUtils | ||
@@ -472,7 +486,21 @@ .readFileUtf8(stashDir, "cloud-profile") | ||
.catch(() => undefined), | ||
serverUtils | ||
.readFileUtf8(stashDir, "branch") | ||
.then((name) => name.trim()) | ||
.catch(() => undefined), | ||
]); | ||
await resolveConfigOptions(resolvedConfig, { instanceName: instName, cloudProfile, database }, { | ||
let database = _database; | ||
if (database !== undefined && branch !== undefined) { | ||
if (database !== branch) { | ||
throw new errors_1.InterfaceError("Both database and branch exist in the config dir and don't match."); | ||
} | ||
else { | ||
database = undefined; | ||
} | ||
} | ||
await resolveConfigOptions(resolvedConfig, { instanceName: instName, cloudProfile, database, branch }, { | ||
instanceName: `project linked instance ('${instName}')`, | ||
cloudProfile: `project defined cloud instance ('${cloudProfile}')`, | ||
database: `project default database`, | ||
branch: `project default branch`, | ||
}, "", serverUtils); | ||
@@ -536,2 +564,4 @@ fromProject = true; | ||
anyOptionsUsed = | ||
resolvedConfig.setTlsServerName(config.tlsServerName ?? null, sources.tlsServerName) || anyOptionsUsed; | ||
anyOptionsUsed = | ||
resolvedConfig.setTlsSecurity(config.tlsSecurity ?? null, sources.tlsSecurity) || anyOptionsUsed; | ||
@@ -732,2 +762,3 @@ anyOptionsUsed = | ||
await handleDSNPart("tls_ca_file", null, config._tlsCAData, (val, _source) => config.setTlsCAFile(val, _source, readFile)); | ||
await handleDSNPart("tls_server_name", null, config._tlsServerName, config.setTlsServerName); | ||
await handleDSNPart("tls_security", null, config._tlsSecurity, config.setTlsSecurity); | ||
@@ -734,0 +765,0 @@ await handleDSNPart("wait_until_available", null, config._waitUntilAvailable, config.setWaitUntilAvailable); |
@@ -76,3 +76,3 @@ "use strict"; | ||
if (!isIPAddress) { | ||
tlsOptions.servername = config.address[0]; | ||
tlsOptions.servername = config.tlsServerName || config.address[0]; | ||
} | ||
@@ -79,0 +79,0 @@ _tlsOptions.set(config, tlsOptions); |
{ | ||
"name": "edgedb", | ||
"version": "1.5.11", | ||
"version": "1.5.12", | ||
"description": "The official Node.js client library for EdgeDB", | ||
@@ -5,0 +5,0 @@ "homepage": "https://edgedb.com/docs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
550702
14328