You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/02/03 21:34:35 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #2457: Refactor AuthenticationTokenIdentifier & DelegationTokenImpl

ctubbsii commented on a change in pull request #2457:
URL: https://github.com/apache/accumulo/pull/2457#discussion_r798984748



##########
File path: server/base/src/test/java/org/apache/accumulo/server/rpc/SaslDigestCallbackHandlerTest.java
##########
@@ -107,11 +108,11 @@ public void testTokenSerialization() throws Exception {
   @Test
   public void testTokenAndIdentifierSerialization() throws Exception {
     AuthenticationTokenSecretManager secretManager =
-        new AuthenticationTokenSecretManager("instanceid", 1000L);
 
-    secretManager.addKey(new AuthenticationKey(1, 0L, 1000 * 100L, keyGen.generateKey()));
-    Entry<Token<AuthenticationTokenIdentifier>,AuthenticationTokenIdentifier> entry =
-        secretManager.generateToken("user", cfg);
+        new AuthenticationTokenSecretManager("instanceid", 1000L);
+    var key = new AuthenticationKey(1, 0L, 1000 * 100L, keyGen.generateKey());

Review comment:
       ```suggestion
       var key = new AuthenticationKey(1, 0L, 100_000L, keyGen.generateKey());
   ```

##########
File path: core/src/test/java/org/apache/accumulo/core/security/AuthenticationTokenIdentifierTest.java
##########
@@ -73,14 +80,16 @@ public void testExtendedEquality() {
   @Test
   public void testToString() {
     String principal = "my_special_principal";
-    AuthenticationTokenIdentifier token = new AuthenticationTokenIdentifier(principal);
+    AuthenticationTokenIdentifier token =
+        new AuthenticationTokenIdentifier(new TAuthenticationTokenIdentifier(principal));
     assertTrue(token.toString().contains(principal));
   }
 
   @Test
   public void testSerialization() throws IOException {
     String principal = "my_special_principal";
-    AuthenticationTokenIdentifier token = new AuthenticationTokenIdentifier(principal);
+    AuthenticationTokenIdentifier token =
+        new AuthenticationTokenIdentifier(new TAuthenticationTokenIdentifier(principal));

Review comment:
       ```suggestion
       var token = new AuthenticationTokenIdentifier(new TAuthenticationTokenIdentifier(principal));
   ```




-- 
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: notifications-unsubscribe@accumulo.apache.org

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