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

feat(secret_manager): add protection in secret creation #3598

Merged
merged 2 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ARGS:
[ephemeral-policy.time-to-live] Time frame, from one second and up to one year, during which the secret's versions are valid.
[ephemeral-policy.expires-once-accessed] Returns `true` if the version expires after a single user access.
[ephemeral-policy.action] Action to perform when the version of a secret expires (unknown_action | delete | disable)
[is-protected] Returns `true` if secret protection is enabled on a given secret
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
Expand Down
1 change: 1 addition & 0 deletions docs/commands/secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ scw secret secret create [arg=value ...]
| ephemeral-policy.time-to-live | | Time frame, from one second and up to one year, during which the secret's versions are valid. |
| ephemeral-policy.expires-once-accessed | | Returns `true` if the version expires after a single user access. |
| ephemeral-policy.action | One of: `unknown_action`, `delete`, `disable` | Action to perform when the version of a secret expires |
| is-protected | | Returns `true` if secret protection is enabled on a given secret |
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/moby/buildkit v0.11.6
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.22.0.20240111161048-8f295b8b2174
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240118144829-99a99cc1d1cc
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240111161048-8f295b8b2174 h1:viVjWA5i89l+U6McCfmdL2uWUfNWpBp27asSvMm24dY=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240111161048-8f295b8b2174/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240118144829-99a99cc1d1cc h1:S48ne/5dP5m97unqIBNT0G4/R/9qe0gPzi5FQ9SSiy8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.22.0.20240118144829-99a99cc1d1cc/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
7 changes: 7 additions & 0 deletions internal/namespaces/secret/v1alpha1/secret_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ func secretSecretCreate() *core.Command {
Positional: false,
EnumValues: []string{"unknown_action", "delete", "disable"},
},
{
Name: "is-protected",
Short: `Returns ` + "`" + `true` + "`" + ` if secret protection is enabled on a given secret`,
Required: false,
Deprecated: false,
Positional: false,
},
core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
Expand Down
Loading