-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
conf/functions_worker.yml
Outdated
@@ -20,6 +20,7 @@ | |||
workerId: standalone | |||
workerHostname: localhost | |||
workerPort: 6750 | |||
workerPortTls: |
There was a problem hiding this comment.
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?
@sijie added default port for tls and also added tls + authentication test. |
6784061
to
57e2f12
Compare
add tls authentication test stop worker server cleanly from test
@@ -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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay thank you
There was a problem hiding this comment.
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.
### 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.
### 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.
* [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
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.