Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/storage/azure-storage-blobs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ elseif(NOT AZ_ALL_LIBRARIES)
find_package(azure-storage-common-cpp REQUIRED)
endif()
endif()
find_package(nanoarrow REQUIRED)

set(
AZURE_STORAGE_BLOBS_HEADER
Expand Down Expand Up @@ -92,6 +93,11 @@ target_include_directories(
)

target_link_libraries(azure-storage-blobs PUBLIC Azure::azure-storage-common)
add_library(flatccrt STATIC IMPORTED)
find_library(FLATCCRT_LIB_PATH_DEBUG NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt_d${CMAKE_STATIC_LIBRARY_SUFFIX} ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX})
find_library(FLATCCRT_LIB_PATH_RELEASE NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}flatccrt${CMAKE_STATIC_LIBRARY_SUFFIX})
set_target_properties(flatccrt PROPERTIES IMPORTED_LOCATION_DEBUG ${FLATCCRT_LIB_PATH_DEBUG} IMPORTED_LOCATION_RELEASE ${FLATCCRT_LIB_PATH_RELEASE} IMPORTED_CONFIGURATIONS "Release;Debug")
target_link_libraries(azure-storage-blobs PRIVATE nanoarrow::nanoarrow nanoarrow::nanoarrow_ipc)

target_compile_definitions(azure-storage-blobs PRIVATE _azure_BUILDING_SDK)

Expand Down
10 changes: 10 additions & 0 deletions sdk/storage/azure-storage-blobs/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
}
},
"DevelopmentDependency": false
},
{
"Component": {
"Type": "git",
"git": {
"RepositoryUrl": "https://github.com/apache/arrow-nanoarrow",
"CommitHash": "a579fbf5d192e85b6249935e117de7d02a6dc4e9"
}
},
"DevelopmentDependency": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,37 @@ namespace Azure { namespace Storage { namespace Blobs {
StorageChecksumAlgorithm Algorithm = StorageChecksumAlgorithm::None;
};

/**
* @brief Specifies session token mode used to authenticate blob requests.
*/
enum class SessionMode
{
/**
* @brief Disabled
*/
Disabled,
/**
* @brief Enabled.
*/
Enabled,
};

/**
* @brief Options for configuring session token authentication for blob operations.
*/
struct SessionOptions final
{
/**
* @brief The Account name to use for signing the session key.
*/
std::string AccountName;

/**
* @brief The session authentication mode to use for blob operations.
*/
SessionMode Mode = SessionMode::Disabled;
};

/**
* @brief Client options used to initialize all kinds of blob clients.
*/
Expand Down Expand Up @@ -260,6 +291,11 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Optional. Configures whether to do content validation for blob downloads.
*/
Azure::Nullable<TransferValidationOptions> DownloadValidationOptions;

/**
* @brief Specifies session options used to authenticate blob requests.
*/
Blobs::SessionOptions SessionOptions;
};

/**
Expand Down Expand Up @@ -481,6 +517,16 @@ namespace Azure { namespace Storage { namespace Blobs {
* @brief Specifies the relative path to list paths from.
*/
Azure::Nullable<std::string> StartFrom;

/**
* @brief Specifies the relative path to list paths until.
*/
Azure::Nullable<std::string> EndBefore;

/**
* @brief Specifies whether to use Apache Arrow format instead of XML for the listing response.
*/
bool UseApacheArrow = false;
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,9 @@ namespace Azure { namespace Storage {
friend class Azure::Core::PagedResponse<GetPageRangesDiffPagedResponse>;
};

namespace _detail {
void ParseListBlobsResult(Models::_detail::ListBlobsResult& result);
} // namespace _detail

} // namespace Blobs
}} // namespace Azure::Storage
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,10 @@ namespace Azure { namespace Storage { namespace Blobs {
* Indicates that this root blob has been deleted, but it has versions that are active.
*/
Nullable<bool> HasVersionsOnly;
/**
* Indicates this is a blob or blob prefix.
*/
Nullable<std::string> ResourceType;
/**
* Size in bytes.
*/
Expand Down Expand Up @@ -1422,29 +1426,16 @@ namespace Azure { namespace Storage { namespace Blobs {
}
namespace _detail {
/**
* @brief An enumeration of blobs.
* @brief Response type for #Azure::Storage::Blobs::BlobContainerClient::ListBlobsByHierarchy.
*/
struct ListBlobsResult final
{
std::unique_ptr<Core::IO::BodyStream> BodyStream;
std::string ServiceEndpoint;
std::string BlobContainerName;
std::string Prefix;
Nullable<std::string> ContinuationToken;
/**
* Array of BlobItem.
*/
std::vector<BlobItem> Items;
};
/**
* @brief An enumeration of blobs.
*/
struct ListBlobsByHierarchyResult final
{
std::string ServiceEndpoint;
std::string BlobContainerName;
std::string Prefix;
std::string Delimiter;
Nullable<std::string> ContinuationToken;
/**
* Array of BlobItem.
*/
Expand All @@ -1453,6 +1444,10 @@ namespace Azure { namespace Storage { namespace Blobs {
* Array of BlobName.
*/
std::vector<BlobName> BlobPrefixes;
/**
* The media type of the body of the response. For List Blobs this is 'application/xml'.
*/
std::string ContentType;
};
} // namespace _detail
/**
Expand Down Expand Up @@ -3496,6 +3491,8 @@ namespace Azure { namespace Storage { namespace Blobs {
Nullable<std::int32_t> MaxResults;
Nullable<Models::ListBlobsIncludeFlags> Include;
Nullable<std::string> StartFrom;
Nullable<std::string> Accept;
Nullable<std::string> EndBefore;
};
static Response<Models::_detail::ListBlobsResult> ListBlobs(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -3510,9 +3507,11 @@ namespace Azure { namespace Storage { namespace Blobs {
Nullable<std::int32_t> MaxResults;
Nullable<Models::ListBlobsIncludeFlags> Include;
Nullable<std::string> StartFrom;
Nullable<std::string> Accept;
Nullable<std::string> EndBefore;
Nullable<std::string> ShowOnly;
};
static Response<Models::_detail::ListBlobsByHierarchyResult> ListBlobsByHierarchy(
static Response<Models::_detail::ListBlobsResult> ListBlobsByHierarchy(
Core::Http::_internal::HttpPipeline& pipeline,
const Core::Url& url,
const ListBlobContainerBlobsByHierarchyOptions& options,
Expand Down
8 changes: 7 additions & 1 deletion sdk/storage/azure-storage-blobs/src/blob_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,15 @@ namespace Azure { namespace Storage { namespace Blobs {
options.Audience.HasValue()
? _internal::GetDefaultScopeForAudience(options.Audience.Value().ToString())
: _internal::StorageScope);
_internal::SessionOptions sessionOptions;
if (options.SessionOptions.Mode == SessionMode::Enabled)
{
sessionOptions.Enabled = true;
sessionOptions.AccountName = options.SessionOptions.AccountName;
}
perRetryPolicies.emplace_back(
std::make_unique<_internal::StorageBearerTokenAuthenticationPolicy>(
credential, tokenContext, options.EnableTenantDiscovery));
credential, tokenContext, options.EnableTenantDiscovery, sessionOptions));
}
perOperationPolicies.emplace_back(
std::make_unique<_internal::StorageServiceVersionPolicy>(options.ApiVersion));
Expand Down
Loading
Loading