mirror of https://github.com/apache/lucene.git
SOLR-7468: Enabling debug logging for kerberos connections during tests and trying to fix # of jettys (shards)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1681597 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a545b66008
commit
9caddd385e
|
@ -56,17 +56,24 @@ public class KerberosPlugin extends AuthenticationPlugin {
|
||||||
HttpClientConfigurer kerberosConfigurer = new Krb5HttpClientConfigurer();
|
HttpClientConfigurer kerberosConfigurer = new Krb5HttpClientConfigurer();
|
||||||
Filter kerberosFilter = new KerberosFilter();
|
Filter kerberosFilter = new KerberosFilter();
|
||||||
|
|
||||||
|
final String NAME_RULES_PARAM = "solr.kerberos.name.rules";
|
||||||
|
final String COOKIE_DOMAIN_PARAM = "solr.kerberos.cookie.domain";
|
||||||
|
final String COOKIE_PATH_PARAM = "solr.kerberos.cookie.path";
|
||||||
|
final String PRINCIPAL_PARAM = "solr.kerberos.principal";
|
||||||
|
final String KEYTAB_PARAM = "solr.kerberos.keytab";
|
||||||
|
final String TOKEN_VALID_PARAM = "solr.kerberos.token.valid";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Map<String, Object> pluginConfig) {
|
public void init(Map<String, Object> pluginConfig) {
|
||||||
try {
|
try {
|
||||||
Map<String, String> params = new HashMap();
|
Map<String, String> params = new HashMap();
|
||||||
params.put("type", "kerberos");
|
params.put("type", "kerberos");
|
||||||
params.put("kerberos.name.rules", System.getProperty("solr.kerberos.name.rules", "DEFAULT"));
|
putParam(params, "kerberos.name.rules", NAME_RULES_PARAM, "DEFAULT");
|
||||||
params.put("token.valid", System.getProperty("solr.kerberos.token.valid", "30"));
|
putParam(params, "token.valid", TOKEN_VALID_PARAM, "30");
|
||||||
params.put("cookie.domain", System.getProperty("solr.kerberos.cookie.domain"));
|
putParam(params, "cookie.domain", COOKIE_DOMAIN_PARAM, null);
|
||||||
params.put("cookie.path", System.getProperty("solr.kerberos.cookie.path", "/"));
|
putParam(params, "cookie.path", COOKIE_PATH_PARAM, "/");
|
||||||
params.put("kerberos.principal", System.getProperty("solr.kerberos.principal"));
|
putParam(params, "kerberos.principal", PRINCIPAL_PARAM, null);
|
||||||
params.put("kerberos.keytab", System.getProperty("solr.kerberos.keytab"));
|
putParam(params, "kerberos.keytab", KEYTAB_PARAM, null);
|
||||||
|
|
||||||
log.info("Params: "+params);
|
log.info("Params: "+params);
|
||||||
|
|
||||||
|
@ -98,6 +105,14 @@ public class KerberosPlugin extends AuthenticationPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void putParam(Map<String, String> params, String internalParamName, String externalParamName, String defaultValue) {
|
||||||
|
String value = System.getProperty(externalParamName, defaultValue);
|
||||||
|
if (value==null) {
|
||||||
|
throw new SolrException(ErrorCode.SERVER_ERROR, "Missing required parameter '"+externalParamName+"'.");
|
||||||
|
}
|
||||||
|
params.put(internalParamName, value);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAuthenticate(ServletRequest req, ServletResponse rsp,
|
public void doAuthenticate(ServletRequest req, ServletResponse rsp,
|
||||||
FilterChain chain) throws Exception {
|
FilterChain chain) throws Exception {
|
||||||
|
|
|
@ -61,6 +61,10 @@ public class TestSolrCloudWithKerberos extends AbstractFullDistribZkTestBase {
|
||||||
if (brokenLocales.contains(Locale.getDefault().toString())) {
|
if (brokenLocales.contains(Locale.getDefault().toString())) {
|
||||||
Locale.setDefault(Locale.US);
|
Locale.setDefault(Locale.US);
|
||||||
}
|
}
|
||||||
|
// Use just one jetty
|
||||||
|
this.sliceCount = 0;
|
||||||
|
this.fixShardCount(1);
|
||||||
|
|
||||||
setupMiniKdc();
|
setupMiniKdc();
|
||||||
super.distribSetUp();
|
super.distribSetUp();
|
||||||
//useExternalKdc();
|
//useExternalKdc();
|
||||||
|
@ -72,6 +76,8 @@ public class TestSolrCloudWithKerberos extends AbstractFullDistribZkTestBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupMiniKdc() throws Exception {
|
private void setupMiniKdc() throws Exception {
|
||||||
|
System.setProperty("solr.jaas.debug", "true");
|
||||||
|
|
||||||
String kdcDir = createTempDir()+File.separator+"minikdc";
|
String kdcDir = createTempDir()+File.separator+"minikdc";
|
||||||
kdc = KerberosTestUtil.getKdc(new File(kdcDir));
|
kdc = KerberosTestUtil.getKdc(new File(kdcDir));
|
||||||
File keytabFile = new File(kdcDir, "keytabs");
|
File keytabFile = new File(kdcDir, "keytabs");
|
||||||
|
|
Loading…
Reference in New Issue