datalakestg82/change IsServerEncrypted not nullable (#4005)

This commit is contained in:
microzchang 2022-10-09 11:18:08 +08:00 committed by GitHub
parent 60b35a6a4f
commit 6b9aa2f70c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 15 deletions

View File

@ -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.
@ -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.
@ -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.

View File

@ -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(
@ -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(

View File

@ -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 = {
@ -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"];
```
@ -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;
```