cspell fixes for keyvault (#2812)

* cspell fixes for keyvault

* formatting issues
This commit is contained in:
George Arama 2021-08-30 19:49:22 -07:00 committed by GitHub
parent bc38afd6ef
commit 9ef8d5a45f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 52 additions and 35 deletions

7
.vscode/cspell.json vendored
View File

@ -17,7 +17,8 @@
"*nlohmann-json*",
"sdk/identity/**/*",
"sdk/core/**/*",
"sdk/keyvault/**/*"
"sdk/keyvault/azure-security-keyvault-keys/test/ut/recordings/*.json",
"sdk/keyvault/azure-security-keyvault-keys/test/ut/key_client_import_test_live.cpp"
],
// * Unless configured otherwise, these words are not case sensitive
// * Alphabetize the list when making changes so the list is easier for future
@ -35,12 +36,14 @@
"Cobertura",
"ctest",
"DCMAKE",
"deserializers",
"Deserializes",
"docfx",
"DPAPI",
"DRUN",
"DWARNINGS",
"eastus",
"echsmkey",
"Edlund",
"Favicon",
"gcovr",
@ -56,6 +59,7 @@
"Lohmann",
"LPBYTE",
"LPSTR",
"MHSM",
"moxygen",
"MSRC",
"Niels",
@ -79,6 +83,7 @@
"retriable",
"rwxrw",
"SDDL",
"serializers",
"Seriot",
"SPDX",
"stoi",

View File

@ -94,18 +94,21 @@ namespace Azure {
AZ_SECURITY_KEYVAULT_KEYS_DLLEXPORT static const SignatureAlgorithm RS512;
/**
* cspell: disable-next-line
* @brief An RSASSA-PSS using SHA-256 and MGF1 with SHA-256 #SignatureAlgorithm
*
*/
AZ_SECURITY_KEYVAULT_KEYS_DLLEXPORT static const SignatureAlgorithm PS256;
/**
* cspell: disable-next-line
* @brief An RSASSA-PSS using SHA-384 and MGF1 with SHA-384 #SignatureAlgorithm
*
*/
AZ_SECURITY_KEYVAULT_KEYS_DLLEXPORT static const SignatureAlgorithm PS384;
/**
* cspell: disable-next-line
* @brief An RSASSA-PSS using SHA-512 and MGF1 with SHA-512 #SignatureAlgorithm
*
*/
@ -130,6 +133,7 @@ namespace Azure {
AZ_SECURITY_KEYVAULT_KEYS_DLLEXPORT static const SignatureAlgorithm ES512;
/**
* cspell: disable-next-line
* @brief An ECDSA with a secp256k1 curve #SignatureAlgorithm
*
*/
@ -370,7 +374,7 @@ namespace Azure {
struct UnwrapResult final
{
/**
* @brief Gets the key identifier of the #Key used to uwrap.
* @brief Gets the key identifier of the #Key used to unwrap.
*
*/
std::string KeyId;

View File

@ -67,6 +67,7 @@ int main()
// and then base 64 encoded. It is not relevant for the sample how to create the SHA256
// hashed digest.
std::vector<uint8_t> digest
// cspell: disable-next-line
= Azure::Core::Convert::Base64Decode("DU9EdhpwhJqnGnieD0qKYEz6e8QPKlOVpYZZro");
// Sign and Verify from digest

View File

@ -112,8 +112,10 @@ TEST_F(MockedTransportAdapterTest, CreateKeyRSA2)
EXPECT_EQ(response.Value.GetKeyType(), KeyVaultKeyType::Rsa);
}
// cspell: disable-next-line
TEST_F(MockedTransportAdapterTest, CreateKeyRSAHSM)
{
// cspell: disable-next-line
std::string applicationId("CreateKeyRSAHSM");
m_clientOptions.Telemetry.ApplicationId = applicationId;
m_client = std::make_unique<
@ -142,8 +144,10 @@ TEST_F(MockedTransportAdapterTest, CreateKeyEC)
EXPECT_EQ(response.Value.GetKeyType(), KeyVaultKeyType::Ec);
}
// cspell: disable-next-line
TEST_F(MockedTransportAdapterTest, CreateKeyECHSM)
{
// cspell: disable-next-line
std::string applicationId("CreateKeyECHSM");
m_clientOptions.Telemetry.ApplicationId = applicationId;
m_client = std::make_unique<
@ -172,8 +176,10 @@ TEST_F(MockedTransportAdapterTest, CreateKeyOCT)
EXPECT_EQ(response.Value.GetKeyType(), KeyVaultKeyType::Oct);
}
// cspell: disable-next-line
TEST_F(MockedTransportAdapterTest, CreateKeyOCTHSM)
{
// cspell: disable-next-line
std::string applicationId("CreateKeyOCTHSM");
m_clientOptions.Telemetry.ApplicationId = applicationId;
m_client = std::make_unique<

View File

@ -63,15 +63,17 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam
{
char* result;
std::string keyType = "RSA";
// cspell: disable-next-line
if (header.find("CreateKeyRSAHSM") != std::string::npos)
{
keyType = "RSA-HSM";
}
// cspell: disable-next-line
else if (header.find("CreateKeyECHSM") != std::string::npos)
{
keyType = "EC-HSM";
}
// cspell: disable-next-line
else if (header.find("CreateKeyOCTHSM") != std::string::npos)
{
keyType = "oct-HSM";

View File

@ -20,7 +20,7 @@ int main()
SecretClient secretClient(std::getenv("AZURE_KEYVAULT_URL"), credential);
// just a response, with a secret
// auto response = secretClient.GetSecret("testSecret");
// response.Value.Properties.ContentType = "weqeq";
// response.Value.Properties.ContentType = "content";
// GetSecretOptions options;
// response = secretClient.UpdateSecretProperties(
@ -42,7 +42,7 @@ int main()
{
auto resumeToken = response6.GetResumeToken();
auto response7 = response6.CreateFromResumeToken(resumeToken, secretClient);
auto reasponse8 = response7.Poll();
auto response8 = response7.Poll();
}
// auto response4 = secretClient.BackupSecret("someSecret2");
// auto response5 = secretClient.RestoreSecretBackup(response4.Value.Secret);

View File

@ -49,5 +49,6 @@ TEST(RestoreSecretSerializer, SomeValue)
auto jsonParser = json::parse(secret);
EXPECT_EQ(secret.size(), size_t(26));
// cspell: disable-next-line
EXPECT_EQ(jsonParser["value"], "bXkgbmFtZSBpcw");
}

View File

@ -39,10 +39,8 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
auto response
= Azure::Core::Http::RawResponse(1, 1, Azure::Core::Http::HttpStatusCode::Ok, "OK");
constexpr static const uint8_t responseBody[] = R"json({
"value": "bXkgbmFtZSBpcw=="
}
)json";
// cspell: disable-next-line
constexpr static const uint8_t responseBody[] = R"json({"value": "bXkgbmFtZSBpcw=="})json";
response.SetHeader(HttpShared::ContentType, "application/json");
response.SetHeader(HttpShared::MsRequestId, "1");

View File

@ -98,9 +98,9 @@ TEST(DeletedSecretSerializer, GetDeletedClientDeserializeFull3)
TEST(SecretProperties, FactoryValid)
{
std::string url(
"https://myvault.vault.azure.net/secrets/mysecretname/4387e9f3d6e14c459867679a90fd0f79");
"https://myvault.vault.azure.net/secrets/my_secret_name/4387e9f3d6e14c459867679a90fd0f79");
SecretProperties props = SecretProperties::CreateFromURL(url);
EXPECT_EQ(props.Name, "mysecretname");
EXPECT_EQ(props.Name, "my_secret_name");
EXPECT_EQ(props.Version, "4387e9f3d6e14c459867679a90fd0f79");
EXPECT_EQ(props.Id, url);
EXPECT_EQ(props.VaultUrl, "https://myvault.vault.azure.net");

View File

@ -21,8 +21,8 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
= Azure::Core::Http::RawResponse(1, 1, Azure::Core::Http::HttpStatusCode::Ok, "OK");
constexpr static const uint8_t responseBody[] = R"json({
"value": "mysecretvalue",
"id": "https://myvault.vault.azure.net/secrets/mysecretname/4387e9f3d6e14c459867679a90fd0f79",
"value": "my_secret_value",
"id": "https://myvault.vault.azure.net/secrets/my_secret_name/4387e9f3d6e14c459867679a90fd0f79",
"managed":true,
"attributes": {
"enabled": true,
@ -49,8 +49,8 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
= Azure::Core::Http::RawResponse(1, 1, Azure::Core::Http::HttpStatusCode::Ok, "OK");
constexpr static const uint8_t responseBody[] = R"json({
"value": "mysecretvalue",
"id": "https://myvault.vault.azure.net/secrets/mysecretname/4387e9f3d6e14c459867679a90fd0f79",
"value": "my_secret_value",
"id": "https://myvault.vault.azure.net/secrets/my_secret_name/4387e9f3d6e14c459867679a90fd0f79",
"contentType" : "ct",
"kid": "kid",
"managed": true,
@ -84,7 +84,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
"deletedDate": 1493938433,
"scheduledPurgeDate": 1501714433,
"managed": true,
"id": "https://myvault.vault.azure.net/secrets/mysecretname/4387e9f3d6e14c459867679a90fd0f79",
"id": "https://myvault.vault.azure.net/secrets/my_secret_name/4387e9f3d6e14c459867679a90fd0f79",
"attributes": {
"enabled": true,
"created": 1493938433,
@ -107,16 +107,16 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
{
if (expectValue)
{
EXPECT_EQ(secret.Value.Value(), "mysecretvalue");
EXPECT_EQ(secret.Value.Value(), "my_secret_value");
}
EXPECT_EQ(secret.Name, "mysecretname");
EXPECT_EQ(secret.Name, "my_secret_name");
EXPECT_EQ(secret.Properties.VaultUrl, "https://myvault.vault.azure.net");
EXPECT_EQ(secret.Properties.Version, "4387e9f3d6e14c459867679a90fd0f79");
EXPECT_EQ(secret.Properties.Id, secret.Id);
EXPECT_EQ(
secret.Id,
"https://myvault.vault.azure.net/secrets/mysecretname/"
"https://myvault.vault.azure.net/secrets/my_secret_name/"
"4387e9f3d6e14c459867679a90fd0f79");
EXPECT_EQ(secret.Properties.Managed, true);
EXPECT_EQ(secret.Properties.KeyId.HasValue(), false);
@ -128,18 +128,18 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
{
if (expectValue)
{
EXPECT_EQ(secret.Value.Value(), "mysecretvalue");
EXPECT_EQ(secret.Value.Value(), "my_secret_value");
EXPECT_EQ(secret.Properties.ContentType.Value(), "ct");
EXPECT_EQ(secret.Properties.KeyId.Value(), "kid");
}
EXPECT_EQ(secret.Name, "mysecretname");
EXPECT_EQ(secret.Name, "my_secret_name");
EXPECT_EQ(secret.Properties.VaultUrl, "https://myvault.vault.azure.net");
EXPECT_EQ(secret.Properties.Version, "4387e9f3d6e14c459867679a90fd0f79");
EXPECT_EQ(secret.Properties.Id, secret.Id);
EXPECT_EQ(
secret.Id,
"https://myvault.vault.azure.net/secrets/mysecretname/"
"https://myvault.vault.azure.net/secrets/my_secret_name/"
"4387e9f3d6e14c459867679a90fd0f79");
EXPECT_EQ(secret.Properties.Enabled.Value(), true);
EXPECT_EQ(secret.Properties.Managed, true);

View File

@ -26,7 +26,7 @@ TEST(SecretPropertiesPagedResponse, SingleWithNext)
EXPECT_EQ(item.Enabled.Value(), true);
EXPECT_EQ(item.RecoverableDays.Value(), 90);
EXPECT_EQ(item.RecoveryLevel.Value(), "Recoverable+Purgeable");
EXPECT_EQ(item.Id, "https://gearama-test2.vault.azure.net/secrets/gdfgfd");
EXPECT_EQ(item.Id, "https://gearama-test2.vault.azure.net/secrets/magic");
}
TEST(SecretPropertiesPagedResponse, MultipleNoNext)
@ -44,8 +44,8 @@ TEST(SecretPropertiesPagedResponse, MultipleNoNext)
EXPECT_EQ(item.RecoveryLevel.Value(), "Recoverable+Purgeable");
EXPECT_EQ(
item.Id,
"https://gearama-test2.vault.azure.net/secrets/gdfgfd/5a0fdd819481420eac6f3282ce722461");
EXPECT_EQ(item.Name, "gdfgfd");
"https://gearama-test2.vault.azure.net/secrets/magic/5a0fdd819481420eac6f3282ce722461");
EXPECT_EQ(item.Name, "magic");
EXPECT_EQ(item.Version, "5a0fdd819481420eac6f3282ce722461");
item = result.Items[1];
@ -54,8 +54,8 @@ TEST(SecretPropertiesPagedResponse, MultipleNoNext)
EXPECT_EQ(item.RecoveryLevel.Value(), "Recoverable+Purgeable");
EXPECT_EQ(
item.Id,
"https://gearama-test2.vault.azure.net/secrets/gdfgfd/8faafbb99216484dbbd75f9dd6bcaadf");
EXPECT_EQ(item.Name, "gdfgfd");
"https://gearama-test2.vault.azure.net/secrets/magic/8faafbb99216484dbbd75f9dd6bcaadf");
EXPECT_EQ(item.Name, "magic");
EXPECT_EQ(item.Version, "8faafbb99216484dbbd75f9dd6bcaadf");
item = result.Items[2];
@ -64,8 +64,8 @@ TEST(SecretPropertiesPagedResponse, MultipleNoNext)
EXPECT_EQ(item.RecoveryLevel.Value(), "Recoverable+Purgeable");
EXPECT_EQ(
item.Id,
"https://gearama-test2.vault.azure.net/secrets/gdfgfd/d75080822f03400ab4d658bd0e988ac5");
EXPECT_EQ(item.Name, "gdfgfd");
"https://gearama-test2.vault.azure.net/secrets/magic/d75080822f03400ab4d658bd0e988ac5");
EXPECT_EQ(item.Name, "magic");
EXPECT_EQ(item.Version, "d75080822f03400ab4d658bd0e988ac5");
}

View File

@ -39,7 +39,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
"recoveryLevel": "Recoverable+Purgeable",
"updated": 1627404049
},
"id": "https://gearama-test2.vault.azure.net/secrets/gdfgfd"
"id": "https://gearama-test2.vault.azure.net/secrets/magic"
}]
}
)json";
@ -69,8 +69,8 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
"recoveryLevel": "Recoverable+Purgeable",
"updated": 1628101925
},
"contentType": "fdsfdsfs",
"id": "https://gearama-test2.vault.azure.net/secrets/gdfgfd/5a0fdd819481420eac6f3282ce722461",
"contentType": "content",
"id": "https://gearama-test2.vault.azure.net/secrets/magic/5a0fdd819481420eac6f3282ce722461",
"tags": {}
}, {
"attributes": {
@ -80,7 +80,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
"recoveryLevel": "Recoverable+Purgeable",
"updated": 1627404049
},
"id": "https://gearama-test2.vault.azure.net/secrets/gdfgfd/8faafbb99216484dbbd75f9dd6bcaadf"
"id": "https://gearama-test2.vault.azure.net/secrets/magic/8faafbb99216484dbbd75f9dd6bcaadf"
}, {
"attributes": {
"created": 1628101911,
@ -89,7 +89,7 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
"recoveryLevel": "Recoverable+Purgeable",
"updated": 1628101911
},
"id": "https://gearama-test2.vault.azure.net/secrets/gdfgfd/d75080822f03400ab4d658bd0e988ac5",
"id": "https://gearama-test2.vault.azure.net/secrets/magic/d75080822f03400ab4d658bd0e988ac5",
"tags": {}
}]
}

View File

@ -67,7 +67,7 @@
"type": "string",
"defaultValue": ".vault.azure.net",
"metadata": {
"description": "Domain suffix for sovereign clouds, requies the preceeding '.'. The default uses the public Azure Cloud (.vault.azure.net)"
"description": "Domain suffix for sovereign clouds, requires the preceeding '.'. The default uses the public Azure Cloud (.vault.azure.net)"
}
},
"keyVaultSku": {