use of com.github.tomakehurst.wiremock.security.NoAuthenticator in project wiremock by wiremock.
the class CommandLineOptions method toString.
@Override
public String toString() {
ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
if (actualHttpPort != null) {
builder.put(PORT, actualHttpPort);
}
if (actualHttpsPort != null) {
builder.put(HTTPS_PORT, actualHttpsPort);
}
if (httpsSettings().enabled()) {
builder.put(HTTPS_KEYSTORE, nullToString(httpsSettings().keyStorePath()));
}
if (!(proxyVia() == NO_PROXY)) {
builder.put(PROXY_VIA, proxyVia());
}
if (proxyUrl() != null) {
builder.put(PROXY_ALL, nullToString(proxyUrl())).put(PRESERVE_HOST_HEADER, shouldPreserveHostHeader());
}
BrowserProxySettings browserProxySettings = browserProxySettings();
builder.put(ENABLE_BROWSER_PROXYING, browserProxySettings.enabled());
if (browserProxySettings.enabled()) {
KeyStoreSettings keyStoreSettings = browserProxySettings.caKeyStore();
builder.put(TRUST_ALL_PROXY_TARGETS, browserProxySettings.trustAllProxyTargets());
List<String> trustedProxyTargets = browserProxySettings.trustedProxyTargets();
if (!trustedProxyTargets.isEmpty()) {
builder.put(TRUST_PROXY_TARGET, Joiner.on(", ").join(trustedProxyTargets));
}
builder.put(HTTPS_CA_KEYSTORE, keyStoreSettings.path());
builder.put(HTTPS_CA_KEYSTORE_TYPE, keyStoreSettings.type());
}
builder.put(DISABLE_BANNER, bannerDisabled());
if (recordMappingsEnabled()) {
builder.put(RECORD_MAPPINGS, recordMappingsEnabled()).put(MATCH_HEADERS, matchingHeaders());
}
builder.put(DISABLE_REQUEST_JOURNAL, requestJournalDisabled()).put(VERBOSE, verboseLoggingEnabled());
if (jettySettings().getAcceptQueueSize().isPresent()) {
builder.put(JETTY_ACCEPT_QUEUE_SIZE, jettySettings().getAcceptQueueSize().get());
}
if (jettySettings().getAcceptors().isPresent()) {
builder.put(JETTY_ACCEPTOR_THREAD_COUNT, jettySettings().getAcceptors().get());
}
if (jettySettings().getRequestHeaderSize().isPresent()) {
builder.put(JETTY_HEADER_BUFFER_SIZE, jettySettings().getRequestHeaderSize().get());
}
if (!(getAdminAuthenticator() instanceof NoAuthenticator)) {
builder.put(ADMIN_API_BASIC_AUTH, "enabled");
}
if (getHttpsRequiredForAdminApi()) {
builder.put(ADMIN_API_REQUIRE_HTTPS, "true");
}
StringBuilder sb = new StringBuilder();
for (Map.Entry<String, Object> param : builder.build().entrySet()) {
int paddingLength = 29 - param.getKey().length();
sb.append(param.getKey()).append(":").append(Strings.repeat(" ", paddingLength)).append(nullToString(param.getValue())).append("\n");
}
return sb.toString();
}
use of com.github.tomakehurst.wiremock.security.NoAuthenticator in project wiremock by wiremock.
the class JettyHttpServerTest method init.
@BeforeEach
public void init() {
Admin admin = Mockito.mock(Admin.class);
adminRequestHandler = new AdminRequestHandler(AdminRoutes.defaults(), admin, new BasicResponseRenderer(), new NoAuthenticator(), false, Collections.<RequestFilter>emptyList());
stubRequestHandler = new StubRequestHandler(Mockito.mock(StubServer.class), Mockito.mock(ResponseRenderer.class), admin, Collections.<String, PostServeAction>emptyMap(), Mockito.mock(RequestJournal.class), Collections.<RequestFilter>emptyList(), false);
}
use of com.github.tomakehurst.wiremock.security.NoAuthenticator in project wiremock by wiremock.
the class AdminRequestHandlerTest method init.
@BeforeEach
public void init() {
httpResponder = new MockHttpResponder();
handler = new AdminRequestHandler(AdminRoutes.defaults(), admin, new BasicResponseRenderer(), new NoAuthenticator(), false, Collections.<RequestFilter>emptyList());
}
Aggregations