Skip to content

Commit ec37d67

Browse files
authored
[keyvault] update azcertificates to api version 7.4 (Azure#20459)
* update autorest version * update to 7.4 * changelog
1 parent 9c9d593 commit ec37d67

File tree

13 files changed

+265
-235
lines changed

13 files changed

+265
-235
lines changed

sdk/security/keyvault/azcertificates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
138138
[keyvault_docs]: https://docs.microsoft.com/azure/key-vault/
139139
[client_docs]: https://aka.ms/azsdk/go/azcertificates
140140
[reference_docs]: https://aka.ms/azsdk/go/keyvault-certificates/docs
141-
[certificates_client_src]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/keyvault/azcertificates
141+
[certificates_client_src]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/security/keyvault/azcertificates
142142
[certificates_samples]: https://aka.ms/azsdk/go/keyvault-certificates/docs#pkg-examples
143143
[managed_identity]: https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview
144144

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Troubleshoot Azure Key Vault Certificates Client Module Issues
22

3-
See our [Azure Key Vault SDK Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/keyvault/TROUBLESHOOTING.md)
3+
See our [Azure Key Vault SDK Troubleshooting Guide](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/security/keyvault/TROUBLESHOOTING.md)
44
to troubleshoot issues common to Azure Key Vault client modules.

sdk/security/keyvault/azcertificates/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "go",
44
"TagPrefix": "go/security/keyvault/azcertificates",
5-
"Tag": "go/security/keyvault/azcertificates_6aa6f3e9cd"
5+
"Tag": "go/security/keyvault/azcertificates_0abf787d93"
66
}

sdk/security/keyvault/azcertificates/autorest.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
clear-output-folder: false
55
export-clients: true
66
go: true
7-
input-file: https://github.com/Azure/azure-rest-api-specs/blob/37cd8dfac3c570a24bb645b31c012d12efb760df/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.3/certificates.json
7+
input-file: https://github.com/Azure/azure-rest-api-specs/blob/551275acb80e1f8b39036b79dfc35a8f63b601a7/specification/keyvault/data-plane/Microsoft.KeyVault/stable/7.4/certificates.json
88
license-header: MICROSOFT_MIT_NO_VERSION
99
module: github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates
1010
openapi-type: "data-plane"
1111
output-folder: ../azcertificates
1212
override-client-name: Client
1313
security: "AADToken"
1414
security-scopes: "https://vault.azure.net/.default"
15-
use: "@autorest/[email protected].43"
15+
use: "@autorest/[email protected].46"
1616
version: "^3.0.0"
1717

1818
directive:
@@ -99,11 +99,6 @@ directive:
9999
where: $
100100
transform: return $.replace(/(?:\/\/.*\s)+func \(a \*?Attributes\).*\{\s(?:.+\s)+\}\s/g, "");
101101

102-
# delete generated constructor
103-
- from: client.go
104-
where: $
105-
transform: return $.replace(/(?:\/\/.*\s)+func NewClient.+\{\s(?:.+\s)+\}\s/, "");
106-
107102
# delete the version path param check (version == "" is legal for Key Vault but indescribable by OpenAPI)
108103
- from: client.go
109104
where: $
@@ -127,4 +122,9 @@ directive:
127122
- from: client.go
128123
- where: $
129124
- transform: return $.replace(/certificate((?:Name|Policy|Version)) string/g, (match) => { return match[0].toLowerCase() + match.substr(1); })
125+
126+
# add doc comment
127+
- from: swagger-document
128+
where: $.definitions.X509CertificateProperties.properties.key_usage.items
129+
transform: $["description"] = "Defines how the certificate's key may be used."
130130
```

sdk/security/keyvault/azcertificates/client.go

Lines changed: 188 additions & 158 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/security/keyvault/azcertificates/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ func TestUpdateCertificatePolicy(t *testing.T) {
621621
LifetimeActions: []*azcertificates.LifetimeAction{
622622
{
623623
Action: &azcertificates.Action{
624-
ActionType: to.Ptr(azcertificates.ActionTypeEmailContacts),
624+
ActionType: to.Ptr(azcertificates.CertificatePolicyActionEmailContacts),
625625
},
626626
Trigger: &azcertificates.Trigger{
627627
LifetimePercentage: to.Ptr(int32(98)),

sdk/security/keyvault/azcertificates/constants.go

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/security/keyvault/azcertificates/custom_client.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ func NewClient(vaultURL string, credential azcore.TokenCredential, options *Clie
3737
DisableChallengeResourceVerification: options.DisableChallengeResourceVerification,
3838
},
3939
)
40-
pl := runtime.NewPipeline(moduleName, version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
41-
return &Client{endpoint: vaultURL, pl: pl}, nil
40+
azcoreClient, err := azcore.NewClient("azcertificates.Client", version, runtime.PipelineOptions{PerRetry: []policy.Policy{authPolicy}}, &options.ClientOptions)
41+
if err != nil {
42+
return nil, err
43+
}
44+
return &Client{endpoint: vaultURL, internal: azcoreClient}, nil
4245
}
4346

4447
// ID is a certificate's unique ID, containing its name and version.

sdk/security/keyvault/azcertificates/models.go

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)