villebro commented on code in PR #21322:
URL: https://github.com/apache/superset/pull/21322#discussion_r963278418


##########
docs/docs/databases/snowflake.mdx:
##########
@@ -29,3 +29,38 @@ user/role rights during engine creation by default. However, 
when pressing the 
 button in the Create or Edit Database dialog, user/role credentials are 
validated by passing
 “validate_default_parameters”: True to the connect() method during engine 
creation. If the user/role
 is not authorized to access the database, an error is recorded in the Superset 
logs.
+
+And if you want connect Snowflake with [Key Pair 
Authentication](https://docs.snowflake.com/en/user-guide/key-pair-auth.html#step-6-configure-the-snowflake-client-to-use-key-pair-authentication).
+Plase make sure you have the key pair and the public key is registered in 
Snowflake.
+To connect Snowflake with Key Pair Authentication, you need to add the 
following parameters to "SECURE EXTRA" field.
+
+***Please note that you need to split your private key content line by line 
before store it to privatekey_body*** 
+
+```
+{
+    "auth_method": "keypair", 
+    "auth_params": {
+        "privatekey_body":[
+            "-----BEGIN ENCRYPTED PRIVATE KEY-----",
+            "Key Body",
+            "Key Body",
+            "Key Body",
+            "Key Body",
+            "-----END ENCRYPTED PRIVATE KEY-----"
+        ],
+        "privatekey_pass":"Your Private Key Password"
+    }
+}
+```

Review Comment:
   While JSON isn't ideal for storing multiline strings, maybe we should just 
store it with the newlines replaced by a `\n` as follows:
   ```json
   {
        "auth_method": "keypair", 
        "auth_params": {
            "privatekey_body": "-----BEGIN ENCRYPTED PRIVATE 
KEY-----\n...\n-----END ENCRYPTED PRIVATE KEY-----",
            "privatekey_pass":"Your Private Key Password"
        }
    }
   ```
   Later when we consolidate this type of logic across all db engine specs we 
can then move the private key to a separate column in the database model and 
have a dedicated field in the UI that accepts the string with newlines. WDYT 
@xiayanzheng @dpgaspar ?



##########
requirements/testing.txt:
##########
@@ -136,7 +136,6 @@ websocket-client==1.2.0
     # via docker
 wrapt==1.12.1
     # via astroid
-

Review Comment:
   Let's add the removed newline to avoid introducing unnecessary changes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to