6#include "azure/storage/common/storage_credential.hpp"
8#include <azure/core/http/policies/policy.hpp>
13namespace Azure {
namespace Storage {
namespace _internal {
15 class SharedKeyPolicy final :
public Core::Http::Policies::HttpPolicy {
17 explicit SharedKeyPolicy(std::shared_ptr<StorageSharedKeyCredential> credential)
18 : m_credential(std::move(credential))
22 ~SharedKeyPolicy()
override {}
24 std::unique_ptr<HttpPolicy> Clone()
const override
26 return std::make_unique<SharedKeyPolicy>(m_credential);
29 std::unique_ptr<Core::Http::RawResponse> Send(
30 Core::Http::Request& request,
31 Core::Http::Policies::NextHttpPolicy nextPolicy,
32 Core::Context
const& context)
const override
35 "Authorization",
"SharedKey " + m_credential->AccountName +
":" + GetSignature(request));
36 return nextPolicy.Send(request, context);
40 std::string GetSignature(
const Core::Http::Request& request)
const;
42 std::shared_ptr<StorageSharedKeyCredential> m_credential;