You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by "lprimak (via GitHub)" <gi...@apache.org> on 2023/06/22 03:27:09 UTC

[GitHub] [shiro] lprimak commented on a diff in pull request #831: Refactor 2

lprimak commented on code in PR #831:
URL: https://github.com/apache/shiro/pull/831#discussion_r1237947489


##########
web/src/main/java/org/apache/shiro/web/filter/authc/FormAuthenticationFilter.java:
##########
@@ -30,6 +31,39 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
+/**

Review Comment:
   Just like I said in #824 Please remove this extraction. It's not deserving of it's own class



##########
web/src/test/java/org/apache/shiro/web/servlet/SimpleCookieTest.java:
##########
@@ -157,12 +157,27 @@ private static <T extends javax.servlet.http.Cookie> T eqCookie(final T in) {
         reportMatcher(new IArgumentMatcher() {
             public boolean matches(Object o) {
                 javax.servlet.http.Cookie c = (javax.servlet.http.Cookie) o;
-                return c.getName().equals(in.getName()) &&

Review Comment:
   I am not sure I see the value of this either, but I can see if this is OK too, so not too opinionated on this.



##########
crypto/support/hashes/argon2/src/main/java/org/apache/shiro/crypto/support/hashes/argon2/Argon2Hash.java:
##########
@@ -209,17 +209,21 @@ public static Argon2Hash generate(
             int outputLengthBits
     ) {
         final int type;
+        Argon2Algorithm algorithm;
         switch (requireNonNull(algorithmName, "algorithmName")) {
             case "argon2i":
-                type = Argon2Parameters.ARGON2_i;
+                algorithm = new Argon2iAlgorithm();
+                type = algorithm.getType();
                 break;
             case "argon2d":
-                type = Argon2Parameters.ARGON2_d;
+                algorithm = new Argon2dAlgorithm();
+                type = algorithm.getType();
                 break;
             case "argon2":
                 // fall through
             case "argon2id":
-                type = Argon2Parameters.ARGON2_id;
+                algorithm = new Argon2idAlgorithm();
+                type = algorithm.getType();
                 break;

Review Comment:
   Same as in #824 Please remove this refactor. It brings no value.



-- 
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: commits-unsubscribe@shiro.apache.org

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