azure-data-tables
Loading...
Searching...
No Matches
azure_sas_credential.hpp
1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4#pragma once
5
6#include <azure/core/http/http.hpp>
7
8#include <memory>
9#include <mutex>
10#include <string>
11
12namespace Azure { namespace Data { namespace Tables { namespace Credentials {
16 class AzureSasCredential final {
17 private:
18 std::string m_signature;
19 mutable std::mutex m_mutex;
20
21 public:
27 explicit AzureSasCredential(std::string signature) : m_signature(std::move(signature)) {}
28
32 std::string GetSignature() const
33 {
34 std::lock_guard<std::mutex> guard(m_mutex);
35 return m_signature;
36 }
37
41 void Update(std::string signature)
42 {
43 std::lock_guard<std::mutex> guard(m_mutex);
44 m_signature = std::move(signature);
45 }
46 };
47}}}} // namespace Azure::Data::Tables::Credentials
Azure Shared Access Signature (SAS) credential.
Definition azure_sas_credential.hpp:16
AzureSasCredential(std::string signature)
Initializes a new instance of the AzureSasCredential.
Definition azure_sas_credential.hpp:27
std::string GetSignature() const
Get the signature for the SAS token.
Definition azure_sas_credential.hpp:32
void Update(std::string signature)
Update the signature for the SAS token.
Definition azure_sas_credential.hpp:41