Skip to content

Commit

Permalink
Issue Terracotta-OSS#728 Removal of security related code
Browse files Browse the repository at this point in the history
Removes code that carried over from Terracotta 4.x but has no purpose
in this version.
  • Loading branch information
ljacomet committed Nov 30, 2017
1 parent 8ad7d04 commit e1e9f61
Show file tree
Hide file tree
Showing 51 changed files with 162 additions and 766 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package com.tc.config.schema.setup.sources;

import com.tc.config.schema.setup.ConfigurationSetupException;
import com.tc.net.core.SecurityInfo;
import com.tc.util.Assert;
import com.tc.util.io.ServerURL;

Expand All @@ -30,17 +29,13 @@

/**
* A {@link ConfigurationSource} that reads from a URL.
*
* @see URLConfigurationSourceTest
*/
public class ServerConfigurationSource implements ConfigurationSource {

private final String host;
private final int port;
private final SecurityInfo securityInfo;

public ServerConfigurationSource(String host, int port, SecurityInfo securityInfo) {
this.securityInfo = securityInfo;
public ServerConfigurationSource(String host, int port) {
Assert.assertNotBlank(host);
Assert.assertTrue(port > 0);
this.host = host;
Expand All @@ -50,7 +45,7 @@ public ServerConfigurationSource(String host, int port, SecurityInfo securityInf
@Override
public InputStream getInputStream(long maxTimeoutMillis) throws IOException, ConfigurationSetupException {
try {
ServerURL theURL = new ServerURL(host, port, "/config" , (int)maxTimeoutMillis, securityInfo);
ServerURL theURL = new ServerURL(host, port, "/config" , (int)maxTimeoutMillis);

// JDK: 1.4.2 - These settings are proprietary to Sun's implementation of java.net.URL in version 1.4.2
System.setProperty("sun.net.client.defaultConnectTimeout", String.valueOf(maxTimeoutMillis));
Expand Down
15 changes: 4 additions & 11 deletions common/src/main/java/com/tc/net/core/TCConnectionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.tc.net.TCSocketAddress;
import com.tc.net.core.event.TCConnectionEventCaller;
import com.tc.net.core.event.TCConnectionEventListener;
import com.tc.net.core.security.TCSecurityManager;
import com.tc.net.protocol.TCNetworkMessage;
import com.tc.net.protocol.TCProtocolAdaptor;
import com.tc.net.protocol.transport.WireProtocolGroupMessageImpl;
Expand Down Expand Up @@ -125,17 +124,15 @@ final class TCConnectionImpl implements TCConnection, TCChannelReader, TCChannel
logger.debug("Comms Message Batching " + (MSG_GROUPING_ENABLED ? "enabled" : "disabled"));
}

// for creating unconnected client connections
TCConnectionImpl(TCConnectionEventListener listener, TCProtocolAdaptor adaptor,
TCConnectionManagerImpl managerJDK14, CoreNIOServices nioServiceThread,
SocketParams socketParams, TCSecurityManager securityManager) {
this(listener, adaptor, null, managerJDK14, nioServiceThread, socketParams, securityManager);
SocketParams socketParams, BufferManagerFactory bufferManagerFactory) {
this(listener, adaptor, null, managerJDK14, nioServiceThread, socketParams, bufferManagerFactory);
}

TCConnectionImpl(TCConnectionEventListener listener, TCProtocolAdaptor adaptor, SocketChannel ch,
TCConnectionManagerImpl parent, CoreNIOServices nioServiceThread,
SocketParams socketParams, TCSecurityManager securityManager) {

SocketParams socketParams, BufferManagerFactory bufferManagerFactory) {
Assert.assertNotNull(parent);
Assert.assertNotNull(adaptor);

Expand All @@ -148,11 +145,7 @@ final class TCConnectionImpl implements TCConnection, TCChannelReader, TCChannel

this.channel = ch;

if (securityManager != null) {
this.bufferManagerFactory = securityManager.getBufferManagerFactory();
} else {
this.bufferManagerFactory = new ClearTextBufferManagerFactory();
}
this.bufferManagerFactory = bufferManagerFactory;

if (ch != null) {
socketParams.applySocketParams(ch.socket());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.tc.net.core.event.TCConnectionEventListener;
import com.tc.net.core.event.TCListenerEvent;
import com.tc.net.core.event.TCListenerEventListener;
import com.tc.net.core.security.TCSecurityManager;
import com.tc.net.protocol.ProtocolAdaptorFactory;
import com.tc.net.protocol.TCProtocolAdaptor;
import com.tc.net.protocol.transport.ConnectionHealthCheckerUtil;
Expand Down Expand Up @@ -63,25 +62,24 @@ public class TCConnectionManagerImpl implements TCConnectionManager {
private final ConnectionEvents connEvents;
private final ListenerEvents listenerEvents;
private final SocketParams socketParams;
private final TCSecurityManager securityManager;
private final BufferManagerFactory bufferManagerFactory;

public TCConnectionManagerImpl() {
this("ConnectionMgr", 0, new HealthCheckerConfigImpl("DefaultConfigForActiveConnections"), null);
this("ConnectionMgr", 0, new HealthCheckerConfigImpl("DefaultConfigForActiveConnections"), new ClearTextBufferManagerFactory());
}

public TCConnectionManagerImpl(String name, int workerCommCount, HealthCheckerConfig healthCheckerConfig,
TCSecurityManager securityManager) {
this.securityManager = securityManager;
public TCConnectionManagerImpl(String name, int workerCommCount, HealthCheckerConfig healthCheckerConfig, BufferManagerFactory bufferManagerFactory) {
this.connEvents = new ConnectionEvents();
this.listenerEvents = new ListenerEvents();
this.socketParams = new SocketParams();
this.healthCheckerConfig = healthCheckerConfig;
this.bufferManagerFactory = bufferManagerFactory;
this.comm = new TCCommImpl(name, workerCommCount, socketParams);
this.comm.start();
}

protected TCConnection createConnectionImpl(TCProtocolAdaptor adaptor, TCConnectionEventListener listener) {
return new TCConnectionImpl(listener, adaptor, this, comm.nioServiceThreadForNewConnection(), socketParams, securityManager);
return new TCConnectionImpl(listener, adaptor, this, comm.nioServiceThreadForNewConnection(), socketParams, bufferManagerFactory);
}

@SuppressWarnings("resource")
Expand All @@ -106,7 +104,7 @@ protected TCListener createListenerImpl(TCSocketAddress addr, ProtocolAdaptorFac

CoreNIOServices commThread = comm.nioServiceThreadForNewListener();

TCListenerImpl rv = new TCListenerImpl(ssc, factory, getConnectionListener(), this, commThread, securityManager);
TCListenerImpl rv = new TCListenerImpl(ssc, factory, getConnectionListener(), this, commThread, bufferManagerFactory);

commThread.registerListener(rv, ssc);

Expand Down
11 changes: 4 additions & 7 deletions common/src/main/java/com/tc/net/core/TCListenerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import com.tc.net.core.event.TCConnectionEventListener;
import com.tc.net.core.event.TCListenerEvent;
import com.tc.net.core.event.TCListenerEventListener;
import com.tc.net.core.security.TCSecurityManager;
import com.tc.net.protocol.ProtocolAdaptorFactory;
import com.tc.net.protocol.TCProtocolAdaptor;
import com.tc.util.Assert;
Expand Down Expand Up @@ -61,14 +60,13 @@ final class TCListenerImpl implements TCListener {
private final CopyOnWriteArraySet<TCListenerEventListener> listeners = new CopyOnWriteArraySet<TCListenerEventListener>();
private final ProtocolAdaptorFactory factory;
private final CoreNIOServices commNIOServiceThread;
private final TCSecurityManager securityManager;
private final BufferManagerFactory bufferManagerFactory;

TCListenerImpl(ServerSocketChannel ssc, ProtocolAdaptorFactory factory, TCConnectionEventListener listener,
TCConnectionManagerImpl managerJDK14, CoreNIOServices commNIOServiceThread,
TCSecurityManager securityManager) {
this.securityManager = securityManager;
TCConnectionManagerImpl managerJDK14, CoreNIOServices commNIOServiceThread, BufferManagerFactory bufferManagerFactory) {
this.addr = ssc.socket().getInetAddress();
this.port = ssc.socket().getLocalPort();
this.bufferManagerFactory = bufferManagerFactory;
this.sockAddr = new TCSocketAddress(this.addr, this.port);
this.factory = factory;
this.staticEvent = new TCListenerEvent(this);
Expand All @@ -85,8 +83,7 @@ protected void stopImpl(Runnable callback) {
TCConnectionImpl createConnection(SocketChannel ch, CoreNIOServices nioServiceThread, SocketParams socketParams)
throws IOException {
TCProtocolAdaptor adaptor = getProtocolAdaptorFactory().getInstance();
TCConnectionImpl rv = new TCConnectionImpl(listener, adaptor, ch, parent, nioServiceThread, socketParams,
securityManager);
TCConnectionImpl rv = new TCConnectionImpl(listener, adaptor, ch, parent, nioServiceThread, socketParams, bufferManagerFactory);
rv.finishConnect();
parent.newConnection(rv);
return rv;
Expand Down
36 changes: 0 additions & 36 deletions common/src/main/java/com/tc/net/core/security/Realm.java

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit e1e9f61

Please sign in to comment.