Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gracewilcox committed Nov 8, 2024
1 parent 05dc35c commit 4432ff0
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 871 deletions.
8 changes: 4 additions & 4 deletions sdk/security/keyvault/azsecrets/assets.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/security/keyvault/azsecrets",
"Tag": "go/security/keyvault/azsecrets_f05a21134a"
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "go",
"TagPrefix": "go/security/keyvault/azsecrets",
"Tag": "go/security/keyvault/azsecrets_f05a21134a"
}
4 changes: 2 additions & 2 deletions sdk/security/keyvault/azsecrets/build.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//go:build go1.18
// +build go1.18

//go:generate tsp-client sync --local-spec-repo ./keyvault
//go:generate tsp-client sync --local-spec-repo /home/grace/code/azure-rest-api-specs/specification/keyvault/Security.KeyVault.Secrets
//go:generate tsp-client generate
//go:generate go run ./testdata/transforms.go
//go:generate go run ./internal/transforms.go
//go:generate rm ./constants.go
//go:generate gofmt -w .

Expand Down
2 changes: 1 addition & 1 deletion sdk/security/keyvault/azsecrets/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ extends:
ServiceDirectory: 'security/keyvault/azsecrets'
RunLiveTests: true
UsePipelineProxy: false
SupportedClouds: 'Public,UsGov,China'
SupportedClouds: 'Public,UsGov,China'
33 changes: 22 additions & 11 deletions sdk/security/keyvault/azsecrets/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdk/security/keyvault/azsecrets/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func TestListDeletedSecrets(t *testing.T) {
require.NoError(t, err)
testSerde(t, &page.DeletedSecretPropertiesListResult)
for _, secret := range page.Value {
testSerde(t, &secret)
testSerde(t, secret)
delete(expected, secret.ID.Name())
if len(expected) == 0 {
break
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestListSecrets(t *testing.T) {
require.NoError(t, err)
testSerde(t, &page.SecretPropertiesListResult)
for _, secret := range page.Value {
testSerde(t, &secret)
testSerde(t, secret)
if strings.HasPrefix(secret.ID.Name(), "listsecrets") {
count--
}
Expand Down Expand Up @@ -311,7 +311,7 @@ func TestListSecretVersions(t *testing.T) {
require.NoError(t, err)
testSerde(t, &page.SecretPropertiesListResult)
for i, secret := range page.Value {
testSerde(t, &secret)
testSerde(t, secret)
if i > 0 {
require.NotEqual(t, page.Value[i-1].ID.Version(), secret.ID.Version())
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/security/keyvault/azsecrets/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ go 1.18

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
Expand Down
7 changes: 5 additions & 2 deletions sdk/security/keyvault/azsecrets/internal/transforms.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"io/ioutil"
"log"
"os"
"regexp"
Expand All @@ -14,7 +13,7 @@ func regexReplace(fileName string, regex string, replace string) {
panic(err)
}

file, err := ioutil.ReadFile(fileName)
file, err := os.ReadFile(fileName)
if err != nil {
panic(err)
}
Expand All @@ -37,4 +36,8 @@ func main() {

// remove the DeletionRecoveryLevel type
regexReplace("models.go", "DeletionRecoveryLevel", "string")

// remove Max Results parameter
regexReplace("options.go", `(?:\/\/.*\s)+\sMaxresults \*int32`, `// placeholder for future optional parameters`)
regexReplace("client.go", `\sif options != nil && options.Maxresults != nil \{\s+.+\)\s+\}\s`, "")
}
28 changes: 0 additions & 28 deletions sdk/security/keyvault/azsecrets/keyvault/client.tsp

This file was deleted.

53 changes: 0 additions & 53 deletions sdk/security/keyvault/azsecrets/keyvault/main.tsp

This file was deleted.

Loading

0 comments on commit 4432ff0

Please sign in to comment.