Skip to content

Commit 2f6e1d2

Browse files
authored
feat(secret): add option to generate passwords (#1619)
1 parent cc56385 commit 2f6e1d2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

api/secret/v1alpha1/secret_sdk.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,20 @@ type ListSecretsResponse struct {
174174
Secrets []*Secret `json:"secrets"`
175175
}
176176

177+
// PasswordGenerationParams: password generation params.
178+
type PasswordGenerationParams struct {
179+
// Length: length of the password to generate (between 1 and 1024).
180+
Length uint32 `json:"length"`
181+
// NoLowercaseLetters: do not include lower case letters by default in the alphabet.
182+
NoLowercaseLetters bool `json:"no_lowercase_letters"`
183+
// NoUppercaseLetters: do not include upper case letters by default in the alphabet.
184+
NoUppercaseLetters bool `json:"no_uppercase_letters"`
185+
// NoDigits: do not include digits by default in the alphabet.
186+
NoDigits bool `json:"no_digits"`
187+
// AdditionalChars: additional ascii characters to be included in the alphabet.
188+
AdditionalChars string `json:"additional_chars"`
189+
}
190+
177191
// Secret: secret.
178192
type Secret struct {
179193
// ID: ID of the secret.
@@ -525,6 +539,12 @@ type CreateSecretVersionRequest struct {
525539
// DisablePrevious: disable the previous secret version.
526540
// If there is no previous version or if the previous version was already disabled, does nothing.
527541
DisablePrevious bool `json:"disable_previous"`
542+
// PasswordGeneration: options to generate a password.
543+
// If specified, a random password will be generated. The data field must be empty.
544+
// By default, the generator will use upper and lower case letters, and digits.
545+
// This behavior can be tuned using the generation params.
546+
// Precisely one of PasswordGeneration must be set.
547+
PasswordGeneration *PasswordGenerationParams `json:"password_generation,omitempty"`
528548
}
529549

530550
// CreateSecretVersion: create a version.

0 commit comments

Comments
 (0)