bhaveshamre commented on code in PR #910:
URL: https://github.com/apache/ranger/pull/910#discussion_r3072649380
##########
kms/src/main/java/org/apache/hadoop/crypto/key/RangerGoogleCloudHSMProvider.java:
##########
@@ -221,4 +220,24 @@ private static void updateEnv(String name, String val)
throws ReflectiveOperatio
writeAbleEnvMap.put(name, val);
}
+
+ private boolean masterKeyExists() throws Throwable {
+ if (this.client == null) {
+ throw new RuntimeCryptoException("Google Cloud KMS client is not
initialized; call onInitialization() first.");
+ }
+
+ CryptoKeyName keyName = CryptoKeyName.of(this.gcpProjectId,
this.gcpLocationId, this.gcpKeyRingId, this.gcpMasterKeyName);
+
+ try {
+ CryptoKey cryptoKey = this.client.getCryptoKey(keyName);
+ logger.info("Ranger masterKey present with name: {}",
cryptoKey.getName());
+ return true;
Review Comment:
@vikaskr22 addressed the comments and made the necessary changes. Please
review.
--
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]