mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 18:02:24 +00:00
47 lines
788 B
C++
47 lines
788 B
C++
|
#pragma once
|
||
|
|
||
|
#include <map>
|
||
|
#include <memory>
|
||
|
#include <mutex>
|
||
|
#include <Core/Types.h>
|
||
|
|
||
|
namespace Poco::Util
|
||
|
{
|
||
|
class AbstractConfiguration;
|
||
|
}
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
struct HttpHeader
|
||
|
{
|
||
|
const String name;
|
||
|
const String value;
|
||
|
};
|
||
|
|
||
|
using HeaderCollection = std::vector<HttpHeader>;
|
||
|
|
||
|
struct S3AuthSettings
|
||
|
{
|
||
|
const String access_key_id;
|
||
|
const String secret_access_key;
|
||
|
|
||
|
const HeaderCollection headers;
|
||
|
};
|
||
|
|
||
|
/// Settings for the StorageS3.
|
||
|
class StorageS3Settings
|
||
|
{
|
||
|
public:
|
||
|
StorageS3Settings() = default;
|
||
|
void loadFromConfig(const String & config_elem, const Poco::Util::AbstractConfiguration & config);
|
||
|
|
||
|
S3AuthSettings getSettings(const String & endpoint) const;
|
||
|
|
||
|
private:
|
||
|
mutable std::mutex mutex;
|
||
|
std::map<const String, const S3AuthSettings> settings;
|
||
|
};
|
||
|
|
||
|
}
|