Skip to content

Commit

Permalink
feat(iam/v1alpha1): add User.mfa (deprecate two_factor_enabled) + Lis…
Browse files Browse the repository at this point in the history
…tUsersRequest.mfa (#3014)

Co-authored-by: Rémy Léone <rleone@scaleway.com>
  • Loading branch information
scaleway-bot and remyleone committed Apr 13, 2023
1 parent d1c3079 commit fbffde8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/scw/testdata/test-all-usage-iam-user-get-usage.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `two_factor_enabled` are returned in the response.
Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `mfa` are returned in the response.

USAGE:
scw iam user get <user-id ...> [arg=value ...]
Expand Down
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 @@ -8,6 +8,7 @@ USAGE:
ARGS:
[order-by=created_at_asc] Criteria for sorting results (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | email_asc | email_desc | last_login_asc | last_login_desc)
[user-ids.{index}] Filter by list of IDs
[mfa] Filter by MFA status
organization-id=<retrieved from config> ID of the Organization to filter

FLAGS:
Expand Down
3 changes: 2 additions & 1 deletion docs/commands/iam.md
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ scw iam user delete <user-id ...> [arg=value ...]

### Get a given user

Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `two_factor_enabled` are returned in the response.
Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `mfa` are returned in the response.

**Usage:**

Expand Down Expand Up @@ -963,6 +963,7 @@ scw iam user list [arg=value ...]
|------|---|-------------|
| order-by | Default: `created_at_asc`<br />One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc`, `email_asc`, `email_desc`, `last_login_asc`, `last_login_desc` | Criteria for sorting results |
| user-ids.{index} | | Filter by list of IDs |
| mfa | | Filter by MFA status |
| organization-id | Required<br />Default: `<retrieved from config>` | ID of the Organization to filter |


Expand Down
9 changes: 8 additions & 1 deletion internal/namespaces/iam/v1alpha1/iam_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,13 @@ func iamUserList() *core.Command {
Deprecated: false,
Positional: false,
},
{
Name: "mfa",
Short: `Filter by MFA status`,
Required: false,
Deprecated: false,
Positional: false,
},
{
Name: "organization-id",
Short: `ID of the Organization to filter`,
Expand Down Expand Up @@ -470,7 +477,7 @@ func iamUserList() *core.Command {
func iamUserGet() *core.Command {
return &core.Command{
Short: `Get a given user`,
Long: `Retrieve information about a user, specified by the ` + "`" + `user_id` + "`" + ` parameter. The user's full details, including ` + "`" + `id` + "`" + `, ` + "`" + `email` + "`" + `, ` + "`" + `organization_id` + "`" + `, ` + "`" + `status` + "`" + ` and ` + "`" + `two_factor_enabled` + "`" + ` are returned in the response.`,
Long: `Retrieve information about a user, specified by the ` + "`" + `user_id` + "`" + ` parameter. The user's full details, including ` + "`" + `id` + "`" + `, ` + "`" + `email` + "`" + `, ` + "`" + `organization_id` + "`" + `, ` + "`" + `status` + "`" + ` and ` + "`" + `mfa` + "`" + ` are returned in the response.`,
Namespace: "iam",
Resource: "user",
Verb: "get",
Expand Down

0 comments on commit fbffde8

Please sign in to comment.