From 446ca6b1d2e026e42662a79291fd4dedfefc13cb Mon Sep 17 00:00:00 2001 From: gracewilcox <43627800+gracewilcox@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:40:25 -0700 Subject: [PATCH] [keyvault] fix doc comments (#21410) * update keys * update certs * charles fix --- sdk/security/keyvault/azadmin/CHANGELOG.md | 2 +- sdk/security/keyvault/azcertificates/autorest.md | 7 +++++++ sdk/security/keyvault/azcertificates/constants.go | 2 +- sdk/security/keyvault/azcertificates/models.go | 2 +- sdk/security/keyvault/azkeys/CHANGELOG.md | 2 +- sdk/security/keyvault/azkeys/autorest.md | 14 ++++++++++++++ sdk/security/keyvault/azkeys/constants.go | 5 ++--- sdk/security/keyvault/azkeys/example_test.go | 2 +- sdk/security/keyvault/azkeys/models.go | 14 +++++++------- sdk/security/keyvault/azkeys/response_types.go | 4 ++-- sdk/security/keyvault/azsecrets/CHANGELOG.md | 2 +- 11 files changed, 38 insertions(+), 18 deletions(-) diff --git a/sdk/security/keyvault/azadmin/CHANGELOG.md b/sdk/security/keyvault/azadmin/CHANGELOG.md index fd2d5939ce76..c319d4a04bc6 100644 --- a/sdk/security/keyvault/azadmin/CHANGELOG.md +++ b/sdk/security/keyvault/azadmin/CHANGELOG.md @@ -1,6 +1,6 @@ ## Release History -### 1.0.1 (2023-08-21) +### 1.0.1 (2023-08-22) #### Other Changes * Upgraded dependencies diff --git a/sdk/security/keyvault/azcertificates/autorest.md b/sdk/security/keyvault/azcertificates/autorest.md index e2860c0dfcf5..7860a40a2a6e 100644 --- a/sdk/security/keyvault/azcertificates/autorest.md +++ b/sdk/security/keyvault/azcertificates/autorest.md @@ -246,4 +246,11 @@ directive: - from: swagger-document where: $.definitions.X509CertificateProperties.properties.key_usage.items transform: $["description"] = "Defines how the certificate's key may be used." + + # remove redundant section of doc comment + - from: + - models.go + - constants.go + where: $ + transform: return $.replace(/For valid values, see JsonWebKeyCurveName./g, ""); ``` diff --git a/sdk/security/keyvault/azcertificates/constants.go b/sdk/security/keyvault/azcertificates/constants.go index f7d133b06da4..2f916b156eb5 100644 --- a/sdk/security/keyvault/azcertificates/constants.go +++ b/sdk/security/keyvault/azcertificates/constants.go @@ -25,7 +25,7 @@ func PossibleCertificatePolicyActionValues() []CertificatePolicyAction { } } -// CurveName - Elliptic curve name. For valid values, see JsonWebKeyCurveName. +// CurveName - Elliptic curve name. type CurveName string const ( diff --git a/sdk/security/keyvault/azcertificates/models.go b/sdk/security/keyvault/azcertificates/models.go index 5f81f291edf9..a3e29e0b2ee3 100644 --- a/sdk/security/keyvault/azcertificates/models.go +++ b/sdk/security/keyvault/azcertificates/models.go @@ -505,7 +505,7 @@ type IssuerPropertiesListResult struct { // KeyProperties - Properties of the key pair backing a certificate. type KeyProperties struct { - // Elliptic curve name. For valid values, see JsonWebKeyCurveName. + // Elliptic curve name. Curve *CurveName `json:"crv,omitempty"` // Indicates if the private key can be exported. Release policy must be provided when creating the first version of an exportable diff --git a/sdk/security/keyvault/azkeys/CHANGELOG.md b/sdk/security/keyvault/azkeys/CHANGELOG.md index 12219294745a..46d0e04823e2 100644 --- a/sdk/security/keyvault/azkeys/CHANGELOG.md +++ b/sdk/security/keyvault/azkeys/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.1 (2023-08-21) +## 1.0.1 (2023-08-22) ### Other Changes * Upgraded dependencies diff --git a/sdk/security/keyvault/azkeys/autorest.md b/sdk/security/keyvault/azkeys/autorest.md index 1d78994d8c5f..e2f6b7eb9e4b 100644 --- a/sdk/security/keyvault/azkeys/autorest.md +++ b/sdk/security/keyvault/azkeys/autorest.md @@ -227,4 +227,18 @@ directive: - from: models.go where: $ transform: return $.replace(/(KID \*)string(\s+.*)/g, "$1ID$2") + + # edit doc comments to not contain DeletedKeyBundle + - from: + - models.go + - response_types.go + where: $ + transform: return $.replace(/DeletedKeyBundle/g, "DeletedKey") + + # remove redundant section of doc comment + - from: + - models.go + - constants.go + where: $ + transform: return $.replace(/(For valid values, (.*)\.)|(For more information .*\.)|(For more information on possible algorithm\n\/\/ types, see JsonWebKeySignatureAlgorithm.)/g, ""); ``` diff --git a/sdk/security/keyvault/azkeys/constants.go b/sdk/security/keyvault/azkeys/constants.go index 1eaab58a6373..3d169e2d1fec 100644 --- a/sdk/security/keyvault/azkeys/constants.go +++ b/sdk/security/keyvault/azkeys/constants.go @@ -8,7 +8,7 @@ package azkeys -// CurveName - Elliptic curve name. For valid values, see JsonWebKeyCurveName. +// CurveName - Elliptic curve name. type CurveName string const ( @@ -102,8 +102,7 @@ func PossibleKeyOperationValues() []KeyOperation { } } -// SignatureAlgorithm - The signing/verification algorithm identifier. For more information on possible algorithm -// types, see JsonWebKeySignatureAlgorithm. +// SignatureAlgorithm - The signing/verification algorithm identifier. type SignatureAlgorithm string const ( diff --git a/sdk/security/keyvault/azkeys/example_test.go b/sdk/security/keyvault/azkeys/example_test.go index 88ff3a44987b..0d39ff094b09 100644 --- a/sdk/security/keyvault/azkeys/example_test.go +++ b/sdk/security/keyvault/azkeys/example_test.go @@ -119,7 +119,7 @@ func ExampleClient_UpdateKey() { // [Client.RotateKey] allows you to rotate a key on demand. See [Azure Key Vault documentation] for more information about key // rotation. // -// [Azure Key Vault documentation]: https://docs.microsoft.com/azure/key-vault/keys/how-to-configure-key-rotation +// [Azure Key Vault documentation]: https://learn.microsoft.com/azure/key-vault/keys/how-to-configure-key-rotation func ExampleClient_UpdateKeyRotationPolicy() { // this policy rotates the key every 18 months policy := azkeys.KeyRotationPolicy{ diff --git a/sdk/security/keyvault/azkeys/models.go b/sdk/security/keyvault/azkeys/models.go index 257f931d825b..b1d72c40cc5a 100644 --- a/sdk/security/keyvault/azkeys/models.go +++ b/sdk/security/keyvault/azkeys/models.go @@ -18,10 +18,10 @@ type BackupKeyResult struct { // CreateKeyParameters - The key create parameters. type CreateKeyParameters struct { - // REQUIRED; The type of key to create. For valid values, see JsonWebKeyType. + // REQUIRED; The type of key to create. Kty *KeyType - // Elliptic curve name. For valid values, see JsonWebKeyCurveName. + // Elliptic curve name. Curve *CurveName // The attributes of a key managed by the key vault service. @@ -41,7 +41,7 @@ type CreateKeyParameters struct { Tags map[string]*string } -// DeletedKey - A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info +// DeletedKey - A DeletedKey consisting of a WebKey plus its Attributes and deletion info type DeletedKey struct { // The key management attributes. Attributes *KeyAttributes @@ -130,7 +130,7 @@ type ImportKeyParameters struct { // JSONWebKey - As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18 type JSONWebKey struct { - // Elliptic curve name. For valid values, see JsonWebKeyCurveName. + // Elliptic curve name. Crv *CurveName // RSA private exponent, or the D component of an EC private key. @@ -390,7 +390,7 @@ type RestoreKeyParameters struct { // SignParameters - The key operations parameters. type SignParameters struct { - // REQUIRED; The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + // REQUIRED; The signing/verification algorithm identifier. Algorithm *SignatureAlgorithm // REQUIRED @@ -402,7 +402,7 @@ type UpdateKeyParameters struct { // The attributes of a key managed by the key vault service. KeyAttributes *KeyAttributes - // Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. + // Json web key operations. KeyOps []*KeyOperation // The policy rules under which the key can be exported. @@ -414,7 +414,7 @@ type UpdateKeyParameters struct { // VerifyParameters - The key verify parameters. type VerifyParameters struct { - // REQUIRED; The signing/verification algorithm. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + // REQUIRED; The signing/verification algorithm. Algorithm *SignatureAlgorithm // REQUIRED; The digest used for signing. diff --git a/sdk/security/keyvault/azkeys/response_types.go b/sdk/security/keyvault/azkeys/response_types.go index 7eb1afbe8163..b1b4678ea651 100644 --- a/sdk/security/keyvault/azkeys/response_types.go +++ b/sdk/security/keyvault/azkeys/response_types.go @@ -28,7 +28,7 @@ type DecryptResponse struct { // DeleteKeyResponse contains the response from method Client.DeleteKey. type DeleteKeyResponse struct { - // A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info + // A DeletedKey consisting of a WebKey plus its Attributes and deletion info DeletedKey } @@ -40,7 +40,7 @@ type EncryptResponse struct { // GetDeletedKeyResponse contains the response from method Client.GetDeletedKey. type GetDeletedKeyResponse struct { - // A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion info + // A DeletedKey consisting of a WebKey plus its Attributes and deletion info DeletedKey } diff --git a/sdk/security/keyvault/azsecrets/CHANGELOG.md b/sdk/security/keyvault/azsecrets/CHANGELOG.md index 8f70961a8844..9a84b306cbfb 100644 --- a/sdk/security/keyvault/azsecrets/CHANGELOG.md +++ b/sdk/security/keyvault/azsecrets/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.1 (2023-08-21) +## 1.0.1 (2023-08-22) ### Other Changes * Upgraded dependencies