Skip to content

Commit

Permalink
feat(iam): add status filter to ListUsersRequest (scaleway#4580)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Mar 10, 2025
1 parent 6977d6d commit ffa9dcd
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-all-usage-iam-user-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ARGS:
[user-ids.{index}] Filter by list of IDs
[mfa] Filter by MFA status
[tag] Filter by tags containing a given string
[status] Filter by user status (unknown_status | invitation_pending | activated)
organization-id=<retrieved from config> ID of the Organization to filter

FLAGS:
Expand Down
1 change: 1 addition & 0 deletions docs/commands/iam.md
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ scw iam user list [arg=value ...]
| user-ids.{index} | | Filter by list of IDs |
| mfa | | Filter by MFA status |
| tag | | Filter by tags containing a given string |
| status | One of: `unknown_status`, `invitation_pending`, `activated` | Filter by user status |
| organization-id | Required<br />Default: `<retrieved from config>` | ID of the Organization to filter |


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250306171953-f667e6a0c6f7
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250310093050-33520b56cca0
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.9.1
github.com/spf13/pflag v1.0.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
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.32.0.20250306171953-f667e6a0c6f7 h1:WI5d9aUU+9z+BYEwiXpybM+k7pmlLPtHekNargXAa2g=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250306171953-f667e6a0c6f7/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250310093050-33520b56cca0 h1:69KnOM1AP0kjGOS8J8H3cuR8CTbbl7lKMjPzMOp3tvw=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.32.0.20250310093050-33520b56cca0/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
8 changes: 8 additions & 0 deletions internal/namespaces/iam/v1alpha1/iam_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,14 @@ func iamUserList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "status",
Short: `Filter by user status`,
Required: false,
Deprecated: false,
Positional: false,
EnumValues: []string{"unknown_status", "invitation_pending", "activated"},
},
{
Name: "organization-id",
Short: `ID of the Organization to filter`,
Expand Down

0 comments on commit ffa9dcd

Please sign in to comment.