Skip to content

Conversation

@bpteich
Copy link
Collaborator

@bpteich bpteich commented Mar 22, 2017

Since I had to do some manually merging it might be difficult looking at changes in individual commits, so the following is a list of all files modified, and a summary of what was changed in the hopes that it makes things easier:

src/edu.umass.cs.gnsserver.httpserver.GNSHttpProxy: Created this class, which is used to run a GNSClient proxy that does not execute commands locally, but instead accepts requests over HTTP then uses a GNSClient to issue these commands to a GNSServer.

src/edu.umass.cs.gnsserver.httpserver.GNSHttpServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.

src/edu.umass.cs.gnsserver.httpserver.GNSHttpsServer: Refactored this class to extend GNSHttpProxy to minimize code reuse.

src/edu.umass.cs.gnsclient.client.GNSClientConfig: Added variables that are used by the GNSHttpProxy

test/edu.umass.cs.gnsclient.client.singletests.HttpProxyTest: Created this test, which launches a GNSHttpProxy and a server, then runs HttpClientTest in order to test that the Proxy server correctly handles an http client.

test/edu.umass.cs.gnsclient.client.singletests.HttpClientTest: Modified a few variables in this class to be protected so that HttpProxyTest could extend this class, which minimizes code reuse.

The goal of creating GNSHttpProxy:
"The main difference between GNSHttpProxy and GNSHttpServer is that the proxy never executes and commands locally since it is intended to be used as a standalone client. An example use case would be having a GNSHttpProxy running on a Clearpass Authentication machine that is setup to only accept HTTP commands from localhost. Whenever the Clearpass server receives a user login event it sends an HTTP request to its local GNSHttpProxy to update a field in the user's GNS entry with their current location. This would solve the problem of having to spawn a new jvm every time an asynchronous event happens that requires a GNS read or write, but still gives the benefits of a distributed system since GNSHttpProxy uses a GNSClient."

In order to run the HttpProxyTest you can do: ant runtest -Dtest="HttpProxyTest"
This test is also included in "ant test" by default since it is located in the singletests folder.

Brendan Teich added 16 commits January 29, 2017 22:44
…null pointer exception that arose when GNSHttpsServer called GNSHttpServer, but GNSHttpProxy was running before the requestHandler had been set.
… remove duplicate code. Added system parameters to set the gns proxy's listening port and accepted remote hostnames.
…hostname to match the header for GNSHttpProxy.
…ttpProxyTest to automatically create a GNSHttpProxy when run.
…ive the proxy server a different default port from the http server, and moved HttpProxyTest to failingtests since it essentially just runs HttpClientTest, which is currently failing.
…ttpClientTest and HttpProxyTest relies on it.
…xing them both to work with changes in the master branch.
@bpteich bpteich requested a review from kanantharamu March 22, 2017 05:18
@kanantharamu
Copy link
Collaborator

I'll take a look at this ASAP. I'm also adding @westyUMass

@kanantharamu kanantharamu requested a review from westyUMass March 23, 2017 20:30
@kanantharamu
Copy link
Collaborator

Changes look good to me. Unless @westyUMass has something to say, I'll be merging this.

@westyUMass
Copy link
Collaborator

I'm looking at this now.

@westyUMass
Copy link
Collaborator

The one very minor quibble I see is in runServer which I know you didn't change. Arun added the suicide call which obviates the need for a loop. That could be simplified. That might lead to runServer becoming superfluous, but I'm not sure.

Also, you could eliminate the single argument runServer method I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants