You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/02/26 16:23:38 UTC

[GitHub] [ozone] xiaoyuyao commented on a change in pull request #1969: HDDS-4874. [SCM HA Security] Implement listCertificates based on role

xiaoyuyao commented on a change in pull request #1969:
URL: https://github.com/apache/ozone/pull/1969#discussion_r583757798



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMCertStore.java
##########
@@ -58,22 +61,43 @@ public void storeValidCertificate(BigInteger serialID,
     lock.lock();
     try {
       // This makes sure that no certificate IDs are reusable.
-      if ((getCertificateByID(serialID, CertType.VALID_CERTS) == null) &&
-          (getCertificateByID(serialID, CertType.REVOKED_CERTS) == null)) {
-        scmMetadataStore.getValidCertsTable().put(serialID, certificate);
-      } else {
-        throw new SCMSecurityException("Conflicting certificate ID");
-      }
+      checkValidCertID(serialID);
+      scmMetadataStore.getValidCertsTable().put(serialID, certificate);
     } finally {
       lock.unlock();
     }
   }
 
+  @Override
+  public void storeValidScmCertificate(BigInteger serialID,

Review comment:
       Can we add a storeValidScmCertificate method with a nodeType parameter instead of storeValidScmCertificate to avoid adding more interface changes in the future?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org