Skip to content

Commit c9f07f1

Browse files
authored
Storage STG98 Features (#6501)
* get set acl oauth (#6405) * Storage STG98/Added support for x-ms-file-request-intent for blob copy APIs (#6406) * Source File Copy Support * Storage STG98/NFS 2 (#6404) * feature * add test record * Update blob sas new string to sign (#6511)
1 parent 2e7848d commit c9f07f1

File tree

22 files changed

+599
-83
lines changed

22 files changed

+599
-83
lines changed

sdk/storage/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "cpp",
44
"TagPrefix": "cpp/storage",
5-
"Tag": "cpp/storage_57a579efb6"
5+
"Tag": "cpp/storage_7bea1dff90"
66
}

sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/blob_options.hpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,12 @@ namespace Azure { namespace Storage { namespace Blobs {
640640
* source.
641641
*/
642642
std::string SourceAuthorization;
643+
644+
/**
645+
* Optional, only applicable (but required) when the source is Azure Storage Files and using
646+
* token authentication. Used to indicate the intent of the request.
647+
*/
648+
Azure::Nullable<Models::FileShareTokenIntent> FileRequestIntent;
643649
};
644650

645651
/**
@@ -1017,6 +1023,12 @@ namespace Azure { namespace Storage { namespace Blobs {
10171023
* source.
10181024
*/
10191025
std::string SourceAuthorization;
1026+
1027+
/**
1028+
* Optional, only applicable (but required) when the source is Azure Storage Files and using
1029+
* token authentication. Used to indicate the intent of the request.
1030+
*/
1031+
Azure::Nullable<Models::FileShareTokenIntent> FileRequestIntent;
10201032
};
10211033

10221034
/**
@@ -1073,6 +1085,12 @@ namespace Azure { namespace Storage { namespace Blobs {
10731085
* source.
10741086
*/
10751087
std::string SourceAuthorization;
1088+
1089+
/**
1090+
* Optional, only applicable (but required) when the source is Azure Storage Files and using
1091+
* token authentication. Used to indicate the intent of the request.
1092+
*/
1093+
Azure::Nullable<Models::FileShareTokenIntent> FileRequestIntent;
10761094
};
10771095

10781096
/**
@@ -1366,6 +1384,12 @@ namespace Azure { namespace Storage { namespace Blobs {
13661384
* source.
13671385
*/
13681386
std::string SourceAuthorization;
1387+
1388+
/**
1389+
* Optional, only applicable (but required) when the source is Azure Storage Files and using
1390+
* token authentication. Used to indicate the intent of the request.
1391+
*/
1392+
Azure::Nullable<Models::FileShareTokenIntent> FileRequestIntent;
13691393
};
13701394

13711395
/**
@@ -1477,6 +1501,12 @@ namespace Azure { namespace Storage { namespace Blobs {
14771501
* source.
14781502
*/
14791503
std::string SourceAuthorization;
1504+
1505+
/**
1506+
* Optional, only applicable (but required) when the source is Azure Storage Files and using
1507+
* token authentication. Used to indicate the intent of the request.
1508+
*/
1509+
Azure::Nullable<Models::FileShareTokenIntent> FileRequestIntent;
14801510
};
14811511

14821512
/**

sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/rest_client.hpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Azure { namespace Storage { namespace Blobs {
3232
/**
3333
* The version used for the operations to Azure storage services.
3434
*/
35-
constexpr static const char* ApiVersion = "2024-08-04";
35+
constexpr static const char* ApiVersion = "2025-07-05";
3636
} // namespace _detail
3737
namespace Models {
3838
/**
@@ -1756,7 +1756,7 @@ namespace Azure { namespace Storage { namespace Blobs {
17561756
/**
17571757
* The tier of page blob on a premium storage account or tier of block blob on blob storage
17581758
* LRS accounts. For a list of allowed premium page blob tiers, see
1759-
* https://learn.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features.
1759+
* https://docs.microsoft.com/en-us/azure/virtual-machines/windows/premium-storage#features.
17601760
* For blob storage LRS accounts, valid values are Hot/Cool/Archive.
17611761
*/
17621762
Nullable<Models::AccessTier> AccessTier;
@@ -2182,6 +2182,20 @@ namespace Azure { namespace Storage { namespace Blobs {
21822182
/** Constant value of type BlobCopySourceTagsMode: Copy */
21832183
AZ_STORAGE_BLOBS_DLLEXPORT const static BlobCopySourceTagsMode Copy;
21842184
};
2185+
/**
2186+
* @brief Valid value is backup.
2187+
*/
2188+
class FileShareTokenIntent final
2189+
: public Core::_internal::ExtendableEnumeration<FileShareTokenIntent> {
2190+
public:
2191+
/** Constructs a new FileShareTokenIntent instance */
2192+
FileShareTokenIntent() = default;
2193+
/** Constructs a new FileShareTokenIntent from a string. */
2194+
explicit FileShareTokenIntent(std::string value) : ExtendableEnumeration(std::move(value)) {}
2195+
2196+
/** Constant value of type FileShareTokenIntent: Backup */
2197+
AZ_STORAGE_BLOBS_DLLEXPORT const static FileShareTokenIntent Backup;
2198+
};
21852199
/**
21862200
* @brief Response type for #Azure::Storage::Blobs::BlobClient::CopyFromUri.
21872201
*/
@@ -3779,6 +3793,7 @@ namespace Azure { namespace Storage { namespace Blobs {
37793793
Nullable<std::string> CopySourceAuthorization;
37803794
Nullable<std::string> EncryptionScope;
37813795
Nullable<Models::BlobCopySourceTagsMode> CopySourceTags;
3796+
Nullable<Models::FileShareTokenIntent> FileRequestIntent;
37823797
Nullable<std::vector<std::uint8_t>> SourceContentcrc64;
37833798
};
37843799
static Response<Models::CopyBlobFromUriResult> CopyFromUri(
@@ -3971,6 +3986,7 @@ namespace Azure { namespace Storage { namespace Blobs {
39713986
ETag SourceIfMatch;
39723987
ETag SourceIfNoneMatch;
39733988
Nullable<std::string> CopySourceAuthorization;
3989+
Nullable<Models::FileShareTokenIntent> FileRequestIntent;
39743990
};
39753991
static Response<Models::UploadPagesFromUriResult> UploadPagesFromUri(
39763992
Core::Http::_internal::HttpPipeline& pipeline,
@@ -4143,6 +4159,7 @@ namespace Azure { namespace Storage { namespace Blobs {
41434159
ETag SourceIfMatch;
41444160
ETag SourceIfNoneMatch;
41454161
Nullable<std::string> CopySourceAuthorization;
4162+
Nullable<Models::FileShareTokenIntent> FileRequestIntent;
41464163
};
41474164
static Response<Models::AppendBlockFromUriResult> AppendBlockFromUri(
41484165
Core::Http::_internal::HttpPipeline& pipeline,
@@ -4230,6 +4247,7 @@ namespace Azure { namespace Storage { namespace Blobs {
42304247
Nullable<bool> CopySourceBlobProperties;
42314248
Nullable<std::string> CopySourceAuthorization;
42324249
Nullable<Models::BlobCopySourceTagsMode> CopySourceTags;
4250+
Nullable<Models::FileShareTokenIntent> FileRequestIntent;
42334251
Nullable<std::vector<std::uint8_t>> SourceContentcrc64;
42344252
};
42354253
static Response<Models::UploadBlockBlobFromUriResult> UploadFromUri(
@@ -4271,6 +4289,7 @@ namespace Azure { namespace Storage { namespace Blobs {
42714289
ETag SourceIfMatch;
42724290
ETag SourceIfNoneMatch;
42734291
Nullable<std::string> CopySourceAuthorization;
4292+
Nullable<Models::FileShareTokenIntent> FileRequestIntent;
42744293
};
42754294
static Response<Models::StageBlockFromUriResult> StageBlockFromUri(
42764295
Core::Http::_internal::HttpPipeline& pipeline,

sdk/storage/azure-storage-blobs/src/append_blob_client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ namespace Azure { namespace Storage { namespace Blobs {
220220
{
221221
protocolLayerOptions.CopySourceAuthorization = options.SourceAuthorization;
222222
}
223+
protocolLayerOptions.FileRequestIntent = options.FileRequestIntent;
224+
223225
return _detail::AppendBlobClient::AppendBlockFromUri(
224226
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
225227
}

sdk/storage/azure-storage-blobs/src/blob_client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ namespace Azure { namespace Storage { namespace Blobs {
714714
{
715715
protocolLayerOptions.CopySourceAuthorization = options.SourceAuthorization;
716716
}
717+
protocolLayerOptions.FileRequestIntent = options.FileRequestIntent;
717718

718719
return _detail::BlobClient::CopyFromUri(*m_pipeline, m_blobUrl, protocolLayerOptions, context);
719720
}

sdk/storage/azure-storage-blobs/src/blob_sas_builder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ namespace Azure { namespace Storage { namespace Sas {
261261
+ canonicalName + "\n" + userDelegationKey.SignedObjectId + "\n"
262262
+ userDelegationKey.SignedTenantId + "\n" + signedStartsOnStr + "\n" + signedExpiresOnStr
263263
+ "\n" + userDelegationKey.SignedService + "\n" + userDelegationKey.SignedVersion
264-
+ "\n\n\n\n" + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n"
264+
+ "\n\n\n\n\n\n" + (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n"
265265
+ SasVersion + "\n" + resource + "\n" + snapshotVersion + "\n" + EncryptionScope + "\n"
266266
+ CacheControl + "\n" + ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage
267267
+ "\n" + ContentType;
@@ -397,7 +397,7 @@ namespace Azure { namespace Storage { namespace Sas {
397397
return Permissions + "\n" + startsOnStr + "\n" + expiresOnStr + "\n" + canonicalName + "\n"
398398
+ userDelegationKey.SignedObjectId + "\n" + userDelegationKey.SignedTenantId + "\n"
399399
+ signedStartsOnStr + "\n" + signedExpiresOnStr + "\n" + userDelegationKey.SignedService
400-
+ "\n" + userDelegationKey.SignedVersion + "\n\n\n\n"
400+
+ "\n" + userDelegationKey.SignedVersion + "\n\n\n\n\n\n"
401401
+ (IPRange.HasValue() ? IPRange.Value() : "") + "\n" + protocol + "\n" + SasVersion + "\n"
402402
+ resource + "\n" + snapshotVersion + "\n" + EncryptionScope + "\n" + CacheControl + "\n"
403403
+ ContentDisposition + "\n" + ContentEncoding + "\n" + ContentLanguage + "\n" + ContentType;

sdk/storage/azure-storage-blobs/src/block_blob_client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ namespace Azure { namespace Storage { namespace Blobs {
383383
{
384384
protocolLayerOptions.CopySourceAuthorization = options.SourceAuthorization;
385385
}
386+
protocolLayerOptions.FileRequestIntent = options.FileRequestIntent;
386387

387388
return _detail::BlockBlobClient::UploadFromUri(
388389
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
@@ -467,6 +468,7 @@ namespace Azure { namespace Storage { namespace Blobs {
467468
{
468469
protocolLayerOptions.CopySourceAuthorization = options.SourceAuthorization;
469470
}
471+
protocolLayerOptions.FileRequestIntent = options.FileRequestIntent;
470472

471473
return _detail::BlockBlobClient::StageBlockFromUri(
472474
*m_pipeline, m_blobUrl, protocolLayerOptions, context);

sdk/storage/azure-storage-blobs/src/page_blob_client.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ namespace Azure { namespace Storage { namespace Blobs {
237237
{
238238
protocolLayerOptions.CopySourceAuthorization = options.SourceAuthorization;
239239
}
240+
protocolLayerOptions.FileRequestIntent = options.FileRequestIntent;
241+
240242
return _detail::PageBlobClient::UploadPagesFromUri(
241243
*m_pipeline, m_blobUrl, protocolLayerOptions, context);
242244
}

0 commit comments

Comments
 (0)