Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tls support to authenticate client to access function admin-api #2214

Merged
merged 1 commit into from
Aug 2, 2018

Conversation

rdhabalia
Copy link
Contributor

Motivation

Add TLS support on function webservice so, function-authentication in #2213 can leverage TLS authentication.

Modifications

Function server can now support TLS.

Note

I will add test once #2213 is merged and we can add TLS-authentication test on top of it.

@rdhabalia rdhabalia added this to the 2.1.1-incubating milestone Jul 20, 2018
@rdhabalia rdhabalia self-assigned this Jul 20, 2018
@@ -20,6 +20,7 @@
workerId: standalone
workerHostname: localhost
workerPort: 6750
workerPortTls:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a default value in the configuration template?

@rdhabalia
Copy link
Contributor Author

@sijie added default port for tls and also added tls + authentication test.

@rdhabalia rdhabalia force-pushed the fun_tls_pr branch 3 times, most recently from 6784061 to 57e2f12 Compare July 31, 2018 18:54
add tls authentication test

stop worker server cleanly from test
@sijie sijie merged commit 87fa838 into apache:master Aug 2, 2018
@@ -96,7 +136,6 @@ public void run() {
log.error("ex: {}", ex, ex);
final String message = getErrorMessage(server, this.workerConfig.getWorkerPort(), ex);
log.error(message);
System.exit(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sijie integration test is failing because I have removed it in this PR. in order to test tls, we need to start worker-server and while stopping it in unit-test, it was throwing interruption exception on the thread which was causing system.exit in junit process.
and it's also bad practice to do system.exit on exception.
However, this change was causing integration test failure.
to fix it, we can either keep system.exit for now and disable tls-unit test or we have to fix integration test.
I wanted to refactor this method lil bit to fix it but we merge it before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdhabalia ah! sorry. I can revert it back ... does that work?

Copy link
Contributor Author

@rdhabalia rdhabalia Aug 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fine. let me quickly see if we can refactor it else I will disable test for now.. and can address later.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay thank you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created #2297 to fix the issue.

sijie pushed a commit that referenced this pull request Aug 5, 2018
### Motivation

As discussed in #2214 , right now, integration test requires function-worker process to exit when worker-server thread is interrupted which was removed in #2214. so, revert back previous behavior to exit worker-server when server thread is interrupted. However, tls-test will not create a separate thread to start worker-server so, unit-test will not exist during testing. 


### Result

Fix integration test failure.
sijie added a commit to sijie/pulsar that referenced this pull request Aug 10, 2018
 ### Motivation

Integration test are basically just not working in apache CI. there are multiple reasons:

1. PULSAR_MEM is set to very high (~2G). If we start more than 6 containers, it will quickly go up to ~12GB.
2. We start containers for each tests, which is very inefficient.
3. There is a regression from apache#2214. apache#2214 tried to listen on a hostname that is configured in worker config,
  which the hostname is internally to docker environment.

 ### Changes

1. Set PULSAR_MEM to use no more than 128M.
2. Switch to use test suite, trying to start containers only once as possible and use them across test suites.
   so we only start the cluster for a set of tests. hence reorganize those tests and get rid
   of using dataProvider, which doesn't work well with current approach.
3. Remove binding to hostname in WorkerServer, so it binds to all interfaces.
sijie added a commit that referenced this pull request Aug 10, 2018
* [Integration Tests] Improve and fix integration tests

 ### Motivation

Integration test are basically just not working in apache CI. there are multiple reasons:

1. PULSAR_MEM is set to very high (~2G). If we start more than 6 containers, it will quickly go up to ~12GB.
2. We start containers for each tests, which is very inefficient.
3. There is a regression from #2214. #2214 tried to listen on a hostname that is configured in worker config,
  which the hostname is internally to docker environment.

 ### Changes

1. Set PULSAR_MEM to use no more than 128M.
2. Switch to use test suite, trying to start containers only once as possible and use them across test suites.
   so we only start the cluster for a set of tests. hence reorganize those tests and get rid
   of using dataProvider, which doesn't work well with current approach.
3. Remove binding to hostname in WorkerServer, so it binds to all interfaces.

* remove suite xml

* Avoid running testng suites multiple times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants