davidhcoe commented on code in PR #1207:
URL: https://github.com/apache/arrow-adbc/pull/1207#discussion_r1371872774
##########
go/adbc/driver/snowflake/snowflake_database.go:
##########
@@ -335,6 +338,37 @@ func (d *databaseImpl) SetOptions(cnOptions
map[string]string) error {
Code: adbc.StatusInvalidArgument,
}
}
+ case OptionJwtPrivateKeyPkcs8Value:
+ block, _ := pem.Decode([]byte(v))
+
+ if block == nil {
+ panic("Failed to parse PEM block containing the
private key")
+ }
+
+ var parsedKey any
+
+ if block.Type == "ENCRYPTED PRIVATE KEY" {
+ passcode, ok :=
cnOptions[OptionJwtPrivateKeyPkcs8Password]
+ if ok {
+ parsedKey, err =
pkcs8.ParsePKCS8PrivateKey(block.Bytes, []byte(passcode))
+ } else {
+ panic(OptionJwtPrivateKeyPkcs8Password
+ " is not configured")
+ }
+ } else if block.Type == "PRIVATE KEY" {
+ parsedKey, err =
pkcs8.ParsePKCS8PrivateKey(block.Bytes)
+ } else {
+ panic(block.Type + " is not supported")
Review Comment:
resolved in latest push
##########
go/adbc/driver/snowflake/snowflake_database.go:
##########
@@ -335,6 +338,37 @@ func (d *databaseImpl) SetOptions(cnOptions
map[string]string) error {
Code: adbc.StatusInvalidArgument,
}
}
+ case OptionJwtPrivateKeyPkcs8Value:
+ block, _ := pem.Decode([]byte(v))
+
+ if block == nil {
+ panic("Failed to parse PEM block containing the
private key")
+ }
+
+ var parsedKey any
+
+ if block.Type == "ENCRYPTED PRIVATE KEY" {
+ passcode, ok :=
cnOptions[OptionJwtPrivateKeyPkcs8Password]
+ if ok {
+ parsedKey, err =
pkcs8.ParsePKCS8PrivateKey(block.Bytes, []byte(passcode))
+ } else {
+ panic(OptionJwtPrivateKeyPkcs8Password
+ " is not configured")
Review Comment:
resolved in latest push
--
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]