Skip to content

Commit

Permalink
datalakestg82/change IsServerEncrypted not nullable (#4005)
Browse files Browse the repository at this point in the history
  • Loading branch information
microzchang authored Oct 9, 2022
1 parent 60b35a6 commit 6b9aa2f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* The value of this header is set to true if the contents of the request are successfully
* encrypted using the specified algorithm, and false otherwise.
*/
Nullable<bool> IsServerEncrypted;
bool IsServerEncrypted = bool();
/**
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
* returned when the blob was encrypted with a customer-provided key.
Expand Down Expand Up @@ -298,7 +298,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* The value of this header is set to true if the contents of the request are successfully
* encrypted using the specified algorithm, and false otherwise.
*/
Nullable<bool> IsServerEncrypted;
bool IsServerEncrypted = bool();
/**
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
* returned when the blob was encrypted with a customer-provided key.
Expand All @@ -319,7 +319,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
* The value of this header is set to true if the contents of the request are successfully
* encrypted using the specified algorithm, and false otherwise.
*/
Nullable<bool> IsServerEncrypted;
bool IsServerEncrypted = bool();
/**
* The SHA-256 hash of the encryption key used to encrypt the blob. This header is only
* returned when the blob was encrypted with a customer-provided key.
Expand Down
14 changes: 4 additions & 10 deletions sdk/storage/azure-storage-files-datalake/src/rest_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,11 +691,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
response.LastModified = DateTime::Parse(
pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123);
response.FileSize = std::stoll(pRawResponse->GetHeaders().at("Content-Length"));
if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0)
{
response.IsServerEncrypted
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
}
response.IsServerEncrypted
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0)
{
response.EncryptionKeySha256 = Core::Convert::Base64Decode(
Expand Down Expand Up @@ -775,11 +772,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
= Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64"));
response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64;
}
if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0)
{
response.IsServerEncrypted
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
}
response.IsServerEncrypted
= pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true");
if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0)
{
response.EncryptionKeySha256 = Core::Convert::Base64Decode(
Expand Down
3 changes: 1 addition & 2 deletions sdk/storage/azure-storage-files-datalake/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ directive:
$["201"].headers["Content-Length"]["x-ms-client-name"] = "FileSize";
$["201"].headers["Content-Length"]["x-nullable"] = true;
$["201"].headers["x-ms-request-server-encrypted"]["x-nullable"] = true;
$["201"].headers["x-ms-request-server-encrypted"]["x-ms-client-default"] = "bool()";
$["201"].headers["x-ms-encryption-key-sha256"]["x-nullable"] = true;
delete $["201"].headers["x-ms-continuation"];
$["201"].schema = {
Expand Down Expand Up @@ -436,7 +437,6 @@ directive:
$["Content-MD5"]["x-nullable"] = true;
$["x-ms-content-crc64"]["x-ms-client-name"] = "TransactionalContentHash";
$["x-ms-content-crc64"]["x-nullable"] = true;
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
$["x-ms-encryption-key-sha256"]["x-nullable"] = true;
delete $["ETag"];
```
Expand All @@ -449,6 +449,5 @@ directive:
where: $["x-ms-paths"]["/{filesystem}/{path}?action=flush"].patch.responses["200"].headers
transform: >
$["Content-Length"]["x-ms-client-name"] = "FileSize";
$["x-ms-request-server-encrypted"]["x-nullable"] = true;
$["x-ms-encryption-key-sha256"]["x-nullable"] = true;
```

0 comments on commit 6b9aa2f

Please sign in to comment.