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 4 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
27 changes: 26 additions & 1 deletion sdk/security/keyvault/azkeys/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# Release History

## 1.0.0 (2023-05-11)
## 1.0.0 (unreleased)

### 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`
* `KeyOps` field to `KeyOperations`
gracewilcox marked this conversation as resolved.
Show resolved Hide resolved
* Changed `JSONWebKey.KeyOperations` from type []*string to []*KeyOperation
* `KeyEncryptionAlgorithm` to `KeyExportEncryptionAlgorithm`
* `ReleaseParameters.Enc` to `ReleaseParameters.Algorithm`
* `KeyOperationParameters.AAD` to `KeyOperationParameters.AdditionalAuthenticationData`
gracewilcox marked this conversation as resolved.
Show resolved Hide resolved
* `KeyOperationParameters.Tag` to `KeyOperationParameters.AuthenticationTag`
* `JSONWebKeyOperation` to `KeyOperation`
* `JSONWebKeyCurveName` to `KeyCurveName`
* `JSONWebKeyEncryptionAlgorithm` to `EncryptionAlgorithm`
* `JSONWebKeySignatureAlgorithm` to `SignatureAlgorithm`
* `JSONWebKeyType` to `KeyType`
* Removed `DeletionRecoveryLevel` type

### Other Changes
* Updated dependencies
Expand Down
154 changes: 127 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,141 @@ 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

# add in KeyRotation prefix
- rename-model:
from: LifetimeActions
to: KeyRotationLifetimeActions
- rename-model:
from: LifetimeActionsTrigger
to: KeyRotationLifetimeActionsTrigger
- rename-model:
from: LifetimeActionsType
to: KeyRotationLifetimeActionsType

# rename KeyItem and KeyBundle
- rename-model:
from: DeletedKeyBundle
to: DeletedKey
- rename-model:
from: KeyBundle
to: Key
- 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"

# Rename KeyOps to KeyOperations and update type
- rename-model:
from: KeyOperationsParameters
to: KeyOperationParameters
- from: swagger-document
where: $.definitions..properties.key_ops
transform: $["x-ms-client-name"] = "KeyOperations"
- from: models.go
where: $
transform: return $.replace(/KeyOperations \[\]\*string/, "KeyOperations []*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"
- 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"

# 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 unused error models
- from: models.go
Expand Down
Loading