[utilities COMMIT] /spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationMa...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Jan 8 09:29:46 EST 2014
Author: rdw
Date: Wed Jan 8 09:29:46 2014
New Revision: 498
URL: http://svn.shibboleth.net/view/utilities?rev=498&view=rev
Log:
IDP-346 rework the SVNBAsicAuthrnticationManager to use the SVNkit provided one, with the minotr addition that theproxying information can be set via bena like setters. Allows Spring configuration
Modified:
spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationManager.java
Modified: spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationManager.java
URL: http://svn.shibboleth.net/view/utilities/spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationManager.java?rev=498&r1=497&r2=498&view=diff
==============================================================================
--- spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationManager.java (original)
+++ spring-extensions/trunk/src/main/java/net/shibboleth/ext/spring/resource/SVNBasicAuthenticationManager.java Wed Jan 8 09:29:46 2014
@@ -17,271 +17,137 @@
package net.shibboleth.ext.spring.resource;
-import java.util.Collections;
-import java.util.HashMap;
+import java.io.File;
import java.util.List;
-import java.util.Map;
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
import javax.annotation.concurrent.ThreadSafe;
-import javax.net.ssl.TrustManager;
-import net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent;
-import net.shibboleth.utilities.java.support.primitive.StringSupport;
+import org.springframework.beans.factory.InitializingBean;
+import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
+import org.tmatesoft.svn.core.auth.SVNAuthentication;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.BeanNameAware;
-import org.springframework.beans.factory.InitializingBean;
-import org.tmatesoft.svn.core.SVNErrorMessage;
-import org.tmatesoft.svn.core.SVNException;
-import org.tmatesoft.svn.core.SVNURL;
-import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
-import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider;
-import org.tmatesoft.svn.core.auth.ISVNProxyManager;
-import org.tmatesoft.svn.core.auth.SVNAuthentication;
-import org.tmatesoft.svn.core.io.SVNRepository;
+/**
+ * Authentication manager for SVN resources based on {@link BasicAuthenticationManager). <br/>
+ * Exbeds the proxy information into individual beans to allow setting from Spring.
+ */
+ at ThreadSafe
+public class SVNBasicAuthenticationManager extends BasicAuthenticationManager implements InitializingBean {
-/** Authentication manager for SVN resources. */
- at ThreadSafe
-public class SVNBasicAuthenticationManager extends AbstractIdentifiableInitializableComponent implements
- ISVNAuthenticationManager, BeanNameAware, InitializingBean {
+ /** Proxy Host - if needed. */
+ private String proxyHost;
- /** Class logger. */
- private final Logger log = LoggerFactory.getLogger(SVNBasicAuthenticationManager.class);
+ /** Proxy Port - if needed. */
+ private int proxyPort;
- /** Network connection timeout in milliseconds. */
- private int connectionTimeout;
+ /** Proxy User Name - if needed. */
+ private String proxyUserName;
- /** Read operation timeout in milliseconds. */
- private int readTimeout;
+ /** Proxy Password - if needed. */
+ private String proxyPassword;
- /** The SSL trust manager. */
- private TrustManager trustManager;
-
- /** User authentication mechanisms. */
- private Map<String, SVNAuthentication> authenticationMethods;
-
- /** HTTP proxy configuration. */
- private final BasicProxyManager proxyManager;
+ /** This is true if any of the setters for the proxy information have been called.*/
+ private boolean proxySet;
/**
- * Constructor.
+ * Constructor. See http://svnkit.com/javadoc/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.html
*
- * @param authnMethods user authentication methods
+ * @param authentications authentications
*/
- public SVNBasicAuthenticationManager(List<SVNAuthentication> authnMethods) {
- connectionTimeout = 5000;
- readTimeout = 10000;
- setAuthenticationMethods(authnMethods);
- proxyManager = null;
+ public SVNBasicAuthenticationManager(List<SVNAuthentication> authentications) {
+ super(authentications.toArray(new SVNAuthentication[authentications.size()]));
}
/**
- * Constructor.
+ * Constructor. See http://svnkit.com/javadoc/org/tmatesoft/svn/core/auth/BasicAuthenticationManager.html
*
- * @param authnMethods user authentication methods
- * @param proxyHost host name or IP address of the proxy server
- * @param proxyPort port of the proxy server
- * @param proxyUser username used to connect to the proxy server
[... 267 lines stripped ...]
More information about the commits
mailing list