diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-04-23 15:32:23 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-04-23 15:32:23 -0400 |
commit | abe80cc31d5a40ebed743085011fbcda0c1a9a10 (patch) | |
tree | fb3762f06b84745b182af281abb107b95a9fcf01 /mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth | |
parent | 63295d0087eb58a6eb34cad324c4c53d1b220491 (diff) | |
download | UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.gz UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.lz UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.xz UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.zip |
Issue #1053 - Drop support Android and remove Fennec - Part 1a: Remove mobile/android
Diffstat (limited to 'mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth')
24 files changed, 0 insertions, 2204 deletions
diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AUTH.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AUTH.java deleted file mode 100644 index a0b50db73..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AUTH.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.annotation.Immutable; - -/** - * Constants and static helpers related to the HTTP authentication. - * - * - * @since 4.0 - */ -@Immutable -public final class AUTH { - - /** - * The www authenticate challange header. - */ - public static final String WWW_AUTH = "WWW-Authenticate"; - - /** - * The www authenticate response header. - */ - public static final String WWW_AUTH_RESP = "Authorization"; - - /** - * The proxy authenticate challange header. - */ - public static final String PROXY_AUTH = "Proxy-Authenticate"; - - /** - * The proxy authenticate response header. - */ - public static final String PROXY_AUTH_RESP = "Proxy-Authorization"; - - private AUTH() { - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthOption.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthOption.java deleted file mode 100644 index ae69df94d..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthOption.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; - -/** - * @since 4.2 - */ -@Immutable -public final class AuthOption { - - private final AuthScheme authScheme; - private final Credentials creds; - - public AuthOption(final AuthScheme authScheme, final Credentials creds) { - super(); - Args.notNull(authScheme, "Auth scheme"); - Args.notNull(creds, "User credentials"); - this.authScheme = authScheme; - this.creds = creds; - } - - public AuthScheme getAuthScheme() { - return this.authScheme; - } - - public Credentials getCredentials() { - return this.creds; - } - - @Override - public String toString() { - return this.authScheme.toString(); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthProtocolState.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthProtocolState.java deleted file mode 100644 index 081838915..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthProtocolState.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -public enum AuthProtocolState { - - UNCHALLENGED, CHALLENGED, HANDSHAKE, FAILURE, SUCCESS - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScheme.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScheme.java deleted file mode 100644 index a028f182d..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScheme.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.Header; -import ch.boye.httpclientandroidlib.HttpRequest; - -/** - * This interface represents an abstract challenge-response oriented - * authentication scheme. - * <p> - * An authentication scheme should be able to support the following - * functions: - * <ul> - * <li>Parse and process the challenge sent by the target server - * in response to request for a protected resource - * <li>Provide its textual designation - * <li>Provide its parameters, if available - * <li>Provide the realm this authentication scheme is applicable to, - * if available - * <li>Generate authorization string for the given set of credentials - * and the HTTP request in response to the authorization challenge. - * </ul> - * <p> - * Authentication schemes may be stateful involving a series of - * challenge-response exchanges. - * <p> - * IMPORTANT: implementations of this interface MUST also implement {@link ContextAwareAuthScheme} - * interface in order to remain API compatible with newer versions of HttpClient. - * - * @since 4.0 - */ - -public interface AuthScheme { - - /** - * Processes the given challenge token. Some authentication schemes - * may involve multiple challenge-response exchanges. Such schemes must be able - * to maintain the state information when dealing with sequential challenges - * - * @param header the challenge header - */ - void processChallenge(final Header header) throws MalformedChallengeException; - - /** - * Returns textual designation of the given authentication scheme. - * - * @return the name of the given authentication scheme - */ - String getSchemeName(); - - /** - * Returns authentication parameter with the given name, if available. - * - * @param name The name of the parameter to be returned - * - * @return the parameter with the given name - */ - String getParameter(final String name); - - /** - * Returns authentication realm. If the concept of an authentication - * realm is not applicable to the given authentication scheme, returns - * <code>null</code>. - * - * @return the authentication realm - */ - String getRealm(); - - /** - * Tests if the authentication scheme is provides authorization on a per - * connection basis instead of usual per request basis - * - * @return <tt>true</tt> if the scheme is connection based, <tt>false</tt> - * if the scheme is request based. - */ - boolean isConnectionBased(); - - /** - * Authentication process may involve a series of challenge-response exchanges. - * This method tests if the authorization process has been completed, either - * successfully or unsuccessfully, that is, all the required authorization - * challenges have been processed in their entirety. - * - * @return <tt>true</tt> if the authentication process has been completed, - * <tt>false</tt> otherwise. - */ - boolean isComplete(); - - /** - * Produces an authorization string for the given set of {@link Credentials}. - * - * @param credentials The set of credentials to be used for athentication - * @param request The request being authenticated - * @throws AuthenticationException if authorization string cannot - * be generated due to an authentication failure - * - * @return the authorization string - * - * @deprecated (4.1) Use {@link ContextAwareAuthScheme#authenticate(Credentials, HttpRequest, ch.boye.httpclientandroidlib.protocol.HttpContext)} - */ - @Deprecated - Header authenticate(Credentials credentials, HttpRequest request) - throws AuthenticationException; - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeFactory.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeFactory.java deleted file mode 100644 index d88a3d06f..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.params.HttpParams; - -/** - * Factory for {@link AuthScheme} implementations. - * - * @since 4.0 - * - * @deprecated (4.3) use {@link AuthSchemeProvider} - */ -@Deprecated -public interface AuthSchemeFactory { - - /** - * Creates an instance of {@link AuthScheme} using given HTTP parameters. - * - * @param params HTTP parameters. - * - * @return auth scheme. - */ - AuthScheme newInstance(HttpParams params); - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeProvider.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeProvider.java deleted file mode 100644 index bfaf3f3cf..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.protocol.HttpContext; - -/** - * Factory for {@link AuthScheme} implementations. - * - * @since 4.3 - */ -public interface AuthSchemeProvider { - - /** - * Creates an instance of {@link AuthScheme}. - * - * @return auth scheme. - */ - AuthScheme create(HttpContext context); - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeRegistry.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeRegistry.java deleted file mode 100644 index 4a6d15ca8..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthSchemeRegistry.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -import ch.boye.httpclientandroidlib.HttpRequest; -import ch.boye.httpclientandroidlib.annotation.ThreadSafe; -import ch.boye.httpclientandroidlib.config.Lookup; -import ch.boye.httpclientandroidlib.params.HttpParams; -import ch.boye.httpclientandroidlib.protocol.ExecutionContext; -import ch.boye.httpclientandroidlib.protocol.HttpContext; -import ch.boye.httpclientandroidlib.util.Args; - -/** - * Authentication scheme registry that can be used to obtain the corresponding - * authentication scheme implementation for a given type of authorization challenge. - * - * @since 4.0 - * - * @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.config.Registry} - */ -@ThreadSafe -@Deprecated -public final class AuthSchemeRegistry implements Lookup<AuthSchemeProvider> { - - private final ConcurrentHashMap<String,AuthSchemeFactory> registeredSchemes; - - public AuthSchemeRegistry() { - super(); - this.registeredSchemes = new ConcurrentHashMap<String,AuthSchemeFactory>(); - } - - /** - * Registers a {@link AuthSchemeFactory} with the given identifier. If a factory with the - * given name already exists it will be overridden. This name is the same one used to - * retrieve the {@link AuthScheme authentication scheme} from {@link #getAuthScheme}. - * - * <p> - * Please note that custom authentication preferences, if used, need to be updated accordingly - * for the new {@link AuthScheme authentication scheme} to take effect. - * </p> - * - * @param name the identifier for this scheme - * @param factory the {@link AuthSchemeFactory} class to register - * - * @see #getAuthScheme - */ - public void register( - final String name, - final AuthSchemeFactory factory) { - Args.notNull(name, "Name"); - Args.notNull(factory, "Authentication scheme factory"); - registeredSchemes.put(name.toLowerCase(Locale.ENGLISH), factory); - } - - /** - * Unregisters the class implementing an {@link AuthScheme authentication scheme} with - * the given name. - * - * @param name the identifier of the class to unregister - */ - public void unregister(final String name) { - Args.notNull(name, "Name"); - registeredSchemes.remove(name.toLowerCase(Locale.ENGLISH)); - } - - /** - * Gets the {@link AuthScheme authentication scheme} with the given name. - * - * @param name the {@link AuthScheme authentication scheme} identifier - * @param params the {@link HttpParams HTTP parameters} for the authentication - * scheme. - * - * @return {@link AuthScheme authentication scheme} - * - * @throws IllegalStateException if a scheme with the given name cannot be found - */ - public AuthScheme getAuthScheme(final String name, final HttpParams params) - throws IllegalStateException { - - Args.notNull(name, "Name"); - final AuthSchemeFactory factory = registeredSchemes.get(name.toLowerCase(Locale.ENGLISH)); - if (factory != null) { - return factory.newInstance(params); - } else { - throw new IllegalStateException("Unsupported authentication scheme: " + name); - } - } - - /** - * Obtains a list containing the names of all registered {@link AuthScheme authentication - * schemes} - * - * @return list of registered scheme names - */ - public List<String> getSchemeNames() { - return new ArrayList<String>(registeredSchemes.keySet()); - } - - /** - * Populates the internal collection of registered {@link AuthScheme authentication schemes} - * with the content of the map passed as a parameter. - * - * @param map authentication schemes - */ - public void setItems(final Map<String, AuthSchemeFactory> map) { - if (map == null) { - return; - } - registeredSchemes.clear(); - registeredSchemes.putAll(map); - } - - public AuthSchemeProvider lookup(final String name) { - return new AuthSchemeProvider() { - - public AuthScheme create(final HttpContext context) { - final HttpRequest request = (HttpRequest) context.getAttribute( - ExecutionContext.HTTP_REQUEST); - return getAuthScheme(name, request.getParams()); - } - - }; - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScope.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScope.java deleted file mode 100644 index b6384729d..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthScope.java +++ /dev/null @@ -1,302 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.util.Locale; - -import ch.boye.httpclientandroidlib.HttpHost; -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; -import ch.boye.httpclientandroidlib.util.LangUtils; - -/** - * The class represents an authentication scope consisting of a host name, - * a port number, a realm name and an authentication scheme name which - * {@link Credentials Credentials} apply to. - * - * - * @since 4.0 - */ -@Immutable -public class AuthScope { - - /** - * The <tt>null</tt> value represents any host. In the future versions of - * HttpClient the use of this parameter will be discontinued. - */ - public static final String ANY_HOST = null; - - /** - * The <tt>-1</tt> value represents any port. - */ - public static final int ANY_PORT = -1; - - /** - * The <tt>null</tt> value represents any realm. - */ - public static final String ANY_REALM = null; - - /** - * The <tt>null</tt> value represents any authentication scheme. - */ - public static final String ANY_SCHEME = null; - - /** - * Default scope matching any host, port, realm and authentication scheme. - * In the future versions of HttpClient the use of this parameter will be - * discontinued. - */ - public static final AuthScope ANY = new AuthScope(ANY_HOST, ANY_PORT, ANY_REALM, ANY_SCHEME); - - /** The authentication scheme the credentials apply to. */ - private final String scheme; - - /** The realm the credentials apply to. */ - private final String realm; - - /** The host the credentials apply to. */ - private final String host; - - /** The port the credentials apply to. */ - private final int port; - - /** Creates a new credentials scope for the given - * <tt>host</tt>, <tt>port</tt>, <tt>realm</tt>, and - * <tt>authentication scheme</tt>. - * - * @param host the host the credentials apply to. May be set - * to <tt>null</tt> if credentials are applicable to - * any host. - * @param port the port the credentials apply to. May be set - * to negative value if credentials are applicable to - * any port. - * @param realm the realm the credentials apply to. May be set - * to <tt>null</tt> if credentials are applicable to - * any realm. - * @param scheme the authentication scheme the credentials apply to. - * May be set to <tt>null</tt> if credentials are applicable to - * any authentication scheme. - */ - public AuthScope(final String host, final int port, - final String realm, final String scheme) - { - this.host = (host == null) ? ANY_HOST: host.toLowerCase(Locale.ENGLISH); - this.port = (port < 0) ? ANY_PORT: port; - this.realm = (realm == null) ? ANY_REALM: realm; - this.scheme = (scheme == null) ? ANY_SCHEME: scheme.toUpperCase(Locale.ENGLISH); - } - - /** - * @since 4.2 - */ - public AuthScope(final HttpHost host, final String realm, final String schemeName) { - this(host.getHostName(), host.getPort(), realm, schemeName); - } - - /** - * @since 4.2 - */ - public AuthScope(final HttpHost host) { - this(host, ANY_REALM, ANY_SCHEME); - } - - /** Creates a new credentials scope for the given - * <tt>host</tt>, <tt>port</tt>, <tt>realm</tt>, and any - * authentication scheme. - * - * @param host the host the credentials apply to. May be set - * to <tt>null</tt> if credentials are applicable to - * any host. - * @param port the port the credentials apply to. May be set - * to negative value if credentials are applicable to - * any port. - * @param realm the realm the credentials apply to. May be set - * to <tt>null</tt> if credentials are applicable to - * any realm. - */ - public AuthScope(final String host, final int port, final String realm) { - this(host, port, realm, ANY_SCHEME); - } - - /** Creates a new credentials scope for the given - * <tt>host</tt>, <tt>port</tt>, any realm name, and any - * authentication scheme. - * - * @param host the host the credentials apply to. May be set - * to <tt>null</tt> if credentials are applicable to - * any host. - * @param port the port the credentials apply to. May be set - * to negative value if credentials are applicable to - * any port. - */ - public AuthScope(final String host, final int port) { - this(host, port, ANY_REALM, ANY_SCHEME); - } - - /** - * Creates a copy of the given credentials scope. - */ - public AuthScope(final AuthScope authscope) { - super(); - Args.notNull(authscope, "Scope"); - this.host = authscope.getHost(); - this.port = authscope.getPort(); - this.realm = authscope.getRealm(); - this.scheme = authscope.getScheme(); - } - - /** - * @return the host - */ - public String getHost() { - return this.host; - } - - /** - * @return the port - */ - public int getPort() { - return this.port; - } - - /** - * @return the realm name - */ - public String getRealm() { - return this.realm; - } - - /** - * @return the scheme type - */ - public String getScheme() { - return this.scheme; - } - - /** - * Tests if the authentication scopes match. - * - * @return the match factor. Negative value signifies no match. - * Non-negative signifies a match. The greater the returned value - * the closer the match. - */ - public int match(final AuthScope that) { - int factor = 0; - if (LangUtils.equals(this.scheme, that.scheme)) { - factor += 1; - } else { - if (this.scheme != ANY_SCHEME && that.scheme != ANY_SCHEME) { - return -1; - } - } - if (LangUtils.equals(this.realm, that.realm)) { - factor += 2; - } else { - if (this.realm != ANY_REALM && that.realm != ANY_REALM) { - return -1; - } - } - if (this.port == that.port) { - factor += 4; - } else { - if (this.port != ANY_PORT && that.port != ANY_PORT) { - return -1; - } - } - if (LangUtils.equals(this.host, that.host)) { - factor += 8; - } else { - if (this.host != ANY_HOST && that.host != ANY_HOST) { - return -1; - } - } - return factor; - } - - /** - * @see java.lang.Object#equals(Object) - */ - @Override - public boolean equals(final Object o) { - if (o == null) { - return false; - } - if (o == this) { - return true; - } - if (!(o instanceof AuthScope)) { - return super.equals(o); - } - final AuthScope that = (AuthScope) o; - return - LangUtils.equals(this.host, that.host) - && this.port == that.port - && LangUtils.equals(this.realm, that.realm) - && LangUtils.equals(this.scheme, that.scheme); - } - - /** - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - final StringBuilder buffer = new StringBuilder(); - if (this.scheme != null) { - buffer.append(this.scheme.toUpperCase(Locale.ENGLISH)); - buffer.append(' '); - } - if (this.realm != null) { - buffer.append('\''); - buffer.append(this.realm); - buffer.append('\''); - } else { - buffer.append("<any realm>"); - } - if (this.host != null) { - buffer.append('@'); - buffer.append(this.host); - if (this.port >= 0) { - buffer.append(':'); - buffer.append(this.port); - } - } - return buffer.toString(); - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - int hash = LangUtils.HASH_SEED; - hash = LangUtils.hashCode(hash, this.host); - hash = LangUtils.hashCode(hash, this.port); - hash = LangUtils.hashCode(hash, this.realm); - hash = LangUtils.hashCode(hash, this.scheme); - return hash; - } -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthState.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthState.java deleted file mode 100644 index 236f934ac..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthState.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.util.Queue; - -import ch.boye.httpclientandroidlib.annotation.NotThreadSafe; -import ch.boye.httpclientandroidlib.util.Args; - -/** - * This class provides detailed information about the state of the authentication process. - * - * @since 4.0 - */ -@NotThreadSafe -public class AuthState { - - /** Actual state of authentication protocol */ - private AuthProtocolState state; - - /** Actual authentication scheme */ - private AuthScheme authScheme; - - /** Actual authentication scope */ - private AuthScope authScope; - - /** Credentials selected for authentication */ - private Credentials credentials; - - /** Available auth options */ - private Queue<AuthOption> authOptions; - - public AuthState() { - super(); - this.state = AuthProtocolState.UNCHALLENGED; - } - - /** - * Resets the auth state. - * - * @since 4.2 - */ - public void reset() { - this.state = AuthProtocolState.UNCHALLENGED; - this.authOptions = null; - this.authScheme = null; - this.authScope = null; - this.credentials = null; - } - - /** - * @since 4.2 - */ - public AuthProtocolState getState() { - return this.state; - } - - /** - * @since 4.2 - */ - public void setState(final AuthProtocolState state) { - this.state = state != null ? state : AuthProtocolState.UNCHALLENGED; - } - - /** - * Returns actual {@link AuthScheme}. May be null. - */ - public AuthScheme getAuthScheme() { - return this.authScheme; - } - - /** - * Returns actual {@link Credentials}. May be null. - */ - public Credentials getCredentials() { - return this.credentials; - } - - /** - * Updates the auth state with {@link AuthScheme} and {@link Credentials}. - * - * @param authScheme auth scheme. May not be null. - * @param credentials user crednetials. May not be null. - * - * @since 4.2 - */ - public void update(final AuthScheme authScheme, final Credentials credentials) { - Args.notNull(authScheme, "Auth scheme"); - Args.notNull(credentials, "Credentials"); - this.authScheme = authScheme; - this.credentials = credentials; - this.authOptions = null; - } - - /** - * Returns available {@link AuthOption}s. May be null. - * - * @since 4.2 - */ - public Queue<AuthOption> getAuthOptions() { - return this.authOptions; - } - - /** - * Returns <code>true</code> if {@link AuthOption}s are available, <code>false</code> - * otherwise. - * - * @since 4.2 - */ - public boolean hasAuthOptions() { - return this.authOptions != null && !this.authOptions.isEmpty(); - } - - /** - * Updates the auth state with a queue of {@link AuthOption}s. - * - * @param authOptions a queue of auth options. May not be null or empty. - * - * @since 4.2 - */ - public void update(final Queue<AuthOption> authOptions) { - Args.notEmpty(authOptions, "Queue of auth options"); - this.authOptions = authOptions; - this.authScheme = null; - this.credentials = null; - } - - /** - * Invalidates the authentication state by resetting its parameters. - * - * @deprecated (4.2) use {@link #reset()} - */ - @Deprecated - public void invalidate() { - reset(); - } - - /** - * @deprecated (4.2) do not use - */ - @Deprecated - public boolean isValid() { - return this.authScheme != null; - } - - /** - * Assigns the given {@link AuthScheme authentication scheme}. - * - * @param authScheme the {@link AuthScheme authentication scheme} - * - * @deprecated (4.2) use {@link #update(AuthScheme, Credentials)} - */ - @Deprecated - public void setAuthScheme(final AuthScheme authScheme) { - if (authScheme == null) { - reset(); - return; - } - this.authScheme = authScheme; - } - - /** - * Sets user {@link Credentials} to be used for authentication - * - * @param credentials User credentials - * - * @deprecated (4.2) use {@link #update(AuthScheme, Credentials)} - */ - @Deprecated - public void setCredentials(final Credentials credentials) { - this.credentials = credentials; - } - - /** - * Returns actual {@link AuthScope} if available - * - * @return actual authentication scope if available, <code>null</code otherwise - * - * @deprecated (4.2) do not use. - */ - @Deprecated - public AuthScope getAuthScope() { - return this.authScope; - } - - /** - * Sets actual {@link AuthScope}. - * - * @param authScope Authentication scope - * - * @deprecated (4.2) do not use. - */ - @Deprecated - public void setAuthScope(final AuthScope authScope) { - this.authScope = authScope; - } - - @Override - public String toString() { - final StringBuilder buffer = new StringBuilder(); - buffer.append("state:").append(this.state).append(";"); - if (this.authScheme != null) { - buffer.append("auth scheme:").append(this.authScheme.getSchemeName()).append(";"); - } - if (this.credentials != null) { - buffer.append("credentials present"); - } - return buffer.toString(); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthenticationException.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthenticationException.java deleted file mode 100644 index e000e4d9b..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/AuthenticationException.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.ProtocolException; -import ch.boye.httpclientandroidlib.annotation.Immutable; - -/** - * Signals a failure in authentication process - * - * - * @since 4.0 - */ -@Immutable -public class AuthenticationException extends ProtocolException { - - private static final long serialVersionUID = -6794031905674764776L; - - /** - * Creates a new AuthenticationException with a <tt>null</tt> detail message. - */ - public AuthenticationException() { - super(); - } - - /** - * Creates a new AuthenticationException with the specified message. - * - * @param message the exception detail message - */ - public AuthenticationException(final String message) { - super(message); - } - - /** - * Creates a new AuthenticationException with the specified detail message and cause. - * - * @param message the exception detail message - * @param cause the <tt>Throwable</tt> that caused this exception, or <tt>null</tt> - * if the cause is unavailable, unknown, or not a <tt>Throwable</tt> - */ - public AuthenticationException(final String message, final Throwable cause) { - super(message, cause); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/BasicUserPrincipal.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/BasicUserPrincipal.java deleted file mode 100644 index e3bf323bb..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/BasicUserPrincipal.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.io.Serializable; -import java.security.Principal; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; -import ch.boye.httpclientandroidlib.util.LangUtils; - -/** - * Basic user principal used for HTTP authentication - * - * @since 4.0 - */ -@Immutable -public final class BasicUserPrincipal implements Principal, Serializable { - - private static final long serialVersionUID = -2266305184969850467L; - - private final String username; - - public BasicUserPrincipal(final String username) { - super(); - Args.notNull(username, "User name"); - this.username = username; - } - - public String getName() { - return this.username; - } - - @Override - public int hashCode() { - int hash = LangUtils.HASH_SEED; - hash = LangUtils.hashCode(hash, this.username); - return hash; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o instanceof BasicUserPrincipal) { - final BasicUserPrincipal that = (BasicUserPrincipal) o; - if (LangUtils.equals(this.username, that.username)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - final StringBuilder buffer = new StringBuilder(); - buffer.append("[principal: "); - buffer.append(this.username); - buffer.append("]"); - return buffer.toString(); - } - -} - diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ChallengeState.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ChallengeState.java deleted file mode 100644 index 8ff59b7bb..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ChallengeState.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -/** - * Challenge mode (TARGET or PROXY) - * - * @since 4.2 - */ -public enum ChallengeState { - - TARGET, PROXY - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ContextAwareAuthScheme.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ContextAwareAuthScheme.java deleted file mode 100644 index 114679573..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/ContextAwareAuthScheme.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.Header; -import ch.boye.httpclientandroidlib.HttpRequest; -import ch.boye.httpclientandroidlib.protocol.HttpContext; - -/** - * This interface represents an extended authentication scheme - * that requires access to {@link HttpContext} in order to - * generate an authorization string. - * - * TODO: Fix AuthScheme interface in the next major version - * - * @since 4.1 - */ - -public interface ContextAwareAuthScheme extends AuthScheme { - - /** - * Produces an authorization string for the given set of - * {@link Credentials}. - * - * @param credentials The set of credentials to be used for athentication - * @param request The request being authenticated - * @param context HTTP context - * @throws AuthenticationException if authorization string cannot - * be generated due to an authentication failure - * - * @return the authorization string - */ - Header authenticate( - Credentials credentials, - HttpRequest request, - HttpContext context) throws AuthenticationException; - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/Credentials.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/Credentials.java deleted file mode 100644 index 2c40ee10e..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/Credentials.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.security.Principal; - -/** - * This interface represents a set of credentials consisting of a security - * principal and a secret (password) that can be used to establish user - * identity - * - * @since 4.0 - */ -public interface Credentials { - - Principal getUserPrincipal(); - - String getPassword(); - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/InvalidCredentialsException.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/InvalidCredentialsException.java deleted file mode 100644 index 47d6e6d91..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/InvalidCredentialsException.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.annotation.Immutable; - -/** - * Authentication credentials required to respond to a authentication - * challenge are invalid - * - * - * @since 4.0 - */ -@Immutable -public class InvalidCredentialsException extends AuthenticationException { - - private static final long serialVersionUID = -4834003835215460648L; - - /** - * Creates a new InvalidCredentialsException with a <tt>null</tt> detail message. - */ - public InvalidCredentialsException() { - super(); - } - - /** - * Creates a new InvalidCredentialsException with the specified message. - * - * @param message the exception detail message - */ - public InvalidCredentialsException(final String message) { - super(message); - } - - /** - * Creates a new InvalidCredentialsException with the specified detail message and cause. - * - * @param message the exception detail message - * @param cause the <tt>Throwable</tt> that caused this exception, or <tt>null</tt> - * if the cause is unavailable, unknown, or not a <tt>Throwable</tt> - */ - public InvalidCredentialsException(final String message, final Throwable cause) { - super(message, cause); - } -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/MalformedChallengeException.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/MalformedChallengeException.java deleted file mode 100644 index 309bbfb39..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/MalformedChallengeException.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import ch.boye.httpclientandroidlib.ProtocolException; -import ch.boye.httpclientandroidlib.annotation.Immutable; - -/** - * Signals that authentication challenge is in some way invalid or - * illegal in the given context - * - * - * @since 4.0 - */ -@Immutable -public class MalformedChallengeException extends ProtocolException { - - private static final long serialVersionUID = 814586927989932284L; - - /** - * Creates a new MalformedChallengeException with a <tt>null</tt> detail message. - */ - public MalformedChallengeException() { - super(); - } - - /** - * Creates a new MalformedChallengeException with the specified message. - * - * @param message the exception detail message - */ - public MalformedChallengeException(final String message) { - super(message); - } - - /** - * Creates a new MalformedChallengeException with the specified detail message and cause. - * - * @param message the exception detail message - * @param cause the <tt>Throwable</tt> that caused this exception, or <tt>null</tt> - * if the cause is unavailable, unknown, or not a <tt>Throwable</tt> - */ - public MalformedChallengeException(final String message, final Throwable cause) { - super(message, cause); - } -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTCredentials.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTCredentials.java deleted file mode 100644 index 43693ffa2..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTCredentials.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.io.Serializable; -import java.security.Principal; -import java.util.Locale; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; -import ch.boye.httpclientandroidlib.util.LangUtils; - -/** - * {@link Credentials} implementation for Microsoft Windows platforms that includes - * Windows specific attributes such as name of the domain the user belongs to. - * - * @since 4.0 - */ -@Immutable -public class NTCredentials implements Credentials, Serializable { - - private static final long serialVersionUID = -7385699315228907265L; - - /** The user principal */ - private final NTUserPrincipal principal; - - /** Password */ - private final String password; - - /** The host the authentication request is originating from. */ - private final String workstation; - - /** - * The constructor with the fully qualified username and password combined - * string argument. - * - * @param usernamePassword the domain/username:password formed string - */ - public NTCredentials(final String usernamePassword) { - super(); - Args.notNull(usernamePassword, "Username:password string"); - final String username; - final int atColon = usernamePassword.indexOf(':'); - if (atColon >= 0) { - username = usernamePassword.substring(0, atColon); - this.password = usernamePassword.substring(atColon + 1); - } else { - username = usernamePassword; - this.password = null; - } - final int atSlash = username.indexOf('/'); - if (atSlash >= 0) { - this.principal = new NTUserPrincipal( - username.substring(0, atSlash).toUpperCase(Locale.ENGLISH), - username.substring(atSlash + 1)); - } else { - this.principal = new NTUserPrincipal( - null, - username.substring(atSlash + 1)); - } - this.workstation = null; - } - - /** - * Constructor. - * @param userName The user name. This should not include the domain to authenticate with. - * For example: "user" is correct whereas "DOMAIN\\user" is not. - * @param password The password. - * @param workstation The workstation the authentication request is originating from. - * Essentially, the computer name for this machine. - * @param domain The domain to authenticate within. - */ - public NTCredentials( - final String userName, - final String password, - final String workstation, - final String domain) { - super(); - Args.notNull(userName, "User name"); - this.principal = new NTUserPrincipal(domain, userName); - this.password = password; - if (workstation != null) { - this.workstation = workstation.toUpperCase(Locale.ENGLISH); - } else { - this.workstation = null; - } - } - - public Principal getUserPrincipal() { - return this.principal; - } - - public String getUserName() { - return this.principal.getUsername(); - } - - public String getPassword() { - return this.password; - } - - /** - * Retrieves the name to authenticate with. - * - * @return String the domain these credentials are intended to authenticate with. - */ - public String getDomain() { - return this.principal.getDomain(); - } - - /** - * Retrieves the workstation name of the computer originating the request. - * - * @return String the workstation the user is logged into. - */ - public String getWorkstation() { - return this.workstation; - } - - @Override - public int hashCode() { - int hash = LangUtils.HASH_SEED; - hash = LangUtils.hashCode(hash, this.principal); - hash = LangUtils.hashCode(hash, this.workstation); - return hash; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o instanceof NTCredentials) { - final NTCredentials that = (NTCredentials) o; - if (LangUtils.equals(this.principal, that.principal) - && LangUtils.equals(this.workstation, that.workstation)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - final StringBuilder buffer = new StringBuilder(); - buffer.append("[principal: "); - buffer.append(this.principal); - buffer.append("][workstation: "); - buffer.append(this.workstation); - buffer.append("]"); - return buffer.toString(); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTUserPrincipal.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTUserPrincipal.java deleted file mode 100644 index 13789ef4f..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/NTUserPrincipal.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.io.Serializable; -import java.security.Principal; -import java.util.Locale; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; -import ch.boye.httpclientandroidlib.util.LangUtils; - -/** - * Microsoft Windows specific user principal implementation. - * - * @since 4.0 - */ -@Immutable -public class NTUserPrincipal implements Principal, Serializable { - - private static final long serialVersionUID = -6870169797924406894L; - - private final String username; - private final String domain; - private final String ntname; - - public NTUserPrincipal( - final String domain, - final String username) { - super(); - Args.notNull(username, "User name"); - this.username = username; - if (domain != null) { - this.domain = domain.toUpperCase(Locale.ENGLISH); - } else { - this.domain = null; - } - if (this.domain != null && this.domain.length() > 0) { - final StringBuilder buffer = new StringBuilder(); - buffer.append(this.domain); - buffer.append('\\'); - buffer.append(this.username); - this.ntname = buffer.toString(); - } else { - this.ntname = this.username; - } - } - - public String getName() { - return this.ntname; - } - - public String getDomain() { - return this.domain; - } - - public String getUsername() { - return this.username; - } - - @Override - public int hashCode() { - int hash = LangUtils.HASH_SEED; - hash = LangUtils.hashCode(hash, this.username); - hash = LangUtils.hashCode(hash, this.domain); - return hash; - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o instanceof NTUserPrincipal) { - final NTUserPrincipal that = (NTUserPrincipal) o; - if (LangUtils.equals(this.username, that.username) - && LangUtils.equals(this.domain, that.domain)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return this.ntname; - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/UsernamePasswordCredentials.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/UsernamePasswordCredentials.java deleted file mode 100644 index 5cdeeb61e..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/UsernamePasswordCredentials.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ -package ch.boye.httpclientandroidlib.auth; - -import java.io.Serializable; -import java.security.Principal; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.util.Args; -import ch.boye.httpclientandroidlib.util.LangUtils; - -/** - * Simple {@link Credentials} implementation based on a user name / password - * pair. - * - * @since 4.0 - */ -@Immutable -public class UsernamePasswordCredentials implements Credentials, Serializable { - - private static final long serialVersionUID = 243343858802739403L; - - private final BasicUserPrincipal principal; - private final String password; - - /** - * The constructor with the username and password combined string argument. - * - * @param usernamePassword the username:password formed string - * @see #toString - */ - public UsernamePasswordCredentials(final String usernamePassword) { - super(); - Args.notNull(usernamePassword, "Username:password string"); - final int atColon = usernamePassword.indexOf(':'); - if (atColon >= 0) { - this.principal = new BasicUserPrincipal(usernamePassword.substring(0, atColon)); - this.password = usernamePassword.substring(atColon + 1); - } else { - this.principal = new BasicUserPrincipal(usernamePassword); - this.password = null; - } - } - - - /** - * The constructor with the username and password arguments. - * - * @param userName the user name - * @param password the password - */ - public UsernamePasswordCredentials(final String userName, final String password) { - super(); - Args.notNull(userName, "Username"); - this.principal = new BasicUserPrincipal(userName); - this.password = password; - } - - public Principal getUserPrincipal() { - return this.principal; - } - - public String getUserName() { - return this.principal.getName(); - } - - public String getPassword() { - return password; - } - - @Override - public int hashCode() { - return this.principal.hashCode(); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o instanceof UsernamePasswordCredentials) { - final UsernamePasswordCredentials that = (UsernamePasswordCredentials) o; - if (LangUtils.equals(this.principal, that.principal)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return this.principal.toString(); - } - -} - diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/package-info.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/package-info.java deleted file mode 100644 index 93992fcbf..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/package-info.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -/** - * Client HTTP authentication APIs. - */ -package ch.boye.httpclientandroidlib.auth; diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthPNames.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthPNames.java deleted file mode 100644 index ee64850ac..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthPNames.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth.params; - -/** - * Parameter names for HTTP authentication classes. - * - * @since 4.0 - * - * @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig} - * and constructor parameters of - * {@link ch.boye.httpclientandroidlib.auth.AuthSchemeProvider}s. -*/ -@Deprecated -public interface AuthPNames { - - /** - * Defines the charset to be used when encoding - * {@link ch.boye.httpclientandroidlib.auth.Credentials}. - * <p> - * This parameter expects a value of type {@link String}. - */ - public static final String CREDENTIAL_CHARSET = "http.auth.credential-charset"; - - /** - * Defines the order of preference for supported - * {@link ch.boye.httpclientandroidlib.auth.AuthScheme}s when authenticating with - * the target host. - * <p> - * This parameter expects a value of type {@link java.util.Collection}. The - * collection is expected to contain {@link String} instances representing - * a name of an authentication scheme as returned by - * {@link ch.boye.httpclientandroidlib.auth.AuthScheme#getSchemeName()}. - */ - public static final String TARGET_AUTH_PREF = "http.auth.target-scheme-pref"; - - /** - * Defines the order of preference for supported - * {@link ch.boye.httpclientandroidlib.auth.AuthScheme}s when authenticating with the - * proxy host. - * <p> - * This parameter expects a value of type {@link java.util.Collection}. The - * collection is expected to contain {@link String} instances representing - * a name of an authentication scheme as returned by - * {@link ch.boye.httpclientandroidlib.auth.AuthScheme#getSchemeName()}. - */ - public static final String PROXY_AUTH_PREF = "http.auth.proxy-scheme-pref"; - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParamBean.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParamBean.java deleted file mode 100644 index e35d7ae28..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParamBean.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth.params; - -import ch.boye.httpclientandroidlib.params.HttpAbstractParamBean; -import ch.boye.httpclientandroidlib.params.HttpParams; - -/** - * This is a Java Bean class that can be used to wrap an instance of - * {@link HttpParams} and manipulate HTTP authentication parameters - * using Java Beans conventions. - * - * @since 4.0 - * - * @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig} - * and constructor parameters of - * {@link ch.boye.httpclientandroidlib.auth.AuthSchemeProvider}s. - */ -@Deprecated -public class AuthParamBean extends HttpAbstractParamBean { - - public AuthParamBean (final HttpParams params) { - super(params); - } - - public void setCredentialCharset (final String charset) { - AuthParams.setCredentialCharset(params, charset); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParams.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParams.java deleted file mode 100644 index cc7a3d32c..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/AuthParams.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -package ch.boye.httpclientandroidlib.auth.params; - -import ch.boye.httpclientandroidlib.annotation.Immutable; -import ch.boye.httpclientandroidlib.params.HttpParams; -import ch.boye.httpclientandroidlib.protocol.HTTP; -import ch.boye.httpclientandroidlib.util.Args; - -/** - * An adaptor for manipulating HTTP authentication parameters - * in {@link HttpParams}. - * - * @since 4.0 - * - * @deprecated (4.3) use {@link ch.boye.httpclientandroidlib.client.config.RequestConfig} - * and constructor parameters of - * {@link ch.boye.httpclientandroidlib.auth.AuthSchemeProvider}s. - */ -@Immutable -@Deprecated -public final class AuthParams { - - private AuthParams() { - super(); - } - - /** - * Obtains the charset for encoding - * {@link ch.boye.httpclientandroidlib.auth.Credentials}.If not configured, - * {@link HTTP#DEFAULT_PROTOCOL_CHARSET}is used instead. - * - * @return The charset - */ - public static String getCredentialCharset(final HttpParams params) { - Args.notNull(params, "HTTP parameters"); - String charset = (String) params.getParameter - (AuthPNames.CREDENTIAL_CHARSET); - if (charset == null) { - charset = HTTP.DEF_PROTOCOL_CHARSET.name(); - } - return charset; - } - - - /** - * Sets the charset to be used when encoding - * {@link ch.boye.httpclientandroidlib.auth.Credentials}. - * - * @param charset The charset - */ - public static void setCredentialCharset(final HttpParams params, final String charset) { - Args.notNull(params, "HTTP parameters"); - params.setParameter(AuthPNames.CREDENTIAL_CHARSET, charset); - } - -} diff --git a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/package-info.java b/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/package-info.java deleted file mode 100644 index 7b406b259..000000000 --- a/mobile/android/thirdparty/ch/boye/httpclientandroidlib/auth/params/package-info.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - * - * This software consists of voluntary contributions made by many - * individuals on behalf of the Apache Software Foundation. For more - * information on the Apache Software Foundation, please see - * <http://www.apache.org/>. - * - */ - -/** - * Deprecated. - * @deprecated (4.3). - */ -package ch.boye.httpclientandroidlib.auth.params; |