Skip to content

Commit 38a36e5

Browse files
committed
fix snowflake private key handling
1 parent 0234368 commit 38a36e5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ function convertIntegrationConfigToJson(config: IntegrationConfig): string {
146146
}
147147

148148
// For key-pair auth, pass the private key and passphrase as params
149-
params.private_key = config.privateKey;
149+
params.snowflake_private_key = Buffer.from(config.privateKey).toString('base64');
150150
if (config.privateKeyPassphrase) {
151-
params.private_key_passphrase = config.privateKeyPassphrase;
151+
params.snowflake_private_key_passphrase = config.privateKeyPassphrase;
152152
}
153153
}
154154

src/platform/notebooks/deepnote/sqlIntegrationEnvironmentVariablesProvider.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,8 +489,8 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
489489
'snowflake://service_account@keypair-account/PROD_DB?warehouse=ETL_WH&role=ETL_ROLE&authenticator=snowflake_jwt&application=Deepnote'
490490
);
491491
assert.deepStrictEqual(credentialsJson.params, {
492-
private_key: privateKey,
493-
private_key_passphrase: 'passphrase123'
492+
snowflake_private_key: Buffer.from(privateKey).toString('base64'),
493+
snowflake_private_key_passphrase: 'passphrase123'
494494
});
495495
assert.strictEqual(credentialsJson.param_style, 'format');
496496
});
@@ -530,7 +530,7 @@ suite('SqlIntegrationEnvironmentVariablesProvider', () => {
530530
'snowflake://svc_user@account123/DB?warehouse=WH&authenticator=snowflake_jwt&application=Deepnote'
531531
);
532532
assert.deepStrictEqual(credentialsJson.params, {
533-
private_key: privateKey
533+
snowflake_private_key: Buffer.from(privateKey).toString('base64')
534534
});
535535
});
536536

0 commit comments

Comments
 (0)