diff options
| author | Zousar Shaker <[email protected]> | 2026-03-20 05:45:44 -0600 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-03-20 12:45:44 +0100 |
| commit | d44a692aaeb6f78e8cf7520236b21977333fa3c3 (patch) | |
| tree | b8ae4ae8b2e6b51ae6fee2123424e2abd7cebb74 /src/zenutil/include | |
| parent | Zen disk benchmark utility (#868) (diff) | |
| download | zen-d44a692aaeb6f78e8cf7520236b21977333fa3c3.tar.xz zen-d44a692aaeb6f78e8cf7520236b21977333fa3c3.zip | |
Zs/consul token (#870)
- Feature: Added support for consul token passed via environment variable, and specified a default env var name of CONSUL_HTTP_TOKEN for it in hub mode
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/consul.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zenutil/include/zenutil/consul.h b/src/zenutil/include/zenutil/consul.h index b5bfa42d1..7bf2ce437 100644 --- a/src/zenutil/include/zenutil/consul.h +++ b/src/zenutil/include/zenutil/consul.h @@ -28,7 +28,7 @@ struct ServiceRegistrationInfo class ConsulClient { public: - ConsulClient(std::string_view BaseUri); + ConsulClient(std::string_view BaseUri, std::string_view Token = ""); ~ConsulClient(); ConsulClient(const ConsulClient&) = delete; @@ -53,8 +53,10 @@ public: private: static bool FindServiceInJson(std::string_view Json, std::string_view ServiceId); + void ApplyCommonHeaders(HttpClient::KeyValueMap& InOutHeaderMap); - HttpClient m_HttpClient; + std::string m_Token; + HttpClient m_HttpClient; }; class ConsulProcess |