-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[native] Add JWT processing when using http(s) comms #20290
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| #include "presto_cpp/main/http/HttpServer.h" | ||
| #include "presto_cpp/main/http/filters/AccessLogFilter.h" | ||
| #include "presto_cpp/main/http/filters/HttpEndpointLatencyFilter.h" | ||
| #include "presto_cpp/main/http/filters/InternalAuthenticationFilter.h" | ||
| #include "presto_cpp/main/http/filters/StatsFilter.h" | ||
| #include "presto_cpp/main/operators/BroadcastExchangeSource.h" | ||
| #include "presto_cpp/main/operators/BroadcastWrite.h" | ||
|
|
@@ -163,6 +164,15 @@ void PrestoServer::run() { | |
| clientCertAndKeyPath = optionalClientCertPath.value(); | ||
| } | ||
|
|
||
| if (systemConfig->internalCommunicationJwtEnabled()) { | ||
| #ifndef PRESTO_ENABLE_JWT | ||
| VELOX_USER_FAIL("Internal JWT is enabled but not supported"); | ||
| #endif | ||
| VELOX_USER_CHECK( | ||
majetideepak marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| !(systemConfig->internalCommunicationSharedSecret().empty()), | ||
| "Internal JWT is enabled without a corresponding shared secret"); | ||
| } | ||
|
|
||
| nodeVersion_ = systemConfig->prestoVersion(); | ||
| httpExecThreads = systemConfig->httpExecThreads(); | ||
| environment_ = nodeConfig->nodeEnvironment(); | ||
|
|
@@ -658,6 +668,11 @@ PrestoServer::getHttpServerFilters() { | |
| httpServer_.get())); | ||
| } | ||
|
|
||
| // Always add the authentication filter to make sure the worker configuration | ||
| // is in line with the overall cluster configuration e.g. cannot have a worker | ||
| // without JWT enabled. | ||
|
||
| filters.push_back( | ||
| std::make_unique<http::filters::InternalAuthenticationFilterFactory>()); | ||
| return filters; | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.