Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[keyvault] azkeys renames #20892

Merged
merged 10 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion sdk/security/keyvault/azkeys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Release History

## 1.0.0 (2023-05-11)
## 0.12.0 (unreleased)
gracewilcox marked this conversation as resolved.
Show resolved Hide resolved

### Breaking Changes
gracewilcox marked this conversation as resolved.
Show resolved Hide resolved

* Renamed `GetRandomBytesRequest` to `GetRandomBytesParameters`
* `ListDeletedKey` to `ListDeletedKeyProperties`
* `ListKeys` to `ListKeyProperties`
* `DeletedKeyBundle` to `DeletedKey`
* `KeyBundle` to `KeyVaultKey`
* `RestoreKeyParameters.KeyBundleBackup` to `RestoreKeyParameters.KeyBackup`
* `DeletedKeyItem` to `DeletedKeyProperties`
* `KeyItem` to `KeyProperties`
* `DeletedKeyListResult` to `DeletedKeyPropertiesListResult`
* `KeyListResult` `KeyPropertiesListResult`
* `KeyOperationsParameters` to `KeyOperationParameters`
* Changed `JSONWebKey.KeyOperations` from type []*string to []*KeyOperation
* `ReleaseParameters.Enc` to `ReleaseParameters.Algorithm`
* `KeyOperationParameters.AAD` to `KeyOperationParameters.AdditionalAuthenticatedData`
* `KeyOperationParameters.Tag` to `KeyOperationParameters.AuthenticationTag`
* `JSONWebKeyOperation` to `KeyOperation`
* `JSONWebKeyCurveName` to `KeyCurveName`
* `JSONWebKeyEncryptionAlgorithm` to `EncryptionAlgorithm`
* `JSONWebKeySignatureAlgorithm` to `SignatureAlgorithm`
* `JSONWebKeyType` to `KeyType`
* Removed `DeletionRecoveryLevel` type
* Deleted `SignatureAlgorithmRSNULL` constant
* Removed `MaxResults` option

### Other Changes
* Updated dependencies
Expand Down
148 changes: 121 additions & 27 deletions sdk/security/keyvault/azkeys/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,6 @@ directive:
where: $["x-ms-parameterized-host"]
transform: $.parameters[0]["x-ms-parameter-location"] = "client"

# capitalize acronyms
- from: swagger-document
where: $.definitions.KeyImportParameters.properties.Hsm
transform: $["x-ms-client-name"] = "HSM"
- from: swagger-document
where: $.definitions..properties..iv
transform: $["x-ms-client-name"] = "IV"
- from: swagger-document
where: $.definitions..properties..kid
transform: $["x-ms-client-name"] = "KID"

# Maxresults -> MaxResults
- from: swagger-document
where: $.paths..parameters..[?(@.name=='maxresults')]
transform: $["x-ms-client-name"] = "MaxResults"

# keyName, keyVersion -> name, version
- from: swagger-document
where: $.paths..parameters..[?(@.name=='key-name')]
transform: $["x-ms-client-name"] = "name"
- from: swagger-document
where: $.paths..parameters..[?(@.name=='key-version')]
transform: $["x-ms-client-name"] = "version"

# rename parameter models to match their methods
- rename-model:
from: KeyCreateParameters
Expand All @@ -74,17 +50,135 @@ directive:
- rename-model:
from: KeyVerifyParameters
to: VerifyParameters
- rename-model:
from: GetRandomBytesRequest
to: GetRandomBytesParameters

# rename paged operations from Get* to List*
- rename-operation:
from: GetDeletedKeys
to: ListDeletedKeys
to: ListDeletedKeyProperties
- rename-operation:
from: GetKeys
to: ListKeys
to: ListKeyProperties
- rename-operation:
from: GetKeyVersions
to: ListKeyVersions
to: ListKeyPropertiesVersions

# rename KeyItem and KeyBundle
- rename-model:
from: DeletedKeyBundle
to: DeletedKey
- rename-model:
from: KeyBundle
to: KeyVaultKey
gracewilcox marked this conversation as resolved.
Show resolved Hide resolved
- rename-model:
from: KeyItem
to: KeyProperties
- rename-model:
from: DeletedKeyItem
to: DeletedKeyProperties
- rename-model:
from: DeletedKeyListResult
to: DeletedKeyPropertiesListResult
- rename-model:
from: KeyListResult
to: KeyPropertiesListResult
- from: swagger-document
where: $.definitions.RestoreKeyParameters.properties.value
transform: $["x-ms-client-name"] = "KeyBackup"

# Remove MaxResults parameter
- where: "$.paths..*"
remove-parameter:
in: query
name: maxresults

# KeyOps updates
- rename-model:
from: KeyOperationsParameters
to: KeyOperationParameters
- from: models.go
where: $
transform: return $.replace(/KeyOps \[\]\*string/, "KeyOps []*KeyOperation");

# fix capitalization
- from: swagger-document
where: $.definitions.ImportKeyParameters.properties.Hsm
transform: $["x-ms-client-name"] = "HSM"
- from: swagger-document
where: $.definitions..properties..iv
transform: $["x-ms-client-name"] = "IV"
- from: swagger-document
where: $.definitions..properties..kid
transform: $["x-ms-client-name"] = "KID"

# keyName, keyVersion -> name, version
- from: swagger-document
where: $.paths..parameters..[?(@.name=='key-name')]
transform: $["x-ms-client-name"] = "name"
- from: swagger-document
where: $.paths..parameters..[?(@.name=='key-version')]
transform: $["x-ms-client-name"] = "version"

# KeyEncryptionAlgorithm renames
- from: swagger-document
where: $.definitions.ReleaseParameters.properties.enc
transform: $["x-ms-client-name"] = "algorithm"

# rename KeyOperationsParameters fields
- from: swagger-document
where: $.definitions.KeyOperationParameters.properties.aad
transform: $["x-ms-client-name"] = "AdditionalAuthenticatedData"
- from: swagger-document
where: $.definitions.KeyOperationParameters.properties.tag
transform: $["x-ms-client-name"] = "AuthenticationTag"

# remove JSONWeb Prefix
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyOperation/g, "KeyOperation");
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyCurveName/g, "CurveName");
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyEncryptionAlgorithm/g, "EncryptionAlgorithm");
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeySignatureAlgorithm/g, "SignatureAlgorithm");
- from:
- models.go
- constants.go
where: $
transform: return $.replace(/JSONWebKeyType/g, "KeyType");

# remove DeletionRecoveryLevel type
- from: models.go
where: $
transform: return $.replace(/RecoveryLevel \*DeletionRecoveryLevel/g, "RecoveryLevel *string");
- from: constants.go
where: $
transform: return $.replace(/(?:\/\/.*\s)+type DeletionRecoveryLevel string/, "");
- from: constants.go
where: $
transform: return $.replace(/(?:\/\/.*\s)+func PossibleDeletionRecovery(?:.+\s)+\}/, "");
- from: constants.go
where: $
transform: return $.replace(/const \(\n\s\/\/ DeletionRecoveryLevel(?:.+\s)+\)/, "");

# delete SignatureAlgorithmRSNULL
- from: constants.go
where: $
transform: return $.replace(/.*(\bSignatureAlgorithmRSNULL\b).*/g, "");

# delete unused error models
- from: models.go
Expand Down
Loading