Apply consistent id field names
As with HttpCore an entity should have a consistent id field, named 'id' throughout the entire codebase. This closes #188
This commit is contained in:
parent
a2ebb62881
commit
2744c73471
|
@ -160,7 +160,7 @@ public class TestSPNegoScheme extends LocalServerTestBase {
|
||||||
credentialsProvider.setCredentials(new AuthScope(null, null, -1, null, null), use_jaas_creds);
|
credentialsProvider.setCredentials(new AuthScope(null, null, -1, null, null), use_jaas_creds);
|
||||||
|
|
||||||
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.SPNEGO.ident, nsf)
|
.register(AuthSchemes.SPNEGO.id, nsf)
|
||||||
.build();
|
.build();
|
||||||
this.httpclient = HttpClients.custom()
|
this.httpclient = HttpClients.custom()
|
||||||
.setDefaultAuthSchemeRegistry(authSchemeRegistry)
|
.setDefaultAuthSchemeRegistry(authSchemeRegistry)
|
||||||
|
@ -191,7 +191,7 @@ public class TestSPNegoScheme extends LocalServerTestBase {
|
||||||
credentialsProvider.setCredentials(new AuthScope(null, null, -1, null, null), use_jaas_creds);
|
credentialsProvider.setCredentials(new AuthScope(null, null, -1, null, null), use_jaas_creds);
|
||||||
|
|
||||||
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.SPNEGO.ident, nsf)
|
.register(AuthSchemes.SPNEGO.id, nsf)
|
||||||
.build();
|
.build();
|
||||||
this.httpclient = HttpClients.custom()
|
this.httpclient = HttpClients.custom()
|
||||||
.setDefaultAuthSchemeRegistry(authSchemeRegistry)
|
.setDefaultAuthSchemeRegistry(authSchemeRegistry)
|
||||||
|
|
|
@ -81,10 +81,10 @@ public class TestWindowsNegotiateScheme extends LocalServerTestBase {
|
||||||
// you can contact the server that authenticated you." is associated with SEC_E_DOWNGRADE_DETECTED.
|
// you can contact the server that authenticated you." is associated with SEC_E_DOWNGRADE_DETECTED.
|
||||||
|
|
||||||
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.SPNEGO.ident, new AuthSchemeProvider() {
|
.register(AuthSchemes.SPNEGO.id, new AuthSchemeProvider() {
|
||||||
@Override
|
@Override
|
||||||
public AuthScheme create(final HttpContext context) {
|
public AuthScheme create(final HttpContext context) {
|
||||||
return new WindowsNegotiateSchemeGetTokenFail(AuthSchemes.SPNEGO.ident, "HTTP/example.com");
|
return new WindowsNegotiateSchemeGetTokenFail(AuthSchemes.SPNEGO.id, "HTTP/example.com");
|
||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
final CloseableHttpClient customClient = HttpClientBuilder.create()
|
final CloseableHttpClient customClient = HttpClientBuilder.create()
|
||||||
|
|
|
@ -67,10 +67,10 @@ public class WinHttpClients {
|
||||||
private static HttpClientBuilder createBuilder() {
|
private static HttpClientBuilder createBuilder() {
|
||||||
if (isWinAuthAvailable()) {
|
if (isWinAuthAvailable()) {
|
||||||
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
final Registry<AuthSchemeProvider> authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.BASIC.ident, new BasicSchemeFactory())
|
.register(AuthSchemes.BASIC.id, new BasicSchemeFactory())
|
||||||
.register(AuthSchemes.DIGEST.ident, new DigestSchemeFactory())
|
.register(AuthSchemes.DIGEST.id, new DigestSchemeFactory())
|
||||||
.register(AuthSchemes.NTLM.ident, new WindowsNTLMSchemeFactory(null))
|
.register(AuthSchemes.NTLM.id, new WindowsNTLMSchemeFactory(null))
|
||||||
.register(AuthSchemes.SPNEGO.ident, new WindowsNegotiateSchemeFactory(null))
|
.register(AuthSchemes.SPNEGO.id, new WindowsNegotiateSchemeFactory(null))
|
||||||
.build();
|
.build();
|
||||||
return HttpClientBuilder.create()
|
return HttpClientBuilder.create()
|
||||||
.setDefaultAuthSchemeRegistry(authSchemeRegistry);
|
.setDefaultAuthSchemeRegistry(authSchemeRegistry);
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class WindowsNTLMSchemeFactory implements AuthSchemeProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthScheme create(final HttpContext context) {
|
public AuthScheme create(final HttpContext context) {
|
||||||
return new WindowsNegotiateScheme(AuthSchemes.NTLM.ident, servicePrincipalName);
|
return new WindowsNegotiateScheme(AuthSchemes.NTLM.id, servicePrincipalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class WindowsNegotiateScheme implements AuthScheme {
|
||||||
WindowsNegotiateScheme(final String scheme, final String servicePrincipalName) {
|
WindowsNegotiateScheme(final String scheme, final String servicePrincipalName) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.scheme = (scheme == null) ? AuthSchemes.SPNEGO.ident : scheme;
|
this.scheme = (scheme == null) ? AuthSchemes.SPNEGO.id : scheme;
|
||||||
this.continueNeeded = true;
|
this.continueNeeded = true;
|
||||||
this.servicePrincipalName = servicePrincipalName;
|
this.servicePrincipalName = servicePrincipalName;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class WindowsNegotiateSchemeFactory implements AuthSchemeProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuthScheme create(final HttpContext context) {
|
public AuthScheme create(final HttpContext context) {
|
||||||
return new WindowsNegotiateScheme(AuthSchemes.SPNEGO.ident, servicePrincipalName);
|
return new WindowsNegotiateScheme(AuthSchemes.SPNEGO.id, servicePrincipalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,10 +65,10 @@ public enum AuthSchemes {
|
||||||
*/
|
*/
|
||||||
KERBEROS("Kerberos");
|
KERBEROS("Kerberos");
|
||||||
|
|
||||||
public final String ident;
|
public final String id;
|
||||||
|
|
||||||
AuthSchemes(final String ident) {
|
AuthSchemes(final String id) {
|
||||||
this.ident = ident;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -51,10 +51,10 @@ public enum CookieSpecs {
|
||||||
*/
|
*/
|
||||||
IGNORE_COOKIES("ignoreCookies");
|
IGNORE_COOKIES("ignoreCookies");
|
||||||
|
|
||||||
public final String ident;
|
public final String id;
|
||||||
|
|
||||||
CookieSpecs(final String ident) {
|
CookieSpecs(final String id) {
|
||||||
this.ident = ident;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class AuthSupport {
|
||||||
final char[] password = atColon >= 0 ? userInfo.substring(atColon + 1).toCharArray() : null;
|
final char[] password = atColon >= 0 ? userInfo.substring(atColon + 1).toCharArray() : null;
|
||||||
|
|
||||||
credentialsStore.setCredentials(
|
credentialsStore.setCredentials(
|
||||||
new AuthScope(scheme, authority.getHostName(), authority.getPort(), null, AuthSchemes.BASIC.ident),
|
new AuthScope(scheme, authority.getHostName(), authority.getPort(), null, AuthSchemes.BASIC.id),
|
||||||
new UsernamePasswordCredentials(userName, password));
|
new UsernamePasswordCredentials(userName, password));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,11 +50,11 @@ public final class CookieSpecSupport {
|
||||||
*/
|
*/
|
||||||
public static RegistryBuilder<CookieSpecProvider> createDefaultBuilder(final PublicSuffixMatcher publicSuffixMatcher) {
|
public static RegistryBuilder<CookieSpecProvider> createDefaultBuilder(final PublicSuffixMatcher publicSuffixMatcher) {
|
||||||
return RegistryBuilder.<CookieSpecProvider>create()
|
return RegistryBuilder.<CookieSpecProvider>create()
|
||||||
.register(CookieSpecs.STANDARD.ident, new RFC6265CookieSpecProvider(
|
.register(CookieSpecs.STANDARD.id, new RFC6265CookieSpecProvider(
|
||||||
RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, publicSuffixMatcher))
|
RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, publicSuffixMatcher))
|
||||||
.register(CookieSpecs.STANDARD_STRICT.ident, new RFC6265CookieSpecProvider(
|
.register(CookieSpecs.STANDARD_STRICT.id, new RFC6265CookieSpecProvider(
|
||||||
RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, publicSuffixMatcher))
|
RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, publicSuffixMatcher))
|
||||||
.register(CookieSpecs.IGNORE_COOKIES.ident, new IgnoreSpecProvider());
|
.register(CookieSpecs.IGNORE_COOKIES.id, new IgnoreSpecProvider());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -65,11 +65,11 @@ public class DefaultAuthenticationStrategy implements AuthenticationStrategy {
|
||||||
|
|
||||||
private static final List<String> DEFAULT_SCHEME_PRIORITY =
|
private static final List<String> DEFAULT_SCHEME_PRIORITY =
|
||||||
Collections.unmodifiableList(Arrays.asList(
|
Collections.unmodifiableList(Arrays.asList(
|
||||||
AuthSchemes.SPNEGO.ident,
|
AuthSchemes.SPNEGO.id,
|
||||||
AuthSchemes.KERBEROS.ident,
|
AuthSchemes.KERBEROS.id,
|
||||||
AuthSchemes.NTLM.ident,
|
AuthSchemes.NTLM.id,
|
||||||
AuthSchemes.DIGEST.ident,
|
AuthSchemes.DIGEST.id,
|
||||||
AuthSchemes.BASIC.ident));
|
AuthSchemes.BASIC.id));
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AuthScheme> select(
|
public List<AuthScheme> select(
|
||||||
|
|
|
@ -763,12 +763,12 @@ public class H2AsyncClientBuilder {
|
||||||
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
||||||
if (authSchemeRegistryCopy == null) {
|
if (authSchemeRegistryCopy == null) {
|
||||||
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.BASIC.ident, new BasicSchemeFactory())
|
.register(AuthSchemes.BASIC.id, new BasicSchemeFactory())
|
||||||
.register(AuthSchemes.DIGEST.ident, new DigestSchemeFactory())
|
.register(AuthSchemes.DIGEST.id, new DigestSchemeFactory())
|
||||||
.register(AuthSchemes.NTLM.ident, new NTLMSchemeFactory())
|
.register(AuthSchemes.NTLM.id, new NTLMSchemeFactory())
|
||||||
.register(AuthSchemes.SPNEGO.ident,
|
.register(AuthSchemes.SPNEGO.id,
|
||||||
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.register(AuthSchemes.KERBEROS.ident,
|
.register(AuthSchemes.KERBEROS.id,
|
||||||
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -970,12 +970,12 @@ public class HttpAsyncClientBuilder {
|
||||||
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
||||||
if (authSchemeRegistryCopy == null) {
|
if (authSchemeRegistryCopy == null) {
|
||||||
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.BASIC.ident, new BasicSchemeFactory())
|
.register(AuthSchemes.BASIC.id, new BasicSchemeFactory())
|
||||||
.register(AuthSchemes.DIGEST.ident, new DigestSchemeFactory())
|
.register(AuthSchemes.DIGEST.id, new DigestSchemeFactory())
|
||||||
.register(AuthSchemes.NTLM.ident, new NTLMSchemeFactory())
|
.register(AuthSchemes.NTLM.id, new NTLMSchemeFactory())
|
||||||
.register(AuthSchemes.SPNEGO.ident,
|
.register(AuthSchemes.SPNEGO.id,
|
||||||
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.register(AuthSchemes.KERBEROS.ident,
|
.register(AuthSchemes.KERBEROS.id,
|
||||||
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class SystemDefaultCredentialsProvider implements CredentialsStore {
|
||||||
if (domain != null) {
|
if (domain != null) {
|
||||||
return new NTCredentials(systemcreds.getUserName(), systemcreds.getPassword(), null, domain);
|
return new NTCredentials(systemcreds.getUserName(), systemcreds.getPassword(), null, domain);
|
||||||
}
|
}
|
||||||
if (AuthSchemes.NTLM.ident.equalsIgnoreCase(authScope.getAuthScheme())) {
|
if (AuthSchemes.NTLM.id.equalsIgnoreCase(authScope.getAuthScheme())) {
|
||||||
// Domain may be specified in a fully qualified user name
|
// Domain may be specified in a fully qualified user name
|
||||||
return new NTCredentials(
|
return new NTCredentials(
|
||||||
systemcreds.getUserName(), systemcreds.getPassword(), null, null);
|
systemcreds.getUserName(), systemcreds.getPassword(), null, null);
|
||||||
|
|
|
@ -942,11 +942,11 @@ public class HttpClientBuilder {
|
||||||
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
Lookup<AuthSchemeProvider> authSchemeRegistryCopy = this.authSchemeRegistry;
|
||||||
if (authSchemeRegistryCopy == null) {
|
if (authSchemeRegistryCopy == null) {
|
||||||
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
authSchemeRegistryCopy = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.BASIC.ident, new BasicSchemeFactory())
|
.register(AuthSchemes.BASIC.id, new BasicSchemeFactory())
|
||||||
.register(AuthSchemes.DIGEST.ident, new DigestSchemeFactory())
|
.register(AuthSchemes.DIGEST.id, new DigestSchemeFactory())
|
||||||
.register(AuthSchemes.NTLM.ident, new NTLMSchemeFactory())
|
.register(AuthSchemes.NTLM.id, new NTLMSchemeFactory())
|
||||||
.register(AuthSchemes.SPNEGO.ident, new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
.register(AuthSchemes.SPNEGO.id, new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.register(AuthSchemes.KERBEROS.ident, new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
.register(AuthSchemes.KERBEROS.id, new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
Lookup<CookieSpecProvider> cookieSpecRegistryCopy = this.cookieSpecRegistry;
|
Lookup<CookieSpecProvider> cookieSpecRegistryCopy = this.cookieSpecRegistry;
|
||||||
|
|
|
@ -115,12 +115,12 @@ public class ProxyClient {
|
||||||
this.authenticator = new HttpAuthenticator();
|
this.authenticator = new HttpAuthenticator();
|
||||||
this.proxyAuthExchange = new AuthExchange();
|
this.proxyAuthExchange = new AuthExchange();
|
||||||
this.authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
this.authSchemeRegistry = RegistryBuilder.<AuthSchemeProvider>create()
|
||||||
.register(AuthSchemes.BASIC.ident, new BasicSchemeFactory())
|
.register(AuthSchemes.BASIC.id, new BasicSchemeFactory())
|
||||||
.register(AuthSchemes.DIGEST.ident, new DigestSchemeFactory())
|
.register(AuthSchemes.DIGEST.id, new DigestSchemeFactory())
|
||||||
.register(AuthSchemes.NTLM.ident, new NTLMSchemeFactory())
|
.register(AuthSchemes.NTLM.id, new NTLMSchemeFactory())
|
||||||
.register(AuthSchemes.SPNEGO.ident,
|
.register(AuthSchemes.SPNEGO.id,
|
||||||
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new SPNegoSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.register(AuthSchemes.KERBEROS.ident,
|
.register(AuthSchemes.KERBEROS.id,
|
||||||
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
new KerberosSchemeFactory(KerberosConfig.DEFAULT, SystemDefaultDnsResolver.INSTANCE))
|
||||||
.build();
|
.build();
|
||||||
this.reuseStrategy = new DefaultConnectionReuseStrategy();
|
this.reuseStrategy = new DefaultConnectionReuseStrategy();
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class RequestAddCookies implements HttpRequestInterceptor {
|
||||||
final RequestConfig config = clientContext.getRequestConfig();
|
final RequestConfig config = clientContext.getRequestConfig();
|
||||||
String policy = config.getCookieSpec();
|
String policy = config.getCookieSpec();
|
||||||
if (policy == null) {
|
if (policy == null) {
|
||||||
policy = CookieSpecs.STANDARD.ident;
|
policy = CookieSpecs.STANDARD.id;
|
||||||
}
|
}
|
||||||
if (this.log.isDebugEnabled()) {
|
if (this.log.isDebugEnabled()) {
|
||||||
this.log.debug("CookieSpec selected: " + policy);
|
this.log.debug("CookieSpec selected: " + policy);
|
||||||
|
|
|
@ -73,10 +73,10 @@ public class TestRequestConfig {
|
||||||
.setRedirectsEnabled(false)
|
.setRedirectsEnabled(false)
|
||||||
.setCircularRedirectsAllowed(true)
|
.setCircularRedirectsAllowed(true)
|
||||||
.setMaxRedirects(100)
|
.setMaxRedirects(100)
|
||||||
.setCookieSpec(CookieSpecs.STANDARD.ident)
|
.setCookieSpec(CookieSpecs.STANDARD.id)
|
||||||
.setProxy(new HttpHost("someproxy"))
|
.setProxy(new HttpHost("someproxy"))
|
||||||
.setTargetPreferredAuthSchemes(Collections.singletonList(AuthSchemes.NTLM.ident))
|
.setTargetPreferredAuthSchemes(Collections.singletonList(AuthSchemes.NTLM.id))
|
||||||
.setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.DIGEST.ident))
|
.setProxyPreferredAuthSchemes(Collections.singletonList(AuthSchemes.DIGEST.id))
|
||||||
.setContentCompressionEnabled(false)
|
.setContentCompressionEnabled(false)
|
||||||
.build();
|
.build();
|
||||||
final RequestConfig config = RequestConfig.copy(config0).build();
|
final RequestConfig config = RequestConfig.copy(config0).build();
|
||||||
|
@ -87,10 +87,10 @@ public class TestRequestConfig {
|
||||||
Assert.assertEquals(false, config.isRedirectsEnabled());
|
Assert.assertEquals(false, config.isRedirectsEnabled());
|
||||||
Assert.assertEquals(true, config.isCircularRedirectsAllowed());
|
Assert.assertEquals(true, config.isCircularRedirectsAllowed());
|
||||||
Assert.assertEquals(100, config.getMaxRedirects());
|
Assert.assertEquals(100, config.getMaxRedirects());
|
||||||
Assert.assertEquals(CookieSpecs.STANDARD.ident, config.getCookieSpec());
|
Assert.assertEquals(CookieSpecs.STANDARD.id, config.getCookieSpec());
|
||||||
Assert.assertEquals(new HttpHost("someproxy"), config.getProxy());
|
Assert.assertEquals(new HttpHost("someproxy"), config.getProxy());
|
||||||
Assert.assertEquals(Collections.singletonList(AuthSchemes.NTLM.ident), config.getTargetPreferredAuthSchemes());
|
Assert.assertEquals(Collections.singletonList(AuthSchemes.NTLM.id), config.getTargetPreferredAuthSchemes());
|
||||||
Assert.assertEquals(Collections.singletonList(AuthSchemes.DIGEST.ident), config.getProxyPreferredAuthSchemes());
|
Assert.assertEquals(Collections.singletonList(AuthSchemes.DIGEST.id), config.getProxyPreferredAuthSchemes());
|
||||||
Assert.assertEquals(false, config.isContentCompressionEnabled());
|
Assert.assertEquals(false, config.isContentCompressionEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,10 +193,10 @@ public class ClientConfiguration {
|
||||||
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
|
||||||
// Create global request configuration
|
// Create global request configuration
|
||||||
final RequestConfig defaultRequestConfig = RequestConfig.custom()
|
final RequestConfig defaultRequestConfig = RequestConfig.custom()
|
||||||
.setCookieSpec(CookieSpecs.STANDARD.ident)
|
.setCookieSpec(CookieSpecs.STANDARD.id)
|
||||||
.setExpectContinueEnabled(true)
|
.setExpectContinueEnabled(true)
|
||||||
.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM.ident, AuthSchemes.DIGEST.ident))
|
.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM.id, AuthSchemes.DIGEST.id))
|
||||||
.setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC.ident))
|
.setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC.id))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Create an HttpClient with the given custom dependencies and configuration.
|
// Create an HttpClient with the given custom dependencies and configuration.
|
||||||
|
|
|
@ -63,8 +63,8 @@ public class ClientCustomPublicSuffixList {
|
||||||
|
|
||||||
final RFC6265CookieSpecProvider cookieSpecProvider = new RFC6265CookieSpecProvider(publicSuffixMatcher);
|
final RFC6265CookieSpecProvider cookieSpecProvider = new RFC6265CookieSpecProvider(publicSuffixMatcher);
|
||||||
final Lookup<CookieSpecProvider> cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
|
final Lookup<CookieSpecProvider> cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
|
||||||
.register(CookieSpecs.STANDARD.ident, cookieSpecProvider)
|
.register(CookieSpecs.STANDARD.id, cookieSpecProvider)
|
||||||
.register(CookieSpecs.STANDARD_STRICT.ident, cookieSpecProvider)
|
.register(CookieSpecs.STANDARD_STRICT.id, cookieSpecProvider)
|
||||||
.build();
|
.build();
|
||||||
final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
|
final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
|
||||||
SSLContexts.createDefault(),
|
SSLContexts.createDefault(),
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class TestAuthenticationStrategy {
|
||||||
public void testCustomAuthPreference() throws Exception {
|
public void testCustomAuthPreference() throws Exception {
|
||||||
final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
|
final DefaultAuthenticationStrategy authStrategy = new DefaultAuthenticationStrategy();
|
||||||
final RequestConfig config = RequestConfig.custom()
|
final RequestConfig config = RequestConfig.custom()
|
||||||
.setTargetPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC.ident))
|
.setTargetPreferredAuthSchemes(Collections.singletonList(AuthSchemes.BASIC.id))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final HttpClientContext context = HttpClientContext.create();
|
final HttpClientContext context = HttpClientContext.create();
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class TestHttpAuthenticator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return AuthSchemes.BASIC.ident;
|
return AuthSchemes.BASIC.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,11 +76,11 @@ public class TestRequestAddCookies {
|
||||||
this.cookieStore.addCookie(cookie2);
|
this.cookieStore.addCookie(cookie2);
|
||||||
|
|
||||||
this.cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
|
this.cookieSpecRegistry = RegistryBuilder.<CookieSpecProvider>create()
|
||||||
.register(CookieSpecs.STANDARD.ident, new RFC6265CookieSpecProvider(
|
.register(CookieSpecs.STANDARD.id, new RFC6265CookieSpecProvider(
|
||||||
RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, null))
|
RFC6265CookieSpecProvider.CompatibilityLevel.RELAXED, null))
|
||||||
.register(CookieSpecs.STANDARD_STRICT.ident, new RFC6265CookieSpecProvider(
|
.register(CookieSpecs.STANDARD_STRICT.id, new RFC6265CookieSpecProvider(
|
||||||
RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, null))
|
RFC6265CookieSpecProvider.CompatibilityLevel.STRICT, null))
|
||||||
.register(CookieSpecs.IGNORE_COOKIES.ident, new IgnoreSpecProvider())
|
.register(CookieSpecs.IGNORE_COOKIES.id, new IgnoreSpecProvider())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ public class TestRequestAddCookies {
|
||||||
public void testAddCookiesUsingExplicitCookieSpec() throws Exception {
|
public void testAddCookiesUsingExplicitCookieSpec() throws Exception {
|
||||||
final HttpRequest request = new BasicHttpRequest("GET", "/");
|
final HttpRequest request = new BasicHttpRequest("GET", "/");
|
||||||
final RequestConfig config = RequestConfig.custom()
|
final RequestConfig config = RequestConfig.custom()
|
||||||
.setCookieSpec(CookieSpecs.STANDARD_STRICT.ident)
|
.setCookieSpec(CookieSpecs.STANDARD_STRICT.id)
|
||||||
.build();
|
.build();
|
||||||
final HttpRoute route = new HttpRoute(this.target, null, false);
|
final HttpRoute route = new HttpRoute(this.target, null, false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue