Skip to content

Commit

Permalink
ARTEMIS-3168 - isolate from leaked login.config system property by se…
Browse files Browse the repository at this point in the history
…ting baseDir option
  • Loading branch information
gtully committed Dec 2, 2022
1 parent d95321b commit 0004e52
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.io.File;
import java.util.Collections;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -138,8 +139,7 @@ public void testUnableToVerifyToken() throws LoginException {
}

private Map<String, ?> getDefaultOptions() {
return Map.of(K8S_ROLE_FILE_PROP_NAME,
// java.security.auth.login.config not set to provide baseDir so configure full path
KubernetesLoginModuleTest.class.getClassLoader().getResource("k8s-roles.properties").getPath());
String baseDirValue = new File(KubernetesLoginModuleTest.class.getClassLoader().getResource("k8s-roles.properties").getPath()).getParentFile().getAbsolutePath();
return Map.of(K8S_ROLE_FILE_PROP_NAME, "k8s-roles.properties", "baseDir",baseDirValue);
}
}

0 comments on commit 0004e52

Please sign in to comment.