Skip to content

Commit fbffde8

Browse files
feat(iam/v1alpha1): add User.mfa (deprecate two_factor_enabled) + ListUsersRequest.mfa (#3014)
Co-authored-by: Rémy Léone <[email protected]>
1 parent d1c3079 commit fbffde8

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

cmd/scw/testdata/test-all-usage-iam-user-get-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
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.
3+
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.
44

55
USAGE:
66
scw iam user get <user-id ...> [arg=value ...]

cmd/scw/testdata/test-all-usage-iam-user-list-usage.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ USAGE:
88
ARGS:
99
[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)
1010
[user-ids.{index}] Filter by list of IDs
11+
[mfa] Filter by MFA status
1112
organization-id=<retrieved from config> ID of the Organization to filter
1213

1314
FLAGS:

docs/commands/iam.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ scw iam user delete <user-id ...> [arg=value ...]
929929

930930
### Get a given user
931931

932-
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.
932+
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.
933933

934934
**Usage:**
935935

@@ -963,6 +963,7 @@ scw iam user list [arg=value ...]
963963
|------|---|-------------|
964964
| 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 |
965965
| user-ids.{index} | | Filter by list of IDs |
966+
| mfa | | Filter by MFA status |
966967
| organization-id | Required<br />Default: `<retrieved from config>` | ID of the Organization to filter |
967968

968969

internal/namespaces/iam/v1alpha1/iam_cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@ func iamUserList() *core.Command {
443443
Deprecated: false,
444444
Positional: false,
445445
},
446+
{
447+
Name: "mfa",
448+
Short: `Filter by MFA status`,
449+
Required: false,
450+
Deprecated: false,
451+
Positional: false,
452+
},
446453
{
447454
Name: "organization-id",
448455
Short: `ID of the Organization to filter`,
@@ -470,7 +477,7 @@ func iamUserList() *core.Command {
470477
func iamUserGet() *core.Command {
471478
return &core.Command{
472479
Short: `Get a given user`,
473-
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.`,
480+
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.`,
474481
Namespace: "iam",
475482
Resource: "user",
476483
Verb: "get",

0 commit comments

Comments
 (0)