userver: userver/s3api/authenticators/access_key.hpp Source File
Loading...
Searching...
No Matches
access_key.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/s3api/authenticators/access_key.hpp
4/// @brief Authenticator for using `access_key` and `secret_key` for authentication
5
6#include <string>
7#include <unordered_map>
8
9#include <userver/s3api/authenticators/interface.hpp>
10#include <userver/s3api/models/fwd.hpp>
11
12USERVER_NAMESPACE_BEGIN
13
14namespace s3api::authenticators {
15
16class AccessKey : public Authenticator {
17public:
18 AccessKey(std::string access_key, Secret secret_key)
19 : access_key_{std::move(access_key)}, secret_key_{std::move(secret_key)} {}
20 std::unordered_map<std::string, std::string> Auth(const Request& request) const override;
21 std::unordered_map<std::string, std::string> Sign(const Request& request, time_t expires) const override;
22
23private:
24 std::string access_key_;
25 Secret secret_key_;
26};
27
28} // namespace s3api::authenticators
29
30USERVER_NAMESPACE_END