Skip to content

Commit ae0efe3

Browse files
author
Jan Sternagel
committed
Removed default flag value
1 parent 8880348 commit ae0efe3

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

docs/stackit_beta_kms_key_create.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ stackit beta kms key create [flags]
2323
### Options
2424

2525
```
26-
--algorithm string En-/Decryption / signing algorithm. Possible values: ["aes_256_gcm" "rsa_2048_oaep_sha256" "rsa_3072_oaep_sha256" "rsa_4096_oaep_sha256" "rsa_4096_oaep_sha512" "hmac_sha256" "hmac_sha384" "hmac_sha512" "ecdsa_p256_sha256" "ecdsa_p384_sha384" "ecdsa_p521_sha512"] (default "rsa_2048_oaep_sha256")
26+
--algorithm string En-/Decryption / signing algorithm. Possible values: ["aes_256_gcm" "rsa_2048_oaep_sha256" "rsa_3072_oaep_sha256" "rsa_4096_oaep_sha256" "rsa_4096_oaep_sha512" "hmac_sha256" "hmac_sha384" "hmac_sha512" "ecdsa_p256_sha256" "ecdsa_p384_sha384" "ecdsa_p521_sha512"]
2727
--description string Optional description of the key
2828
-h, --help Help for "stackit beta kms key create"
2929
--import-only States whether versions can be created or only imported
3030
--keyring-id string ID of the KMS key ring
3131
--name string The display name to distinguish multiple keys
32-
--protection string The underlying system that is responsible for protecting the key material. Possible values: ["symmetric_encrypt_decrypt" "asymmetric_encrypt_decrypt" "message_authentication_code" "asymmetric_sign_verify"] (default "software")
33-
--purpose string Purpose of the key. Possible values: ["symmetric_encrypt_decrypt" "asymmetric_encrypt_decrypt" "message_authentication_code" "asymmetric_sign_verify"] (default "asymmetric_encrypt_decrypt")
32+
--protection string The underlying system that is responsible for protecting the key material. Possible values: ["symmetric_encrypt_decrypt" "asymmetric_encrypt_decrypt" "message_authentication_code" "asymmetric_sign_verify"]
33+
--purpose string Purpose of the key. Possible values: ["symmetric_encrypt_decrypt" "asymmetric_encrypt_decrypt" "message_authentication_code" "asymmetric_sign_verify"]
3434
```
3535

3636
### Options inherited from parent commands

docs/stackit_beta_kms_wrapping-key_create.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ stackit beta kms wrapping-key create [flags]
2323
### Options
2424

2525
```
26-
--algorithm string En-/Decryption / signing algorithm. Possible values: ["rsa_2048_oaep_sha256" "rsa_3072_oaep_sha256" "rsa_4096_oaep_sha256" "rsa_4096_oaep_sha512" "rsa_2048_oaep_sha256_aes_256_key_wrap" "rsa_3072_oaep_sha256_aes_256_key_wrap" "rsa_4096_oaep_sha256_aes_256_key_wrap" "rsa_4096_oaep_sha512_aes_256_key_wrap"] (default "rsa_2048_oaep_sha256")
26+
--algorithm string En-/Decryption / signing algorithm. Possible values: ["rsa_2048_oaep_sha256" "rsa_3072_oaep_sha256" "rsa_4096_oaep_sha256" "rsa_4096_oaep_sha512" "rsa_2048_oaep_sha256_aes_256_key_wrap" "rsa_3072_oaep_sha256_aes_256_key_wrap" "rsa_4096_oaep_sha256_aes_256_key_wrap" "rsa_4096_oaep_sha512_aes_256_key_wrap"]
2727
--description string Optional description of the wrapping key
2828
-h, --help Help for "stackit beta kms wrapping-key create"
2929
--keyring-id string ID of the KMS key ring
3030
--name string The display name to distinguish multiple wrapping keys
31-
--protection string The underlying system that is responsible for protecting the wrapping key material. Possible values: ["wrap_symmetric_key" "wrap_asymmetric_key"] (default "software")
32-
--purpose string Purpose of the wrapping key. Possible values: ["wrap_symmetric_key" "wrap_asymmetric_key"] (default "wrap_asymmetric_key")
31+
--protection string The underlying system that is responsible for protecting the wrapping key material. Possible values: ["wrap_symmetric_key" "wrap_asymmetric_key"]
32+
--purpose string Purpose of the wrapping key. Possible values: ["wrap_symmetric_key" "wrap_asymmetric_key"]
3333
```
3434

3535
### Options inherited from parent commands

internal/cmd/beta/kms/key/create/create.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ const (
3131
importOnlyFlag = "import-only"
3232
purposeFlag = "purpose"
3333
protectionFlag = "protection"
34-
35-
defaultAlgorithm = kms.ALGORITHM_RSA_2048_OAEP_SHA256
36-
defaultPurpose = kms.PURPOSE_ASYMMETRIC_ENCRYPT_DECRYPT
37-
defaultProtection = kms.PROTECTION_SOFTWARE
3834
)
3935

4036
type inputModel struct {
@@ -183,21 +179,21 @@ func configureFlags(cmd *cobra.Command) {
183179
for _, val := range kms.AllowedAlgorithmEnumValues {
184180
algorithmFlagOptions = append(algorithmFlagOptions, string(val))
185181
}
186-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultAlgorithm), algorithmFlagOptions...), algorithmFlag, fmt.Sprintf("En-/Decryption / signing algorithm. Possible values: %q", algorithmFlagOptions))
182+
cmd.Flags().Var(flags.EnumFlag(false, "", algorithmFlagOptions...), algorithmFlag, fmt.Sprintf("En-/Decryption / signing algorithm. Possible values: %q", algorithmFlagOptions))
187183

188184
// Purpose
189185
var purposeFlagOptions []string
190186
for _, val := range kms.AllowedPurposeEnumValues {
191187
purposeFlagOptions = append(purposeFlagOptions, string(val))
192188
}
193-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultPurpose), purposeFlagOptions...), purposeFlag, fmt.Sprintf("Purpose of the key. Possible values: %q", purposeFlagOptions))
189+
cmd.Flags().Var(flags.EnumFlag(false, "", purposeFlagOptions...), purposeFlag, fmt.Sprintf("Purpose of the key. Possible values: %q", purposeFlagOptions))
194190

195191
// Protection
196192
var protectionFlagOptions []string
197193
for _, val := range kms.AllowedProtectionEnumValues {
198194
protectionFlagOptions = append(protectionFlagOptions, string(val))
199195
}
200-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultProtection), protectionFlagOptions...), protectionFlag, fmt.Sprintf("The underlying system that is responsible for protecting the key material. Possible values: %q", purposeFlagOptions))
196+
cmd.Flags().Var(flags.EnumFlag(false, "", protectionFlagOptions...), protectionFlag, fmt.Sprintf("The underlying system that is responsible for protecting the key material. Possible values: %q", purposeFlagOptions))
201197

202198
// All further non Enum Flags
203199
cmd.Flags().Var(flags.UUIDFlag(), keyRingIdFlag, "ID of the KMS key ring")

internal/cmd/beta/kms/wrappingkey/create/create.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ const (
3030
displayNameFlag = "name"
3131
purposeFlag = "purpose"
3232
protectionFlag = "protection"
33-
34-
defaultWrappingAlgorithm = kms.WRAPPINGALGORITHM__2048_OAEP_SHA256
35-
defaultWrappingPurpose = kms.WRAPPINGPURPOSE_ASYMMETRIC_KEY
36-
defaultProtection = kms.PROTECTION_SOFTWARE
3733
)
3834

3935
type inputModel struct {
@@ -181,22 +177,22 @@ func configureFlags(cmd *cobra.Command) {
181177
for _, val := range kms.AllowedWrappingAlgorithmEnumValues {
182178
algorithmFlagOptions = append(algorithmFlagOptions, string(val))
183179
}
184-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultWrappingAlgorithm), algorithmFlagOptions...), algorithmFlag, fmt.Sprintf("En-/Decryption / signing algorithm. Possible values: %q", algorithmFlagOptions))
180+
cmd.Flags().Var(flags.EnumFlag(false, "", algorithmFlagOptions...), algorithmFlag, fmt.Sprintf("En-/Decryption / signing algorithm. Possible values: %q", algorithmFlagOptions))
185181

186182
// Purpose
187183
var purposeFlagOptions []string
188184
for _, val := range kms.AllowedWrappingPurposeEnumValues {
189185
purposeFlagOptions = append(purposeFlagOptions, string(val))
190186
}
191-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultWrappingPurpose), purposeFlagOptions...), purposeFlag, fmt.Sprintf("Purpose of the wrapping key. Possible values: %q", purposeFlagOptions))
187+
cmd.Flags().Var(flags.EnumFlag(false, "", purposeFlagOptions...), purposeFlag, fmt.Sprintf("Purpose of the wrapping key. Possible values: %q", purposeFlagOptions))
192188

193189
// Protection
194190
// backend was deprectaed in /v1beta, but protection is a required attribute with value "software"
195191
var protectionFlagOptions []string
196192
for _, val := range kms.AllowedProtectionEnumValues {
197193
protectionFlagOptions = append(protectionFlagOptions, string(val))
198194
}
199-
cmd.Flags().Var(flags.EnumFlag(false, string(defaultProtection), protectionFlagOptions...), protectionFlag, fmt.Sprintf("The underlying system that is responsible for protecting the wrapping key material. Possible values: %q", purposeFlagOptions))
195+
cmd.Flags().Var(flags.EnumFlag(false, "", protectionFlagOptions...), protectionFlag, fmt.Sprintf("The underlying system that is responsible for protecting the wrapping key material. Possible values: %q", purposeFlagOptions))
200196

201197
// All further non Enum Flags
202198
cmd.Flags().Var(flags.UUIDFlag(), keyRingIdFlag, "ID of the KMS key ring")

0 commit comments

Comments
 (0)