Skip to content

Commit

Permalink
fix #2814 Refactor authentication property key to AUTHENTICATIONS_PRO…
Browse files Browse the repository at this point in the history
…PERTY in DataConfig and WebConfig
  • Loading branch information
marevol committed May 9, 2024
1 parent ce0dad7 commit 73202e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ public CrawlerClientFactory initializeClientFactory(final Supplier<CrawlerClient
final Credentials credentials = getCredentials(webAuthName, scheme, paramMap);
basicAuthList.add(new AuthenticationImpl(authScope, credentials, authScheme));
}
factoryParamMap.put(HcHttpClient.BASIC_AUTHENTICATIONS_PROPERTY,
basicAuthList.toArray(new Authentication[basicAuthList.size()]));
factoryParamMap.put(HcHttpClient.AUTHENTICATIONS_PROPERTY, basicAuthList.toArray(new Authentication[basicAuthList.size()]));
}

// request header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public CrawlerClientFactory initializeClientFactory(final Supplier<CrawlerClient
for (final WebAuthentication webAuth : webAuthList) {
basicAuthList.add(webAuth.getAuthentication());
}
paramMap.put(HcHttpClient.BASIC_AUTHENTICATIONS_PROPERTY, basicAuthList.toArray(new Authentication[basicAuthList.size()]));
paramMap.put(HcHttpClient.AUTHENTICATIONS_PROPERTY, basicAuthList.toArray(new Authentication[basicAuthList.size()]));

// request header
final List<RequestHeader> requestHeaderList = requestHeaderService.getRequestHeaderList(getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.codelibs.fess.app.service.WebAuthenticationService;
import org.codelibs.fess.crawler.client.CrawlerClientFactory;
import org.codelibs.fess.crawler.client.http.Authentication;
import org.codelibs.fess.crawler.client.http.HcHttpClient;
import org.codelibs.fess.helper.SystemHelper;
import org.codelibs.fess.mylasta.direction.FessConfig;
import org.codelibs.fess.mylasta.direction.FessProp;
Expand Down Expand Up @@ -100,7 +101,7 @@ public void setInitParameterMap(final Map<String, Object> params) {
assertNotNull(initParamMap);
assertEquals(0, ((org.codelibs.fess.crawler.client.http.RequestHeader[]) initParamMap.get("requestHeaders")).length);
assertEquals("Mozilla/5.0 (compatible; Fess/98.76; +http://fess.codelibs.org/bot.html)", initParamMap.get("userAgent"));
assertEquals(0, ((Authentication[]) initParamMap.get("basicAuthentications")).length);
assertEquals(0, ((Authentication[]) initParamMap.get(HcHttpClient.AUTHENTICATIONS_PROPERTY)).length);
assertTrue(Boolean.valueOf(initParamMap.get("robotsTxtEnabled").toString()).booleanValue());
}

Expand Down Expand Up @@ -173,7 +174,7 @@ public void setInitParameterMap(final Map<String, Object> params) {
assertNotNull(initParamMap);
assertEquals(0, ((org.codelibs.fess.crawler.client.http.RequestHeader[]) initParamMap.get("requestHeaders")).length);
assertEquals(userAgent, initParamMap.get("userAgent"));
assertEquals(0, ((Authentication[]) initParamMap.get("basicAuthentications")).length);
assertEquals(0, ((Authentication[]) initParamMap.get(HcHttpClient.AUTHENTICATIONS_PROPERTY)).length);
assertFalse(Boolean.valueOf(initParamMap.get("robotsTxtEnabled").toString()).booleanValue());
}
}

0 comments on commit 73202e3

Please sign in to comment.