customers cannot change sas version anymore (#957)
This commit is contained in:
parent
3838944ab9
commit
43cc2e547c
@ -177,13 +177,6 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
*/
|
||||
struct BlobSasBuilder
|
||||
{
|
||||
/**
|
||||
* @brief The storage service version to use to authenticate requests made with this
|
||||
* shared access signature, and the service version to use when handling requests made with this
|
||||
* shared access signature.
|
||||
*/
|
||||
std::string Version = Storage::Details::c_defaultSasVersion;
|
||||
|
||||
/**
|
||||
* @brief The optional signed protocol field specifies the protocol permitted for a
|
||||
* request made with the SAS.
|
||||
|
||||
@ -130,15 +130,17 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
|
||||
std::string stringToSign = Permissions + "\n" + (StartsOn.HasValue() ? StartsOn.GetValue() : "")
|
||||
+ "\n" + ExpiresOn + "\n" + canonicalName + "\n" + Identifier + "\n"
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Version + "\n"
|
||||
+ resource + "\n" + snapshotVersion + "\n" + CacheControl + "\n" + ContentDisposition + "\n"
|
||||
+ ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n"
|
||||
+ Storage::Details::c_defaultSasVersion + "\n" + resource + "\n" + snapshotVersion + "\n"
|
||||
+ CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage
|
||||
+ "\n" + ContentType;
|
||||
|
||||
std::string signature = Base64Encode(
|
||||
Storage::Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey())));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Storage::Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Storage::Details::UrlEncodeQueryParameter(Storage::Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("spr", Storage::Details::UrlEncodeQueryParameter(protocol));
|
||||
if (StartsOn.HasValue())
|
||||
{
|
||||
@ -219,15 +221,17 @@ namespace Azure { namespace Storage { namespace Blobs {
|
||||
+ userDelegationKey.SignedTenantId + "\n" + userDelegationKey.SignedStartsOn + "\n"
|
||||
+ userDelegationKey.SignedExpiresOn + "\n" + userDelegationKey.SignedService + "\n"
|
||||
+ userDelegationKey.SignedVersion + "\n\n\n\n"
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Version + "\n"
|
||||
+ resource + "\n" + snapshotVersion + "\n" + CacheControl + "\n" + ContentDisposition + "\n"
|
||||
+ ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n"
|
||||
+ Storage::Details::c_defaultSasVersion + "\n" + resource + "\n" + snapshotVersion + "\n"
|
||||
+ CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage
|
||||
+ "\n" + ContentType;
|
||||
|
||||
std::string signature = Base64Encode(
|
||||
Storage::Details::HmacSha256(stringToSign, Base64Decode(userDelegationKey.Value)));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Storage::Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Storage::Details::UrlEncodeQueryParameter(Storage::Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("sr", Storage::Details::UrlEncodeQueryParameter(resource));
|
||||
if (StartsOn.HasValue())
|
||||
{
|
||||
|
||||
@ -202,13 +202,6 @@ namespace Azure { namespace Storage {
|
||||
*/
|
||||
struct AccountSasBuilder
|
||||
{
|
||||
/**
|
||||
* @brief The storage service version to use to authenticate requests made with this
|
||||
* shared access signature, and the service version to use when handling requests made with this
|
||||
* shared access signature.
|
||||
*/
|
||||
std::string Version = Details::c_defaultSasVersion;
|
||||
|
||||
/**
|
||||
* @brief The optional signed protocol field specifies the protocol permitted for a
|
||||
* request made with the SAS.
|
||||
|
||||
@ -98,14 +98,15 @@ namespace Azure { namespace Storage {
|
||||
|
||||
std::string stringToSign = credential.AccountName + "\n" + Permissions + "\n" + services + "\n"
|
||||
+ resourceTypes + "\n" + (StartsOn.HasValue() ? StartsOn.GetValue() : "") + "\n" + ExpiresOn
|
||||
+ "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Version
|
||||
+ "\n";
|
||||
+ "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n"
|
||||
+ Details::c_defaultSasVersion + "\n";
|
||||
|
||||
std::string signature
|
||||
= Base64Encode(Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey())));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Details::UrlEncodeQueryParameter(Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("ss", Details::UrlEncodeQueryParameter(services));
|
||||
builder.AppendQueryParameter("srt", Details::UrlEncodeQueryParameter(resourceTypes));
|
||||
builder.AppendQueryParameter("sp", Details::UrlEncodeQueryParameter(Permissions));
|
||||
|
||||
@ -178,13 +178,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
*/
|
||||
struct DataLakeSasBuilder
|
||||
{
|
||||
/**
|
||||
* @brief The storage service version to use to authenticate requests made with this
|
||||
* shared access signature, and the service version to use when handling requests made with this
|
||||
* shared access signature.
|
||||
*/
|
||||
std::string Version = Storage::Details::c_defaultSasVersion;
|
||||
|
||||
/**
|
||||
* @brief The optional signed protocol field specifies the protocol permitted for a
|
||||
* request made with the SAS.
|
||||
|
||||
@ -125,15 +125,17 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
|
||||
std::string stringToSign = Permissions + "\n" + (StartsOn.HasValue() ? StartsOn.GetValue() : "")
|
||||
+ "\n" + ExpiresOn + "\n" + canonicalName + "\n" + Identifier + "\n"
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Version + "\n"
|
||||
+ resource + "\n" + "\n" + CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding
|
||||
+ "\n" + ContentLanguage + "\n" + ContentType;
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n"
|
||||
+ Storage::Details::c_defaultSasVersion + "\n" + resource + "\n" + "\n" + CacheControl
|
||||
+ "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage + "\n"
|
||||
+ ContentType;
|
||||
|
||||
std::string signature = Base64Encode(
|
||||
Storage::Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey())));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Storage::Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Storage::Details::UrlEncodeQueryParameter(Storage::Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("spr", Storage::Details::UrlEncodeQueryParameter(protocol));
|
||||
if (StartsOn.HasValue())
|
||||
{
|
||||
@ -204,14 +206,16 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
|
||||
+ userDelegationKey.SignedExpiresOn + "\n" + userDelegationKey.SignedService + "\n"
|
||||
+ userDelegationKey.SignedVersion + "\n" + PreauthorizedAgentObjectId + "\n" + AgentObjectId
|
||||
+ "\n" + CorrelationId + "\n" + (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n"
|
||||
+ protocol + "\n" + Version + "\n" + resource + "\n" + "\n" + CacheControl + "\n"
|
||||
+ ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;
|
||||
+ protocol + "\n" + Storage::Details::c_defaultSasVersion + "\n" + resource + "\n" + "\n"
|
||||
+ CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage
|
||||
+ "\n" + ContentType;
|
||||
|
||||
std::string signature = Base64Encode(
|
||||
Storage::Details::HmacSha256(stringToSign, Base64Decode(userDelegationKey.Value)));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Storage::Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Storage::Details::UrlEncodeQueryParameter(Storage::Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("sr", Storage::Details::UrlEncodeQueryParameter(resource));
|
||||
if (StartsOn.HasValue())
|
||||
{
|
||||
|
||||
@ -128,13 +128,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
*/
|
||||
struct ShareSasBuilder
|
||||
{
|
||||
/**
|
||||
* @brief The storage service version to use to authenticate requests made with this
|
||||
* shared access signature, and the service version to use when handling requests made with this
|
||||
* shared access signature.
|
||||
*/
|
||||
std::string Version = Azure::Storage::Details::c_defaultSasVersion;
|
||||
|
||||
/**
|
||||
* @brief The optional signed protocol field specifies the protocol permitted for a
|
||||
* request made with the SAS.
|
||||
|
||||
@ -86,15 +86,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
|
||||
|
||||
std::string stringToSign = Permissions + "\n" + (StartsOn.HasValue() ? StartsOn.GetValue() : "")
|
||||
+ "\n" + ExpiresOn + "\n" + canonicalName + "\n" + Identifier + "\n"
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n" + Version + "\n"
|
||||
+ CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage
|
||||
+ "\n" + ContentType;
|
||||
+ (IPRange.HasValue() ? IPRange.GetValue() : "") + "\n" + protocol + "\n"
|
||||
+ Details::c_defaultSasVersion + "\n" + CacheControl + "\n" + ContentDisposition + "\n"
|
||||
+ ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;
|
||||
|
||||
std::string signature
|
||||
= Base64Encode(Details::HmacSha256(stringToSign, Base64Decode(credential.GetAccountKey())));
|
||||
|
||||
Azure::Core::Http::Url builder;
|
||||
builder.AppendQueryParameter("sv", Details::UrlEncodeQueryParameter(Version));
|
||||
builder.AppendQueryParameter(
|
||||
"sv", Details::UrlEncodeQueryParameter(Details::c_defaultSasVersion));
|
||||
builder.AppendQueryParameter("spr", Details::UrlEncodeQueryParameter(protocol));
|
||||
if (StartsOn.HasValue())
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user