Skip to content

Commit 20d9364

Browse files
gearamaantkmsftahsonkhanRickWinter
authored
Storage tables implementation (#5137)
* dss * first pass at a client and tests * constructors work * working request, need to fix the response parsing * basic tests working for service client * refactored the constructors * testproxy and tests * format file * got client and one API working * list working * all apis recorded * new assets.json * assets.json regen * format json * adding word to cspell * fix build issues * fix one more break * typo * clangs * one more issue * more fixezez * regen recordings * try again * clangs * clangs again * new assets * new test proxy * regen tests based on new merge * hmmm * restore * add debug env for test proxy * resync cmake presets from main * gor get and set working * get stats * table client and create * delete * get/set acls * list tables * some cleanup * Create /update/merge/delete * upsert * query entities * generated tests * clangs * some fixes * some more errors * cspells * got transaction API working * transactions working , need to parse response * get data out of the response * clangs * batch1 * regen tests * part 2 * batch3 * batch4 * clangs * regen tests * regen tests * try again * live only * added some more tests for the transaction body * small refactor for tests * oops * some oter update * darn includes * sddfsd * erorr fix * key clients * sas * small cleanup * All tests passing * test recordings * clangs * missing ENV for test * attempt1 * retry * couple recordings * regen some tests * clangs * again * again * comments * comments * headers and footers * some cleanjup * Move folders step1 * revert assets and test resources in storage * revert to main * cspell * readme * comments * revert ci.yml * liveonly test * clangs * camke * ci2 * try again * fdssfs * fdsfsd * some cleanup * dasda * dsdsds * asda * assets * comments * a few more bits and pieces * some other updates for cspell * typo * more docs * spell * another doc error * clangs docs * docs * test cov * dasdas * hg * stress test * cspell * Update sdk/storage/azure-storage-common/test/ut/CMakeLists.txt Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/storage/azure-storage-common/test/ut/shared_key_policy_lite_test.cpp Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/CHANGELOG.md Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/CMakeLists.txt Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/test/stress/scenarios-matrix.yaml Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/test/stress/Dockerfile Co-authored-by: Anton Kolesnyk <[email protected]> * PR comments * respurces cleanup * cleanup 2 * respurce fix * revddrt * weqq * oops * try again * Update sdk/tables/azure-data-tables/vcpkg/vcpkg.json Co-authored-by: Anton Kolesnyk <[email protected]> * try * test fix * samples * readmes * readmes * readmes * api view settings * qualify friends * try * moving usings * refactor for API View tool * some more * clangs * Update sdk/tables/README.md Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/core/azure-core/inc/azure/core/http/http.hpp Co-authored-by: Ahson Khan <[email protected]> * Update sdk/core/azure-core/src/http/transport_policy.cpp Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/inc/azure/data/tables/rest_client.hpp Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/CHANGELOG.md Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/test/ut/CMakeLists.txt Co-authored-by: Anton Kolesnyk <[email protected]> * Update sdk/tables/azure-data-tables/src/rest_client.cpp Co-authored-by: Anton Kolesnyk <[email protected]> * some comments * comments * comments part N * clang * try now * clang * comments * update file names * update test to check for the final signature * ccc * rename shared key policy lite * cleanup some includes * add a couple more tests * small update * clang * increase test limits * xml transition * service_version_policy * shared creds and key policy lite * switch to secondary policy * code done * remove last storage vestiges * put back some code * readme/changelog * Update sdk/tables/azure-data-tables/src/serializers.cpp Co-authored-by: Rick Winter <[email protected]> * Add the shared key policy for Larry * Larry comments * curlybracify the initializers * Update sdk/core/azure-core-xml/inc/azure/core/xml/dll_import_export.hpp Co-authored-by: Rick Winter <[email protected]> * Update sdk/core/azure-core-xml/vcpkg.json Co-authored-by: Rick Winter <[email protected]> * Update sdk/tables/azure-data-tables/inc/azure/data/tables.hpp Co-authored-by: Rick Winter <[email protected]> * Rick's comments one more namespace change for serializers * whiteline * typo * oops * includes and clangs * cleanup * jhfjdhjfd * hjkjdhf * daas * Anton's comments * clang * revert some changes * fdss * Update sdk/core/azure-core-xml/CHANGELOG.md Co-authored-by: Anton Kolesnyk <[email protected]> * everything works * clangs and vcpkg test * test remove azure-core-xml * vcpkg json * remove the code * merge main * saa * wqw * last comments * clang --------- Co-authored-by: Anton Kolesnyk <[email protected]> Co-authored-by: Ahson Khan <[email protected]> Co-authored-by: Rick Winter <[email protected]>
1 parent 9d3870f commit 20d9364

File tree

73 files changed

+8481
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+8481
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,4 +359,4 @@ build/
359359
# Default Assets restore directory
360360
.assets
361361

362-
CMakeUserPresets.json
362+
CMakeUserPresets.json

.vscode/cspell.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"eng/CredScanSuppression.json",
4242
"**/test/ut/recordings/*.json",
4343
"sdk/core/azure-core-amqp/vendor/**/*",
44-
"sdk/storage/*/NOTICE.txt"
44+
"sdk/storage/*/NOTICE.txt",
45+
"sdk/tables/*/NOTICE.txt"
4546
],
4647
// * Unless configured otherwise, these words are not case sensitive
4748
// * Alphabetize the list when making changes so the list is easier for future
@@ -149,6 +150,7 @@
149150
"mbps",
150151
"MHSM",
151152
"mmdc",
153+
"mmspecial",
152154
"moxygen",
153155
"MSAL",
154156
"msft",
@@ -168,6 +170,7 @@
168170
"nostd",
169171
"nread",
170172
"NTSTATUS",
173+
"odata",
171174
"Oaep",
172175
"OIDC",
173176
"okhttp",
@@ -210,6 +213,7 @@
210213
"stoull",
211214
"STREQ",
212215
"Sutou",
216+
"testid",
213217
"swedencentral",
214218
"switzerlandnorth",
215219
"switzerlandwest",
@@ -349,6 +353,14 @@
349353
"pfile"
350354
]
351355
},
356+
{
357+
"filename": "**/sdk/tables/test-resources.json",
358+
"words": [
359+
"bfqt",
360+
"rwdlacup",
361+
"pfile"
362+
]
363+
},
352364
{
353365
"filename": "**/sdk/storage/faq.md",
354366
"words": [

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ add_subdirectory(sdk/identity)
161161
add_subdirectory(sdk/keyvault)
162162
add_subdirectory(sdk/storage)
163163
add_subdirectory(sdk/template)
164+
add_subdirectory(sdk/tables)
164165

165166
if(BUILD_SAMPLES)
166167
add_subdirectory(samples/integration/vcpkg-all-smoke)

cmake-modules/FolderList.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ macro(GetFolderList project)
3030
elseif(${project} STREQUAL STORAGE_QUEUES)
3131
DownloadDepVersion(sdk/core azure-core 1.10.3)
3232
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.5.0)
33+
elseif(${project} STREQUAL DATA_TABLES)
34+
DownloadDepVersion(sdk/core azure-core 1.10.3)
3335
elseif(${project} STREQUAL EVENTHUBS)
3436
DownloadDepVersion(sdk/core azure-core 1.10.1)
3537
DownloadDepVersion(sdk/core azure-core-amqp 1.0.0-beta.1)
@@ -39,6 +41,8 @@ macro(GetFolderList project)
3941
DownloadDepVersion(sdk/eventhubs azure-messaging-eventhubs 1.0.0-beta.3)
4042
DownloadDepVersion(sdk/storage/azure-storage-common azure-storage-common 12.3.3)
4143
DownloadDepVersion(sdk/storage/azure-storage-blobs azure-storage-blobs 12.8.0)
44+
elseif(${project} STREQUAL CORE_XML)
45+
DownloadDepVersion(sdk/core azure-core 1.10.3)
4246
endif()
4347
list(REMOVE_DUPLICATES BUILD_FOLDERS)
4448
endmacro()

sdk/tables/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
cmake_minimum_required (VERSION 3.13)
5+
6+
project (azure-data LANGUAGES CXX)
7+
8+
add_subdirectory(azure-data-tables)

sdk/tables/assets.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "cpp",
4+
"TagPrefix": "cpp/tables",
5+
"Tag": "cpp/tables_a490279ed7"
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
### Features Added
6+
7+
- Initial release
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake-modules")
5+
include(AzureVcpkg)
6+
az_vcpkg_integrate()
7+
8+
cmake_minimum_required (VERSION 3.13)
9+
project(azure-data-tables LANGUAGES CXX)
10+
11+
set(CMAKE_CXX_STANDARD 14)
12+
set(CMAKE_CXX_STANDARD_REQUIRED True)
13+
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
14+
15+
option(FETCH_SOURCE_DEPS "build source dependencies" OFF)
16+
17+
include(AzureVersion)
18+
include(AzureCodeCoverage)
19+
include(AzureTransportAdapters)
20+
include(AzureDoxygen)
21+
include(AzureGlobalCompileOptions)
22+
include(AzureConfigRTTI)
23+
include(AzureBuildTargetForCI)
24+
include(CreateMapFile)
25+
26+
if(FETCH_SOURCE_DEPS)
27+
set(AZ_ALL_LIBRARIES ON)
28+
include(FolderList)
29+
SetCompileOptions(DATA_TABLES)
30+
GetFolderList(DATA_TABLES)
31+
foreach(oneFolder IN LISTS BUILD_FOLDERS)
32+
message("add folder ${oneFolder}")
33+
add_subdirectory(${oneFolder} EXCLUDE_FROM_ALL)
34+
endforeach()
35+
elseif(NOT AZ_ALL_LIBRARIES)
36+
find_package(azure-core-cpp CONFIG QUIET)
37+
if(NOT azure-core-cpp_FOUND)
38+
find_package(azure-core-cpp REQUIRED)
39+
endif()
40+
endif()
41+
42+
set(
43+
AZURE_DATA_TABLES_HEADER
44+
inc/azure/data/tables/account_sas_builder.hpp
45+
inc/azure/data/tables/dll_import_export.hpp
46+
inc/azure/data/tables/internal/cryptography/hmacsha256.hpp
47+
inc/azure/data/tables/internal/cryptography/url_encode.hpp
48+
inc/azure/data/tables/internal/policies/service_version_policy.hpp
49+
inc/azure/data/tables/internal/policies/shared_key_lite_policy.hpp
50+
inc/azure/data/tables/internal/policies/shared_key_policy.hpp
51+
inc/azure/data/tables/internal/policies/switch_to_secondary_policy.hpp
52+
inc/azure/data/tables/internal/policies/tenant_bearer_token_policy.hpp
53+
inc/azure/data/tables/internal/policies/timeout_policy.hpp
54+
inc/azure/data/tables/internal/serializers.hpp
55+
inc/azure/data/tables/internal/xml_wrapper.hpp
56+
inc/azure/data/tables/models.hpp
57+
inc/azure/data/tables/rtti.hpp
58+
inc/azure/data/tables.hpp
59+
inc/azure/data/tables/tables_clients.hpp
60+
inc/azure/data/tables/transactions.hpp
61+
inc/azure/data/tables/credentials/shared_key_credential.hpp
62+
)
63+
64+
set(
65+
AZURE_DATA_TABLES_SOURCE
66+
src/account_sas_builder.cpp
67+
src/credentials/shared_key_credential.cpp
68+
src/cryptography/hmacsha256.cpp
69+
src/policies/shared_key_lite_policy.cpp
70+
src/policies/shared_key_policy.cpp
71+
src/policies/switch_to_secondary_policy.cpp
72+
src/policies/tenant_bearer_token_policy.cpp
73+
src/policies/timeout_policy.cpp
74+
src/private/package_version.hpp
75+
src/serializers.cpp
76+
src/tables_clients.cpp
77+
src/transactions.cpp
78+
src/xml_wrapper.cpp
79+
)
80+
81+
add_library(azure-data-tables ${AZURE_DATA_TABLES_HEADER} ${AZURE_DATA_TABLES_SOURCE})
82+
create_per_service_target_build(tables azure-data-tables)
83+
# make sure that users can consume the project as a library.
84+
add_library(Azure::azure-data-tables ALIAS azure-data-tables)
85+
86+
if(WIN32)
87+
target_link_libraries(azure-data-tables PRIVATE bcrypt webservices crypt32)
88+
else()
89+
# Required for Hashing (sha ).
90+
find_package(OpenSSL REQUIRED)
91+
target_link_libraries(azure-data-tables PRIVATE OpenSSL::SSL)
92+
find_package(LibXml2 REQUIRED)
93+
target_include_directories(azure-data-tables SYSTEM PRIVATE ${LIBXML2_INCLUDE_DIRS})
94+
target_link_libraries(azure-data-tables PRIVATE ${LIBXML2_LIBRARIES})
95+
endif()
96+
97+
target_include_directories(
98+
azure-data-tables
99+
PUBLIC
100+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
101+
$<INSTALL_INTERFACE:include>
102+
)
103+
104+
target_link_libraries(azure-data-tables PUBLIC Azure::azure-core)
105+
106+
get_az_version("${CMAKE_CURRENT_SOURCE_DIR}/src/private/package_version.hpp")
107+
generate_documentation(azure-data-tables ${AZ_LIBRARY_VERSION})
108+
109+
az_vcpkg_export(
110+
azure-data-tables
111+
DATA_TABLES
112+
azure/data/tables/dll_import_export.hpp
113+
)
114+
115+
az_rtti_setup(
116+
azure-data-tables
117+
DATA_TABLES
118+
azure/data/tables/rtti.hpp
119+
)
120+
121+
# coverage. Has no effect if BUILD_CODE_COVERAGE is OFF
122+
create_code_coverage(tables azure-data-tables azure-data-tables-test "tests?/*;samples?/*")
123+
124+
if(BUILD_TESTING)
125+
add_subdirectory(test/ut)
126+
add_subdirectory(test/stress)
127+
endif()
128+
129+
if(BUILD_SAMPLES)
130+
add_subdirectory(samples)
131+
endif()

0 commit comments

Comments
 (0)