@squadbase/connectors 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -161,6 +161,7 @@ declare const connectors: {
161
161
  role: ParameterDefinition;
162
162
  warehouse: ParameterDefinition;
163
163
  privateKeyBase64: ParameterDefinition;
164
+ privateKeyPassphrase: ParameterDefinition;
164
165
  }, {
165
166
  executeQuery: ConnectorTool<{
166
167
  connectionId: string;
@@ -481,6 +482,7 @@ declare const snowflakeConnector: ConnectorPlugin<{
481
482
  role: ParameterDefinition;
482
483
  warehouse: ParameterDefinition;
483
484
  privateKeyBase64: ParameterDefinition;
485
+ privateKeyPassphrase: ParameterDefinition;
484
486
  }, {
485
487
  executeQuery: ConnectorTool<{
486
488
  connectionId: string;
package/dist/index.js CHANGED
@@ -271,6 +271,15 @@ var parameters3 = {
271
271
  type: "base64EncodedText",
272
272
  secret: true,
273
273
  required: true
274
+ }),
275
+ privateKeyPassphrase: new ParameterDefinition({
276
+ slug: "private-key-passphrase",
277
+ name: "Snowflake Private Key Passphrase",
278
+ description: "The passphrase for decrypting an encrypted private key. Leave empty if the key is not encrypted.",
279
+ envVarBaseKey: "SNOWFLAKE_PRIVATE_KEY_PASSPHRASE",
280
+ type: "text",
281
+ secret: true,
282
+ required: false
274
283
  })
275
284
  };
276
285
 
@@ -328,13 +337,15 @@ Avoid loading large amounts of data; always include LIMIT in queries.`,
328
337
  const privateKey = Buffer.from(privateKeyBase64, "base64").toString(
329
338
  "utf-8"
330
339
  );
340
+ const privateKeyPass = parameters3.privateKeyPassphrase.tryGetValue(connection);
331
341
  const conn = snowflake.createConnection({
332
342
  account,
333
343
  username: user,
334
344
  role,
335
345
  warehouse,
336
346
  authenticator: "SNOWFLAKE_JWT",
337
- privateKey
347
+ privateKey,
348
+ ...privateKeyPass ? { privateKeyPass } : {}
338
349
  });
339
350
  await new Promise((resolve, reject) => {
340
351
  conn.connect((err) => {
@@ -411,13 +422,15 @@ var snowflakeConnector = new ConnectorPlugin({
411
422
  params[parameters3.privateKeyBase64.slug],
412
423
  "base64"
413
424
  ).toString("utf-8");
425
+ const privateKeyPass = params[parameters3.privateKeyPassphrase.slug] || void 0;
414
426
  const conn = snowflake.createConnection({
415
427
  account: params[parameters3.account.slug],
416
428
  username: params[parameters3.user.slug],
417
429
  role: params[parameters3.role.slug],
418
430
  warehouse: params[parameters3.warehouse.slug],
419
431
  authenticator: "SNOWFLAKE_JWT",
420
- privateKey
432
+ privateKey,
433
+ ...privateKeyPass ? { privateKeyPass } : {}
421
434
  });
422
435
  await new Promise((resolve, reject) => {
423
436
  conn.connect((err) => {
@@ -450,13 +463,15 @@ var snowflakeConnector = new ConnectorPlugin({
450
463
  params[parameters3.privateKeyBase64.slug],
451
464
  "base64"
452
465
  ).toString("utf-8");
466
+ const privateKeyPass = params[parameters3.privateKeyPassphrase.slug] || void 0;
453
467
  const conn = snowflake.createConnection({
454
468
  account: params[parameters3.account.slug],
455
469
  username: params[parameters3.user.slug],
456
470
  role: params[parameters3.role.slug],
457
471
  warehouse: params[parameters3.warehouse.slug],
458
472
  authenticator: "SNOWFLAKE_JWT",
459
- privateKey
473
+ privateKey,
474
+ ...privateKeyPass ? { privateKeyPass } : {}
460
475
  });
461
476
  await new Promise((resolve, reject) => {
462
477
  conn.connect((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squadbase/connectors",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Squadbase Connectors",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",