Skip to content

Commit 12defa7

Browse files
committed
fix build without jwt
1 parent 7076efa commit 12defa7

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

src/Access/Common/JWKSProvider.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <Access/Common/JWKSProvider.h>
22

3+
#if USE_JWT_CPP
34
#include <Common/Exception.h>
45
#include <Poco/Net/HTTPRequest.h>
56
#include <Poco/Net/HTTPResponse.h>
@@ -105,3 +106,4 @@ StaticJWKS::StaticJWKS(const StaticJWKSParams & params)
105106
}
106107

107108
}
109+
#endif

src/Access/Common/JWKSProvider.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
#include <config.h>
2+
3+
#if USE_JWT_CPP
14
#include <base/types.h>
25
#include <jwt-cpp/jwt.h>
36
#include <jwt-cpp/traits/kazuho-picojson/traits.h>
47
#include <shared_mutex>
58

69
#include <Poco/URI.h>
710

8-
911
namespace DB
1012
{
1113

@@ -66,3 +68,4 @@ class StaticJWKS : public IJWKSProvider
6668
};
6769

6870
}
71+
#endif

src/Access/TokenProcessorsJWT.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "TokenProcessors.h"
22

3+
#if USE_JWT_CPP
34
#include <Common/Base64.h>
45
#include <Common/logger_useful.h>
56
#include <Poco/String.h>
@@ -404,3 +405,5 @@ bool JwksJwtProcessor::resolveAndValidate(TokenCredentials & credentials) const
404405
}
405406

406407
}
408+
409+
#endif

src/Access/TokenProcessorsOpaque.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "TokenProcessors.h"
22

3+
#if USE_JWT_CPP
34
#include <Common/logger_useful.h>
45
#include <Poco/StreamCopier.h>
56
#include <Poco/Net/HTTPSClientSession.h>
@@ -383,3 +384,4 @@ bool OpenIdTokenProcessor::resolveAndValidate(TokenCredentials & credentials) co
383384
}
384385

385386
}
387+
#endif

src/Access/TokenProcessorsParse.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ namespace DB {
88
namespace ErrorCodes
99
{
1010
extern const int INVALID_CONFIG_PARAMETER;
11+
extern const int SUPPORT_IS_DISABLED;
1112
}
1213

14+
#if USE_JWT_CPP
1315
std::unique_ptr<DB::ITokenProcessor> ITokenProcessor::parseTokenProcessor(
1416
const Poco::Util::AbstractConfiguration & config,
1517
const String & prefix,
@@ -109,6 +111,14 @@ std::unique_ptr<DB::ITokenProcessor> ITokenProcessor::parseTokenProcessor(
109111
// throw DB::Exception(ErrorCodes::INVALID_CONFIG_PARAMETER, "Failed to parse token processor: {}", processor_name);
110112
}
111113

112-
114+
#else
115+
std::unique_ptr<DB::ITokenProcessor> ITokenProcessor::parseTokenProcessor(
116+
const Poco::Util::AbstractConfiguration &,
117+
const String &,
118+
const String &)
119+
{
120+
throw DB::Exception(ErrorCodes::SUPPORT_IS_DISABLED, "Failed to parse token_processor, ClickHouse was built without JWT support.");
121+
}
122+
#endif
113123

114124
}

0 commit comments

Comments
 (0)