You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2020/03/23 15:27:44 UTC

[GitHub] [storm] nd368 opened a new pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java

nd368 opened a new pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java
URL: https://github.com/apache/storm/pull/3232
 
 
   

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


With regards,
Apache Git Services

[GitHub] [storm] nd368 commented on issue #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java

Posted by GitBox <gi...@apache.org>.
nd368 commented on issue #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java
URL: https://github.com/apache/storm/pull/3232#issuecomment-612385184
 
 
   changes made - thanks for 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [storm] Ethanlm commented on a change in pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java

Posted by GitBox <gi...@apache.org>.
Ethanlm commented on a change in pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java
URL: https://github.com/apache/storm/pull/3232#discussion_r407524795
 
 

 ##########
 File path: storm-client/test/jvm/org/apache/storm/security/auth/AutoLoginModuleTest.java
 ##########
 @@ -0,0 +1,128 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.storm.security.auth;
 
 Review comment:
   Since this is really testing `org.apache.storm.security.auth.kerberos.AutoTGTKrb5LoginModule`, can we move the unit test to `storm-client/test/jvm/org/apache/storm/security/auth/kerberos/AutoLoginModuleTest.java`? Thanks

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


With regards,
Apache Git Services

[GitHub] [storm] Ethanlm commented on a change in pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java

Posted by GitBox <gi...@apache.org>.
Ethanlm commented on a change in pull request #3232: [STORM-1241] port storm.security.auth.auto-login-module-test to java
URL: https://github.com/apache/storm/pull/3232#discussion_r404988871
 
 

 ##########
 File path: storm-core/test/jvm/org/apache/storm/security/auth/AutoLoginModuleTest.java
 ##########
 @@ -0,0 +1,128 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.storm.security.auth;
+
+import org.apache.storm.security.auth.kerberos.AutoTGTKrb5LoginModule;
+import org.apache.storm.security.auth.kerberos.AutoTGTKrb5LoginModuleTest;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import javax.security.auth.Subject;
+import javax.security.auth.kerberos.KerberosPrincipal;
+import javax.security.auth.kerberos.KerberosTicket;
+import javax.security.auth.login.LoginException;
+import java.net.InetAddress;
+import java.security.Principal;
+import java.text.SimpleDateFormat;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class AutoLoginModuleTest {
+
+    @Test
+    public void loginModuleNoSubjNoTgtTest() throws Exception {
+        // Behavior is correct when there is no Subject or TGT
+        AutoTGTKrb5LoginModule loginModule = new AutoTGTKrb5LoginModule();
+        Assertions.assertThrows(LoginException.class, loginModule::login);
+        assertThat(loginModule.commit(), is(false));
 
 Review comment:
   use `assertFalse` here and below?

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


With regards,
Apache Git Services