diff --git a/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden index 174cbe67fe..12f8c55e31 100644 --- a/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden +++ b/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden @@ -6,11 +6,16 @@ USAGE: scw secret version create [arg=value ...] ARGS: - secret-id ID of the secret - data Content of the secret version. Base64 is handled by the SDK (Support file loading with @/path/to/file) - [description] Description of the version - [disable-previous] Disable the previous secret version - [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + secret-id ID of the secret + data Content of the secret version. Base64 is handled by the SDK (Support file loading with @/path/to/file) + [description] Description of the version + [disable-previous] Disable the previous secret version + [password-generation.length] Length of the password to generate (between 1 and 1024) + [password-generation.no-lowercase-letters] Do not include lower case letters by default in the alphabet + [password-generation.no-uppercase-letters] Do not include upper case letters by default in the alphabet + [password-generation.no-digits] Do not include digits by default in the alphabet + [password-generation.additional-chars] Additional ascii characters to be included in the alphabet + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) FLAGS: -h, --help help for create diff --git a/docs/commands/secret.md b/docs/commands/secret.md index d09a44d5ef..786023bcaf 100644 --- a/docs/commands/secret.md +++ b/docs/commands/secret.md @@ -201,6 +201,11 @@ scw secret version create [arg=value ...] | data | Required | Content of the secret version. Base64 is handled by the SDK | | description | | Description of the version | | disable-previous | | Disable the previous secret version | +| password-generation.length | | Length of the password to generate (between 1 and 1024) | +| password-generation.no-lowercase-letters | | Do not include lower case letters by default in the alphabet | +| password-generation.no-uppercase-letters | | Do not include upper case letters by default in the alphabet | +| password-generation.no-digits | | Do not include digits by default in the alphabet | +| password-generation.additional-chars | | Additional ascii characters to be included in the alphabet | | region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | diff --git a/go.mod b/go.mod index 4572a8ddda..63f05a777f 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( github.com/moby/buildkit v0.11.5 github.com/opencontainers/go-digest v1.0.0 github.com/pkg/errors v0.9.1 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329081537-bf8509de0894 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329091040-cc563855c7c2 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index d804fb9a5c..f217efc49a 100644 --- a/go.sum +++ b/go.sum @@ -275,8 +275,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329081537-bf8509de0894 h1:a/hpDFkms0rA96XT35q3k8u3Vnue+BLhgolcLcBF4Rc= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329081537-bf8509de0894/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329091040-cc563855c7c2 h1:XNAks4A2vVw6fDGuA0EwZUgBVzF1VQrQiVjUdFOj90E= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230329091040-cc563855c7c2/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= diff --git a/internal/namespaces/secret/v1alpha1/secret_cli.go b/internal/namespaces/secret/v1alpha1/secret_cli.go index ba8a19d634..1443c3a064 100644 --- a/internal/namespaces/secret/v1alpha1/secret_cli.go +++ b/internal/namespaces/secret/v1alpha1/secret_cli.go @@ -344,6 +344,41 @@ func secretVersionCreate() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "password-generation.length", + Short: `Length of the password to generate (between 1 and 1024)`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "password-generation.no-lowercase-letters", + Short: `Do not include lower case letters by default in the alphabet`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "password-generation.no-uppercase-letters", + Short: `Do not include upper case letters by default in the alphabet`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "password-generation.no-digits", + Short: `Do not include digits by default in the alphabet`, + Required: false, + Deprecated: false, + Positional: false, + }, + { + Name: "password-generation.additional-chars", + Short: `Additional ascii characters to be included in the alphabet`, + Required: false, + Deprecated: false, + Positional: false, + }, core.RegionArgSpec(scw.RegionFrPar), }, Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {