Commit Graph

839 Commits

Author SHA1 Message Date
Ahson Khan
2a4dfd2f0d
Incorrect use of hashing Final/Append APIs now have an assert failure. (#2317)
Follow up from https://github.com/Azure/azure-sdk-for-cpp/pull/2189
2021-05-19 04:18:16 +00:00
Ahson Khan
75d17550f2
Add argument validation to public APIs. Throw or Precondition/assert failure? (#2189)
* Add argument validation to public APIs.

* Add exception to spell check.

* Revert "Add exception to spell check."

This reverts commit be54b614cc1427ddb2f154f5927f4e612a4a1e28.

* Turn invalid arg excetion to a precondition assert for bodystream read.

* User assert in more places within body_stream.

* Update valiation for hashing and bodystream and update tests.

* Update  precondition test for size_t and add null ptr check

* Fix clang formatting.

* Update changelog and fix up the message for size_t validation in hash.

* Address PR feedback.

* More PR feedback.

* Remove unnecessary comment from test.

* Fix clang format.
2021-05-18 20:10:14 -07:00
Anton Kolesnyk
e5763720d4
Vcpkg fixes (#2311)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-05-18 19:33:59 -07:00
Ahson Khan
65821ec115
Use size_t for buffers representing data in memory rather than int64_t. (#2285)
* Use size_t for buffers representing data in memory rather than int64_t.

* add a cast from size_t to int64_t

* Address feedback - OnRead return size_t.

* Change Read and ReadToCount to return size_t instead of int64_t.

* Update curl usage and ReadFromSocket.

* Missed one signature.

* Update changelog.

* Update transport layer to use the right size_t size.

* Fix curl use of MBS.

* Cast to size_t since that's all memory stream supprts.

* Add static casts to size_t as temporary workarounds.

* update storage tests.

* More test fixes.
2021-05-18 18:51:20 -07:00
JinmingHu
9261e9ddae
copy constructor for RequestFailedException (#2291)
* copy constructor for RequestFailedException

* Apply suggestions from code review

Co-authored-by: Rick Winter <rick.winter@microsoft.com>

Co-authored-by: Victor Vazquez <victor.vazquez@microsoft.com>
Co-authored-by: Rick Winter <rick.winter@microsoft.com>
2021-05-18 22:58:11 +00:00
Ahson Khan
ff126f1eb7
Explore removing use of int within header files to align with guidelines. (#2276)
Part of https://github.com/Azure/azure-sdk-for-cpp/issues/2226

Trying to focus mainly on headers, depending on the conclusion, we'd want to make cpp file changes as well, but that can be done later.

Assuming this is the guideline we want:
https://azure.github.io/azure-sdk/cpp_implementation.html#integer-sizes

![image](https://user-images.githubusercontent.com/6527137/118341184-00d52580-b4d3-11eb-8e96-937cb5899c92.png)

Some places that we still use `int` is for things like unix file desriptor or where APIs like BIO_read from OpenSSL returns an int. Are those exceptions OK?
0b64ab3845/sdk/core/azure-core/inc/azure/core/io/body_stream.hpp (L166)
308e5363ad/sdk/core/azure-core/src/base64.cpp (L87)
2021-05-18 20:49:53 +00:00
Anton Kolesnyk
898a8aee84
Remove Azure::Core::Diagnostics::Logger::Listener typedef (#2282) 2021-05-18 11:43:11 -07:00
JinmingHu
d8214af143
int -> int32_t (#2290) 2021-05-17 22:32:36 -07:00
Anton Kolesnyk
00dfcc2beb
Doxygen comment updates (#2280) 2021-05-17 17:05:06 -07:00
Rick Winter
8c5a885299
Documentation updates (#2277) 2021-05-17 23:59:47 +00:00
Victor Vazquez
e4a18b5eb3
Fault injection test (#2265)
* missing line for single docs

* format

* fault injection test

* winHttp

* storage blobs client with fault injector
2021-05-17 10:34:50 -07:00
JinmingHu
af936e052f
use AZURE_ASSERT in storage code (#2262)
* use AZURE_ASSERT in storage code

* fix build

* clang-format

* fix
2021-05-17 10:06:26 +08:00
Rick Winter
92839dcc56
A few spot fixes in docs (#2275) 2021-05-14 23:42:25 +00:00
Ahson Khan
0b64ab3845
Fix the casing of WinHttp and use WinHTTP (#2274)
Part of https://github.com/Azure/azure-sdk-for-cpp/issues/2260
2021-05-14 23:34:39 +00:00
Anton Kolesnyk
efe4772acb
Update upper/lower/other casing (#2267)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-05-14 12:54:16 -07:00
Anton Kolesnyk
00c47e8ec3
Delete vcpkg readme (#2268)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-05-14 12:53:59 -07:00
JinmingHu
8cc98320d5
- BlobServiceClient::UndeleteBlobContainer doesn't support restoring a deleted container under a different name anymore. (#2263) 2021-05-14 09:31:49 +08:00
Victor Vazquez
f4febae12c
missing line for single docs (#2264)
* missing line for single docs

* format
2021-05-13 17:41:48 -07:00
Ahson Khan
743399eca4
Disable BlobServiceClientTest::UndeleteBlobContainer to keep CI and live tests green (#2259) 2021-05-12 13:40:34 -07:00
Ahson Khan
579a58b250
Fix typo in share_responses docs (#2258) 2021-05-12 19:26:13 +00:00
Anton Kolesnyk
530e49b217
Document final/virtual destructor changes (#2256) 2021-05-12 11:38:17 -07:00
JinmingHu
b4fa6b835a
Fix stream leak issue (#2257)
* Fix stream leak issue

* cl
2021-05-12 09:05:03 +00:00
Ahson Khan
ffd0860e00
Avoid using WinHttpQueryDataAvailable, and use WinHttpReadData directly for better throughput. (#2245)
* Avoid using WinHttpQueryDataAvailable, and use WinHttpReadData directly for better throughput.

* Add back new line at end of file.

* Reorder some lines for readability.
2021-05-11 20:03:14 -07:00
Anton Kolesnyk
ebb112f682
Add final specifier in Storage code (#2238)
Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com>
2021-05-11 17:02:52 -07:00
Anton Kolesnyk
019db35863
Add final specifier (#2237) 2021-05-10 11:57:40 -07:00
Anton Kolesnyk
d73593827f
Update readme for Identity (#2241) 2021-05-10 11:31:12 -07:00
Anton Kolesnyk
5a414fb0a5
Correct options assignment for TokenCredentialOptions (#2239) 2021-05-10 11:30:42 -07:00
JinmingHu
11d3a3f286
add namespace explicit qualifier for friend classes (#2236) 2021-05-08 13:49:09 +08:00
JinmingHu
273d411838
add some coments (#2235) 2021-05-08 04:02:23 +00:00
JinmingHu
2b169ca777
Removed GetBlockListResult::ContentType, moved GetPageRangesResult to detail (#2234) 2021-05-08 11:16:30 +08:00
Ahson Khan
a103e51869
Rename IsBufferedDownload to ShouldBufferResponse to avoid using a (#2210)
storage specific verb in general purpose Request object.
2021-05-07 16:53:07 -07:00
Ahson Khan
23136690af
Add a key type pair context precondition test. (#2223)
* Add a key type pair context precondition test.

* Fixup test since after overriding the key type getting an int value should fail.
2021-05-07 16:22:01 -07:00
Victor Vazquez
1a71c46cbd
[Key Vault Keys] Cryptography client - Encrypt/Decrypt/Wrap/Unwrap/Sing/Verify (#2140) 2021-05-07 21:49:11 +00:00
Ahson Khan
fd9c3e5ebb
Fix true spelling errors across all source and header files within the SDK and add exceptions for false positives. (#2209)
Part of https://github.com/Azure/azure-sdk-for-cpp/issues/1277, checking what types of warnings the CI emits.

Verified all SDK product `.cpp`, `.hpp`, `.txt`, and `.md` files, primarily focused on azure-core. They are all clean now. There are some exceptions that needs to be added for keyvault and storage, but they are false positives, so not a concern.

> `cspell lint --config .vscode/cspell.json *.hpp */**/*.hpp`

CSpell: Files checked: 188, Issues found: 0 in 0 files

> `cspell lint --config .vscode/cspell.json *.cpp */**/*.cpp`

CSpell: Files checked: 186, Issues found: 88 in 15 files (keyvault and storage false positives, or tests)

> `cspell lint --config .vscode/cspell.json *.md */**/*.md`

CSpell: Files checked: 45, Issues found: 5 in 2 files (eng/common)

> `cspell lint --config .vscode/cspell.json *.txt */**/*.txt`

CSpell: Files checked: 44, Issues found: 0 in 0 files

> `cspell lint --config .vscode/cspell.json *.* */**/*`

CSpell: Files checked: 646, Issues found: 328 in 69 files (most of these are in eng\docs\api\assets\style.css or eng/common)

Deprioritize and ignored the errors from the test files (including test resource json files), and `eng/common` since those need to be centrally fixed.
2021-05-07 21:04:58 +00:00
Ahson Khan
597aac06c2
Removed the Azure::Core::Http::Request ctor overload that takes both a bodyStream and a bufferedDownload boolean since it is not used anywhere. (#2212)
* Removed the `Azure::Core::Http::Request` ctor overload that takes both a `bodyStream` and a `bufferedDownload` boolean since it is not used anywhere.

* Add back the unit tests by making them friends.

* Add back line at end of file.
2021-05-07 12:45:12 -07:00
Anton Kolesnyk
43ee2ee192
Additional tests for Nullable<T> (#2215)
Closes #1786
2021-05-07 16:11:41 +00:00
Kan Tang
941b67178e
File/datalake service doxygen comments and detail struct name refine. (#2207)
# Pull Request Checklist

Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:

See the detailed list in the [contributing guide](https://github.com/Azure/azure-sdk-for-cpp/blob/master/CONTRIBUTING.md#pull-requests).

- [x] [C++ Guidelines](https://azure.github.io/azure-sdk/cpp_introduction.html)
- [x] Doxygen docs
- [x] Unit tests
- [x] No unwanted commits/changes
- [x] Descriptive title/description
  - [] PR is single purpose
  - [x] Related issue listed
- [x] Comments in source
- [x] No typos
- [x] Update changelog
- [x] Not work-in-progress
- [x] External references or docs updated
- [x] Self review of PR done
- [x] Any breaking changes?
2021-05-07 07:47:35 +00:00
JinmingHu
3c04ad93a1
Add some comments to common package (#2216) 2021-05-07 13:01:26 +08:00
JinmingHu
8d5ea9e279
Add doxygen doc to blob generated code (#2206) 2021-05-07 03:41:32 +00:00
Victor Vazquez
08c8147f54
Update abort() for AZURE_ASSERT (#2170)
* remove abort from Core
2021-05-06 15:30:46 -07:00
Ahson Khan
7982417480
Fix up wording in changelog for azure core (#2208)
Addressing https://github.com/Azure/azure-sdk-for-cpp/pull/2200#discussion_r626994352
2021-05-06 20:18:37 +00:00
Ahson Khan
9e7b61538e
Remove exposing windows.h header from our public headers within storage. (#2201)
* Remove exposing windows.h header from our public headers within storage.

* Revert "Remove exposing windows.h header from our public headers within storage."

This reverts commit 537d7dd64f65fd5d4b079e793334e840d9b40e70.

* Actually remove exposing windows.h header from the public header in storage.
2021-05-06 11:16:24 -07:00
JinmingHu
2901dbcab9
fix user agent for blob service (#2203) 2021-05-06 20:32:17 +08:00
Victor Vazquez
8e4a1ae59b
Rename download via stream (#2196)
rename parameter for download stream
2021-05-06 02:42:38 +00:00
Ahson Khan
7f0792f114
Add transport layer unit tests with non-ascii host strings as input. (#2198)
* Add transport layer unit tests with non-ascii host strings as input.

* Update test string.
2021-05-05 17:18:46 -07:00
Ahson Khan
e1340dcfa8
Check for context cancellation in more places within the winhttp transport layer before each I/O call. (#2185)
* Check for context cancellation in more places within the winhttp transport layer before each I/O call.

* Update cspell to add exceptions to false positives.

* Address PR feedback.

* Do not check for context cancellation before querying the response headers.
2021-05-05 17:17:54 -07:00
Rick Winter
22770cabbf
Add changelog entry for Uuid improvement (#2200) 2021-05-06 00:09:21 +00:00
Ahson Khan
a77686938a
Remove exposing windows.h header from our public headers and reduce risk of introducing it in non-public headers (#2188)
Fixes https://github.com/Azure/azure-sdk-for-cpp/issues/1853
2021-05-05 23:49:18 +00:00
Victor Vazquez
10d244e511
LRO operation resume token - following factory method design (#2195)
* Add tests for resume token pattern

* update deleteKeyOperation
2021-05-05 23:14:31 +00:00
Victor Vazquez
aa3b6f18f3
Adding noexcpt to isCancelled (#2197)
* Adding noexcpt to isCancelled

* revert cl
2021-05-05 22:01:01 +00:00