Pascal case for acronyms (#391)

This commit is contained in:
JinmingHu 2020-08-05 10:32:03 +08:00 committed by GitHub
parent 626a8856f0
commit 52dbc6b2f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 298 additions and 298 deletions

View File

@ -657,14 +657,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief The standard HTTP header system properties to set.
@ -738,14 +738,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.
@ -779,14 +779,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.
@ -893,14 +893,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.
@ -934,14 +934,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.
@ -1001,14 +1001,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.
@ -1031,14 +1031,14 @@ namespace Azure { namespace Storage { namespace Blobs {
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentMD5;
Azure::Core::Nullable<std::string> ContentMd5;
/**
* @brief A CRC64 hash of the blob content. This hash is used to verify the integrity of
* the blob during transport. When this header is specified, the storage service checks the hash
* that has arrived with the one that was sent.
*/
Azure::Core::Nullable<std::string> ContentCRC64;
Azure::Core::Nullable<std::string> ContentCrc64;
/**
* @brief Optional conditions that must be met to perform this operation.

View File

@ -20,7 +20,7 @@ namespace Azure { namespace Storage { namespace Blobs {
std::map<std::string, std::string> Metadata;
Blobs::BlobType BlobType = Blobs::BlobType::Unknown;
Azure::Core::Nullable<bool> ServerEncrypted;
Azure::Core::Nullable<std::string> EncryptionKeySHA256;
Azure::Core::Nullable<std::string> EncryptionKeySha256;
};
struct PageRange

View File

@ -181,7 +181,7 @@ namespace Azure { namespace Storage { namespace Blobs {
* shared access signature, and the service version to use when handling requests made with this
* shared access signature.
*/
std::string Version = c_APIVersion;
std::string Version = c_ApiVersion;
/**
* @brief The optional signed protocol field specifies the protocol permitted for a

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
namespace Azure { namespace Storage {
std::string HMAC_SHA256(const std::string& text, const std::string& key);
std::string Hmac_Sha256(const std::string& text, const std::string& key);
std::string Base64Encode(const std::string& text);
std::string Base64Decode(const std::string& text);

View File

@ -75,7 +75,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Azure::Core::Nullable<LeaseStatusType> LeaseStatus;
DataLakeHttpHeaders HttpHeaders;
Azure::Core::Nullable<bool> ServerEncrypted;
Azure::Core::Nullable<std::string> EncryptionKeySHA256;
Azure::Core::Nullable<std::string> EncryptionKeySha256;
Azure::Core::Nullable<bool> AccessTierInferred;
Azure::Core::Nullable<std::string> AccessTierChangeTime;
Azure::Core::Nullable<std::string> CopyId;
@ -153,7 +153,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
DataLakeHttpHeaders HttpHeaders;
std::map<std::string, std::string> Metadata;
Azure::Core::Nullable<bool> ServerEncrypted;
Azure::Core::Nullable<std::string> EncryptionKeySHA256;
Azure::Core::Nullable<std::string> EncryptionKeySha256;
};
using FileInfo = PathInfo;

View File

@ -78,8 +78,8 @@ namespace Azure { namespace Storage { namespace Blobs {
const AppendBlockOptions& options)
{
BlobRestClient::AppendBlob::AppendBlockOptions protocolLayerOptions;
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.MaxSize = options.AccessConditions.MaxSize;
protocolLayerOptions.AppendPosition = options.AccessConditions.AppendPosition;
@ -110,8 +110,8 @@ namespace Azure { namespace Storage { namespace Blobs {
std::numeric_limits<
std::remove_reference_t<decltype(options.SourceOffset.GetValue())>>::max());
}
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.MaxSize = options.AccessConditions.MaxSize;
protocolLayerOptions.AppendPosition = options.AccessConditions.AppendPosition;

View File

@ -232,7 +232,7 @@ namespace Azure { namespace Storage { namespace Blobs {
ret.Metadata = std::move(response->Metadata);
ret.BlobType = response->BlobType;
ret.ServerEncrypted = response->ServerEncrypted;
ret.EncryptionKeySHA256 = std::move(response->EncryptionKeySHA256);
ret.EncryptionKeySha256 = std::move(response->EncryptionKeySha256);
return Azure::Core::Response<BlobDownloadInfo>(
std::move(ret),
std::make_unique<Azure::Core::Http::RawResponse>(std::move(response.GetRawResponse())));
@ -369,7 +369,7 @@ namespace Azure { namespace Storage { namespace Blobs {
ret.Metadata = std::move(response->Metadata);
ret.BlobType = response->BlobType;
ret.ServerEncrypted = response->ServerEncrypted;
ret.EncryptionKeySHA256 = std::move(response->EncryptionKeySHA256);
ret.EncryptionKeySha256 = std::move(response->EncryptionKeySha256);
return Azure::Core::Response<BlobDownloadInfo>(
std::move(ret),
std::make_unique<Azure::Core::Http::RawResponse>(std::move(response.GetRawResponse())));

View File

@ -124,7 +124,7 @@ namespace Azure { namespace Storage { namespace Blobs {
+ ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;
std::string signature
= Base64Encode(HMAC_SHA256(stringToSign, Base64Decode(credential.GetAccountKey())));
= Base64Encode(Hmac_Sha256(stringToSign, Base64Decode(credential.GetAccountKey())));
UriBuilder builder;
builder.AppendQuery("sv", Version);
@ -197,7 +197,7 @@ namespace Azure { namespace Storage { namespace Blobs {
+ ContentType;
std::string signature
= Base64Encode(HMAC_SHA256(stringToSign, Base64Decode(userDelegationKey.Value)));
= Base64Encode(Hmac_Sha256(stringToSign, Base64Decode(userDelegationKey.Value)));
UriBuilder builder;
builder.AppendQuery("sv", Version);

View File

@ -66,8 +66,8 @@ namespace Azure { namespace Storage { namespace Blobs {
const UploadBlockBlobOptions& options) const
{
BlobRestClient::BlockBlob::UploadOptions protocolLayerOptions;
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.HttpHeaders = options.HttpHeaders;
protocolLayerOptions.Metadata = options.Metadata;
protocolLayerOptions.Tier = options.Tier;
@ -133,8 +133,8 @@ namespace Azure { namespace Storage { namespace Blobs {
commitBlockListOptions.Metadata = options.Metadata;
commitBlockListOptions.Tier = options.Tier;
auto commitBlockListResponse = CommitBlockList(blockIds, commitBlockListOptions);
commitBlockListResponse->ContentCRC64.Reset();
commitBlockListResponse->ContentMD5.Reset();
commitBlockListResponse->ContentCrc64.Reset();
commitBlockListResponse->ContentMd5.Reset();
return commitBlockListResponse;
}
@ -194,8 +194,8 @@ namespace Azure { namespace Storage { namespace Blobs {
commitBlockListOptions.Metadata = options.Metadata;
commitBlockListOptions.Tier = options.Tier;
auto commitBlockListResponse = CommitBlockList(blockIds, commitBlockListOptions);
commitBlockListResponse->ContentCRC64.Reset();
commitBlockListResponse->ContentMD5.Reset();
commitBlockListResponse->ContentCrc64.Reset();
commitBlockListResponse->ContentMd5.Reset();
return commitBlockListResponse;
}
@ -206,8 +206,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
BlobRestClient::BlockBlob::StageBlockOptions protocolLayerOptions;
protocolLayerOptions.BlockId = blockId;
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
return BlobRestClient::BlockBlob::StageBlock(
options.Context, *m_pipeline, m_blobUrl.ToString(), content, protocolLayerOptions);
@ -234,8 +234,8 @@ namespace Azure { namespace Storage { namespace Blobs {
std::numeric_limits<
std::remove_reference_t<decltype(options.SourceOffset.GetValue())>>::max());
}
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.SourceIfModifiedSince = options.SourceConditions.IfModifiedSince;
protocolLayerOptions.SourceIfUnmodifiedSince = options.SourceConditions.IfUnmodifiedSince;

View File

@ -82,8 +82,8 @@ namespace Azure { namespace Storage { namespace Blobs {
{
BlobRestClient::PageBlob::UploadPagesOptions protocolLayerOptions;
protocolLayerOptions.Range = std::make_pair(offset, offset + content->Length() - 1);
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;
@ -106,8 +106,8 @@ namespace Azure { namespace Storage { namespace Blobs {
= std::make_pair(sourceOffset, sourceOffset + sourceLength - 1);
protocolLayerOptions.Range
= std::make_pair(destinationoffset, destinationoffset + sourceLength - 1);
protocolLayerOptions.ContentMD5 = options.ContentMD5;
protocolLayerOptions.ContentCRC64 = options.ContentCRC64;
protocolLayerOptions.ContentMd5 = options.ContentMd5;
protocolLayerOptions.ContentCrc64 = options.ContentCrc64;
protocolLayerOptions.LeaseId = options.AccessConditions.LeaseId;
protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince;
protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince;

View File

@ -102,7 +102,7 @@ namespace Azure { namespace Storage {
+ "\n";
std::string signature
= Base64Encode(HMAC_SHA256(stringToSign, Base64Decode(credential.GetAccountKey())));
= Base64Encode(Hmac_Sha256(stringToSign, Base64Decode(credential.GetAccountKey())));
UriBuilder builder;
builder.AppendQuery("sv", Version);

View File

@ -20,7 +20,7 @@
namespace Azure { namespace Storage {
#ifdef _WIN32
std::string HMAC_SHA256(const std::string& text, const std::string& key)
std::string Hmac_Sha256(const std::string& text, const std::string& key)
{
struct AlgorithmProviderInstance
{
@ -150,7 +150,7 @@ namespace Azure { namespace Storage {
#else
std::string HMAC_SHA256(const std::string& text, const std::string& key)
std::string Hmac_Sha256(const std::string& text, const std::string& key)
{
char hash[EVP_MAX_MD_SIZE];
unsigned int hashLength = 0;

View File

@ -84,6 +84,6 @@ namespace Azure { namespace Storage {
// remove last linebreak
string_to_sign.pop_back();
return Base64Encode(HMAC_SHA256(string_to_sign, Base64Decode(m_credential->GetAccountKey())));
return Base64Encode(Hmac_Sha256(string_to_sign, Base64Decode(m_credential->GetAccountKey())));
}
}} // namespace Azure::Storage

View File

@ -309,7 +309,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
}
ret.RangeOffset = RangeOffset;
ret.RangeLength = RangeLength;
ret.TransactionalMD5 = std::move(result->ContentMD5);
ret.TransactionalMD5 = std::move(result->ContentMd5);
ret.ETag = std::move(result->ETag);
ret.LastModified = std::move(result->LastModified);
ret.LeaseDuration = std::move(result->LeaseDuration);
@ -363,7 +363,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
ret.HttpHeaders = FromBlobHttpHeaders(std::move(result->HttpHeaders));
ret.Metadata = std::move(result->Metadata);
ret.ServerEncrypted = std::move(result->ServerEncrypted);
ret.EncryptionKeySHA256 = std::move(result->EncryptionKeySHA256);
ret.EncryptionKeySha256 = std::move(result->EncryptionKeySha256);
return Azure::Core::Response<FileDownloadInfo>(std::move(ret), result.ExtractRawResponse());
}
@ -379,7 +379,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
ret.HttpHeaders = FromBlobHttpHeaders(std::move(result->HttpHeaders));
ret.Metadata = std::move(result->Metadata);
ret.ServerEncrypted = std::move(result->ServerEncrypted);
ret.EncryptionKeySHA256 = std::move(result->EncryptionKeySHA256);
ret.EncryptionKeySha256 = std::move(result->EncryptionKeySha256);
return Azure::Core::Response<FileDownloadInfo>(std::move(ret), result.ExtractRawResponse());
}

View File

@ -293,7 +293,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
ret.HttpHeaders.ContentLanguage = std::move(result->HttpHeaders.ContentLanguage);
ret.HttpHeaders.ContentType = std::move(result->HttpHeaders.ContentType);
ret.ServerEncrypted = std::move(result->ServerEncrypted);
ret.EncryptionKeySHA256 = std::move(result->EncryptionKeySHA256);
ret.EncryptionKeySha256 = std::move(result->EncryptionKeySha256);
ret.AccessTierInferred = std::move(result->AccessTierInferred);
ret.AccessTierChangeTime = std::move(result->AccessTierChangeTime);
ret.CopyId = std::move(result->CopyId);

View File

@ -27,13 +27,13 @@ namespace Azure { namespace Storage { namespace Test {
m_blobUploadOptions.HttpHeaders.ContentDisposition = "attachment";
m_blobUploadOptions.HttpHeaders.CacheControl = "no-cache";
m_blobUploadOptions.HttpHeaders.ContentEncoding = "identify";
m_blobUploadOptions.HttpHeaders.ContentMD5 = "";
m_blobUploadOptions.HttpHeaders.ContentMd5 = "";
m_appendBlobClient->Create(m_blobUploadOptions);
auto blockContent
= Azure::Core::Http::MemoryBodyStream(m_blobContent.data(), m_blobContent.size());
m_appendBlobClient->AppendBlock(&blockContent);
m_blobUploadOptions.HttpHeaders.ContentMD5
= m_appendBlobClient->GetProperties()->HttpHeaders.ContentMD5;
m_blobUploadOptions.HttpHeaders.ContentMd5
= m_appendBlobClient->GetProperties()->HttpHeaders.ContentMd5;
}
void AppendBlobClientTest::TearDownTestSuite() { BlobContainerClientTest::TearDownTestSuite(); }

View File

@ -39,7 +39,7 @@ namespace Azure { namespace Storage { namespace Test {
{
Blobs::BlobSasBuilder sasBuilder;
sasBuilder.Protocol = SasProtocol::HttpsAndHtttp;
sasBuilder.ExpiresOn = ToISO8601(std::chrono::system_clock::now() + std::chrono::hours(72));
sasBuilder.ExpiresOn = ToIso8601(std::chrono::system_clock::now() + std::chrono::hours(72));
sasBuilder.ContainerName = m_containerName;
sasBuilder.Resource = Blobs::BlobSasResource::Container;
sasBuilder.SetPermissions(Blobs::BlobContainerSasPermissions::All);
@ -247,14 +247,14 @@ namespace Azure { namespace Storage { namespace Test {
options.AccessType = Blobs::PublicAccessType::Blob;
Blobs::BlobSignedIdentifier identifier;
identifier.Id = RandomString(64);
identifier.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(1), 7);
identifier.ExpiresOn = ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(1), 7);
identifier.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(1), 7);
identifier.ExpiresOn = ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(1), 7);
identifier.Permissions
= Blobs::BlobContainerSasPermissionsToString(Blobs::BlobContainerSasPermissions::Read);
options.SignedIdentifiers.emplace_back(identifier);
identifier.Id = RandomString(64);
identifier.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(2), 7);
identifier.ExpiresOn = ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(2), 7);
identifier.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(2), 7);
identifier.ExpiresOn = ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(2), 7);
identifier.Permissions
= Blobs::BlobContainerSasPermissionsToString(Blobs::BlobContainerSasPermissions::All);
options.SignedIdentifiers.emplace_back(identifier);

View File

@ -11,18 +11,18 @@ namespace Azure { namespace Storage { namespace Test {
AccountSasBuilder accountSasBuilder;
accountSasBuilder.Protocol = SasProtocol::HttpsAndHtttp;
accountSasBuilder.StartsOn
= ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
= ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
accountSasBuilder.ExpiresOn
= ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
= ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
accountSasBuilder.Services = AccountSasServices::Blobs;
accountSasBuilder.ResourceTypes = AccountSasResource::Object | AccountSasResource::Container;
std::string blobName = RandomString();
Blobs::BlobSasBuilder blobSasBuilder;
blobSasBuilder.Protocol = SasProtocol::HttpsAndHtttp;
blobSasBuilder.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
blobSasBuilder.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
blobSasBuilder.ExpiresOn
= ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
= ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
blobSasBuilder.ContainerName = m_containerName;
blobSasBuilder.BlobName = blobName;
blobSasBuilder.Resource = Blobs::BlobSasResource::Blob;
@ -48,8 +48,8 @@ namespace Azure { namespace Storage { namespace Test {
std::make_shared<Azure::Core::Credentials::ClientSecretCredential>(
AadTenantId(), AadClientId(), AadClientSecret()));
auto userDelegationKey = *blobServiceClient1.GetUserDelegationKey(
ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5)),
ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(60)));
ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5)),
ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(60)));
auto verify_blob_read = [&](const std::string& sas) {
EXPECT_NO_THROW(blobClient0.Create());
@ -225,8 +225,8 @@ namespace Azure { namespace Storage { namespace Test {
// Expires
{
AccountSasBuilder builder2 = accountSasBuilder;
builder2.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
builder2.ExpiresOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(1));
builder2.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
builder2.ExpiresOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(1));
auto sasToken = builder2.ToSasQueryParameters(*keyCredential);
EXPECT_THROW(verify_blob_create(sasToken), StorageError);
}
@ -336,8 +336,8 @@ namespace Azure { namespace Storage { namespace Test {
// Expires
{
Blobs::BlobSasBuilder builder2 = blobSasBuilder;
builder2.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
builder2.ExpiresOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(1));
builder2.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
builder2.ExpiresOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(1));
auto sasToken = builder2.ToSasQueryParameters(*keyCredential);
EXPECT_THROW(verify_blob_create(sasToken), StorageError);
@ -377,8 +377,8 @@ namespace Azure { namespace Storage { namespace Test {
options.AccessType = Blobs::PublicAccessType::Blob;
Blobs::BlobSignedIdentifier identifier;
identifier.Id = RandomString(64);
identifier.StartsOn = ToISO8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
identifier.ExpiresOn = ToISO8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
identifier.StartsOn = ToIso8601(std::chrono::system_clock::now() - std::chrono::minutes(5));
identifier.ExpiresOn = ToIso8601(std::chrono::system_clock::now() + std::chrono::minutes(60));
identifier.Permissions
= Blobs::BlobContainerSasPermissionsToString(Blobs::BlobContainerSasPermissions::Read);
options.SignedIdentifiers.emplace_back(identifier);

View File

@ -220,7 +220,7 @@ namespace Azure { namespace Storage { namespace Test {
properties.MinuteMetrics.RetentionPolicy.Days = 4;
properties.MinuteMetrics.IncludeApis = true;
properties.DefaultServiceVersion = Blobs::c_APIVersion;
properties.DefaultServiceVersion = Blobs::c_ApiVersion;
properties.StaticWebsite.Enabled = true;
properties.StaticWebsite.IndexDocument = "index.html";

View File

@ -17,7 +17,7 @@ namespace Azure { namespace Storage { namespace Blobs {
const Azure::Storage::Blobs::BlobHttpHeaders& rhs)
{
return lhs.ContentType == rhs.ContentType && lhs.ContentEncoding == rhs.ContentEncoding
&& lhs.ContentLanguage == rhs.ContentLanguage && lhs.ContentMD5 == rhs.ContentMD5
&& lhs.ContentLanguage == rhs.ContentLanguage && lhs.ContentMd5 == rhs.ContentMd5
&& lhs.CacheControl == rhs.CacheControl && lhs.ContentDisposition == rhs.ContentDisposition;
}
@ -47,13 +47,13 @@ namespace Azure { namespace Storage { namespace Test {
m_blobUploadOptions.HttpHeaders.ContentDisposition = "attachment";
m_blobUploadOptions.HttpHeaders.CacheControl = "no-cache";
m_blobUploadOptions.HttpHeaders.ContentEncoding = "identity";
m_blobUploadOptions.HttpHeaders.ContentMD5 = "";
m_blobUploadOptions.HttpHeaders.ContentMd5 = "";
m_blobUploadOptions.Tier = Azure::Storage::Blobs::AccessTier::Hot;
auto blobContent
= Azure::Core::Http::MemoryBodyStream(m_blobContent.data(), m_blobContent.size());
m_blockBlobClient->Upload(&blobContent, m_blobUploadOptions);
m_blobUploadOptions.HttpHeaders.ContentMD5
= m_blockBlobClient->GetProperties()->HttpHeaders.ContentMD5;
m_blobUploadOptions.HttpHeaders.ContentMd5
= m_blockBlobClient->GetProperties()->HttpHeaders.ContentMd5;
}
void BlockBlobClientTest::TearDownTestSuite() { BlobContainerClientTest::TearDownTestSuite(); }
@ -526,8 +526,8 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(res->ETag.empty());
EXPECT_FALSE(res->LastModified.empty());
EXPECT_FALSE(res->SequenceNumber.HasValue());
EXPECT_FALSE(res->ContentCRC64.HasValue());
EXPECT_FALSE(res->ContentMD5.HasValue());
EXPECT_FALSE(res->ContentCrc64.HasValue());
EXPECT_FALSE(res->ContentMd5.HasValue());
auto properties = *blockBlobClient.GetProperties();
EXPECT_EQ(properties.ContentLength, length);
EXPECT_EQ(properties.HttpHeaders, options.HttpHeaders);
@ -552,8 +552,8 @@ namespace Azure { namespace Storage { namespace Test {
EXPECT_FALSE(res->ETag.empty());
EXPECT_FALSE(res->LastModified.empty());
EXPECT_FALSE(res->SequenceNumber.HasValue());
EXPECT_FALSE(res->ContentCRC64.HasValue());
EXPECT_FALSE(res->ContentMD5.HasValue());
EXPECT_FALSE(res->ContentCrc64.HasValue());
EXPECT_FALSE(res->ContentMd5.HasValue());
auto properties = *blockBlobClient.GetProperties();
EXPECT_EQ(properties.ContentLength, length);
EXPECT_EQ(properties.HttpHeaders, options.HttpHeaders);

View File

@ -27,13 +27,13 @@ namespace Azure { namespace Storage { namespace Test {
m_blobUploadOptions.HttpHeaders.ContentDisposition = "attachment";
m_blobUploadOptions.HttpHeaders.CacheControl = "no-cache";
m_blobUploadOptions.HttpHeaders.ContentEncoding = "identity";
m_blobUploadOptions.HttpHeaders.ContentMD5 = "";
m_blobUploadOptions.HttpHeaders.ContentMd5 = "";
m_pageBlobClient->Create(m_blobContent.size(), m_blobUploadOptions);
auto pageContent
= Azure::Core::Http::MemoryBodyStream(m_blobContent.data(), m_blobContent.size());
m_pageBlobClient->UploadPages(&pageContent, 0);
m_blobUploadOptions.HttpHeaders.ContentMD5
= m_pageBlobClient->GetProperties()->HttpHeaders.ContentMD5;
m_blobUploadOptions.HttpHeaders.ContentMd5
= m_pageBlobClient->GetProperties()->HttpHeaders.ContentMd5;
}
void PageBlobClientTest::TearDownTestSuite() { BlobContainerClientTest::TearDownTestSuite(); }

View File

@ -195,7 +195,7 @@ namespace Azure { namespace Storage { namespace Test {
auto newfileSystemName = LowercaseRandomString(10);
auto newfileSystemClient = std::make_shared<Files::DataLake::FileSystemClient>(
Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), newfileSystemName));
AdlsGen2ConnectionString(), newfileSystemName));
newfileSystemClient->Create();
Files::DataLake::DirectoryRenameOptions options;
options.DestinationFileSystem = newfileSystemName;

View File

@ -178,7 +178,7 @@ namespace Azure { namespace Storage { namespace Test {
auto newfileSystemName = LowercaseRandomString(10);
auto newfileSystemClient = std::make_shared<Files::DataLake::FileSystemClient>(
Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), newfileSystemName));
AdlsGen2ConnectionString(), newfileSystemName));
newfileSystemClient->Create();
Files::DataLake::FileRenameOptions options;
options.DestinationFileSystem = newfileSystemName;

View File

@ -23,7 +23,7 @@ namespace Azure { namespace Storage { namespace Test {
m_fileSystemName = LowercaseRandomString();
m_fileSystemClient = std::make_shared<Files::DataLake::FileSystemClient>(
Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), m_fileSystemName));
AdlsGen2ConnectionString(), m_fileSystemName));
m_fileSystemClient->Create();
m_directoryA = LowercaseRandomString();
@ -95,7 +95,7 @@ namespace Azure { namespace Storage { namespace Test {
for (int32_t i = 0; i < 5; ++i)
{
auto client = Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), LowercaseRandomString());
AdlsGen2ConnectionString(), LowercaseRandomString());
EXPECT_NO_THROW(client.Create());
fileSystemClient.emplace_back(std::move(client));
}
@ -110,7 +110,7 @@ namespace Azure { namespace Storage { namespace Test {
for (int32_t i = 0; i < 5; ++i)
{
auto client = Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), LowercaseRandomString());
AdlsGen2ConnectionString(), LowercaseRandomString());
EXPECT_NO_THROW(client.Create());
fileSystemClient.emplace_back(std::move(client));
}
@ -144,9 +144,9 @@ namespace Azure { namespace Storage { namespace Test {
{
// Create file system with metadata works
auto client1 = Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), LowercaseRandomString());
AdlsGen2ConnectionString(), LowercaseRandomString());
auto client2 = Files::DataLake::FileSystemClient::CreateFromConnectionString(
ADLSGen2ConnectionString(), LowercaseRandomString());
AdlsGen2ConnectionString(), LowercaseRandomString());
Files::DataLake::FileSystemCreateOptions options1;
Files::DataLake::FileSystemCreateOptions options2;
options1.Metadata = metadata1;

View File

@ -19,7 +19,7 @@ namespace Azure { namespace Storage { namespace Test {
void DataLakeServiceClientTest::SetUpTestSuite()
{
m_dataLakeServiceClient = std::make_shared<Files::DataLake::ServiceClient>(
Files::DataLake::ServiceClient::CreateFromConnectionString(ADLSGen2ConnectionString()));
Files::DataLake::ServiceClient::CreateFromConnectionString(AdlsGen2ConnectionString()));
m_fileSystemPrefixA = LowercaseRandomString(10);
m_fileSystemPrefixB = LowercaseRandomString(10);
for (size_t i = 0; i < c_FILE_SYSTEM_TEST_SIZE; ++i)

View File

@ -24,7 +24,7 @@ namespace Azure { namespace Storage { namespace Test {
constexpr static const char* c_PremiumStorageConnectionString = "";
constexpr static const char* c_BlobStorageConnectionString = "";
constexpr static const char* c_PremiumFileConnectionString = "";
constexpr static const char* c_ADLSGen2ConnectionString = "";
constexpr static const char* c_AdlsGen2ConnectionString = "";
constexpr static const char* c_AadTenantId = "";
constexpr static const char* c_AadClientId = "";
constexpr static const char* c_AadClientSecret = "";
@ -77,12 +77,12 @@ namespace Azure { namespace Storage { namespace Test {
return connectionString;
}
const std::string& ADLSGen2ConnectionString()
const std::string& AdlsGen2ConnectionString()
{
const static std::string connectionString = []() -> std::string {
if (strlen(c_ADLSGen2ConnectionString) != 0)
if (strlen(c_AdlsGen2ConnectionString) != 0)
{
return c_ADLSGen2ConnectionString;
return c_AdlsGen2ConnectionString;
}
return std::getenv("ADLS_GEN2_CONNECTION_STRING");
}();
@ -217,7 +217,7 @@ namespace Azure { namespace Storage { namespace Test {
return result;
}
std::string ToISO8601(
std::string ToIso8601(
const std::chrono::system_clock::time_point& time_point,
int numDecimalDigits)
{
@ -248,7 +248,7 @@ namespace Azure { namespace Storage { namespace Test {
return time_str;
}
std::string ToRFC1123(const std::chrono::system_clock::time_point& time_point)
std::string ToRfc1123(const std::chrono::system_clock::time_point& time_point)
{
std::time_t epoch_seconds = std::chrono::system_clock::to_time_t(time_point);
struct tm ct;

View File

@ -17,7 +17,7 @@ namespace Azure { namespace Storage { namespace Test {
const std::string& PremiumStorageConnectionString();
const std::string& BlobStorageConnectionString();
const std::string& PremiumFileConnectionString();
const std::string& ADLSGen2ConnectionString();
const std::string& AdlsGen2ConnectionString();
const std::string& AadTenantId();
const std::string& AadClientId();
const std::string& AadClientSecret();
@ -61,9 +61,9 @@ namespace Azure { namespace Storage { namespace Test {
void DeleteFile(const std::string& filename);
std::string ToISO8601(
std::string ToIso8601(
const std::chrono::system_clock::time_point& time_point,
int numDecimalDigits = 0);
std::string ToRFC1123(const std::chrono::system_clock::time_point& time_point);
std::string ToRfc1123(const std::chrono::system_clock::time_point& time_point);
}}} // namespace Azure::Storage::Test