Skip to content

Commit 6b9aa2f

Browse files
authored
datalakestg82/change IsServerEncrypted not nullable (#4005)
1 parent 60b35a6 commit 6b9aa2f

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
162162
* The value of this header is set to true if the contents of the request are successfully
163163
* encrypted using the specified algorithm, and false otherwise.
164164
*/
165-
Nullable<bool> IsServerEncrypted;
165+
bool IsServerEncrypted = bool();
166166
/**
167167
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
168168
* returned when the blob was encrypted with a customer-provided key.
@@ -298,7 +298,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
298298
* The value of this header is set to true if the contents of the request are successfully
299299
* encrypted using the specified algorithm, and false otherwise.
300300
*/
301-
Nullable<bool> IsServerEncrypted;
301+
bool IsServerEncrypted = bool();
302302
/**
303303
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
304304
* returned when the blob was encrypted with a customer-provided key.
@@ -319,7 +319,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
319319
* The value of this header is set to true if the contents of the request are successfully
320320
* encrypted using the specified algorithm, and false otherwise.
321321
*/
322-
Nullable<bool> IsServerEncrypted;
322+
bool IsServerEncrypted = bool();
323323
/**
324324
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
325325
* returned when the blob was encrypted with a customer-provided key.

sdk/storage/azure-storage-files-datalake/src/rest_client.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
691691
response.LastModified = DateTime::Parse(
692692
pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123);
693693
response.FileSize = std::stoll(pRawResponse->GetHeaders().at("Content-Length"));
694-
if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0)
695-
{
696-
response.IsServerEncrypted
697-
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
698-
}
694+
response.IsServerEncrypted
695+
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
699696
if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0)
700697
{
701698
response.EncryptionKeySha256 = Core::Convert::Base64Decode(
@@ -775,11 +772,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
775772
= Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64"));
776773
response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64;
777774
}
778-
if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0)
779-
{
780-
response.IsServerEncrypted
781-
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
782-
}
775+
response.IsServerEncrypted
776+
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
783777
if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0)
784778
{
785779
response.EncryptionKeySha256 = Core::Convert::Base64Decode(

sdk/storage/azure-storage-files-datalake/swagger/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ directive:
259259
$["201"].headers["Content-Length"]["x-ms-client-name"] = "FileSize";
260260
$["201"].headers["Content-Length"]["x-nullable"] = true;
261261
$["201"].headers["x-ms-request-server-encrypted"]["x-nullable"] = true;
262+
$["201"].headers["x-ms-request-server-encrypted"]["x-ms-client-default"] = "bool()";
262263
$["201"].headers["x-ms-encryption-key-sha256"]["x-nullable"] = true;
263264
delete $["201"].headers["x-ms-continuation"];
264265
$["201"].schema = {
@@ -436,7 +437,6 @@ directive:
436437
$["Content-MD5"]["x-nullable"] = true;
437438
$["x-ms-content-crc64"]["x-ms-client-name"] = "TransactionalContentHash";
438439
$["x-ms-content-crc64"]["x-nullable"] = true;
439-
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
440440
$["x-ms-encryption-key-sha256"]["x-nullable"] = true;
441441
delete $["ETag"];
442442
```
@@ -449,6 +449,5 @@ directive:
449449
where: $["x-ms-paths"]["/{filesystem}/{path}?action=flush"].patch.responses["200"].headers
450450
transform: >
451451
$["Content-Length"]["x-ms-client-name"] = "FileSize";
452-
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
453452
$["x-ms-encryption-key-sha256"]["x-nullable"] = true;
454453
```

0 commit comments

Comments
 (0)