From 4b6eb2b5600f25ddcf34a924683b75b1d3687466 Mon Sep 17 00:00:00 2001 From: Piet van der Meulen Date: Fri, 17 Oct 2025 12:29:03 +0200 Subject: [PATCH 1/2] mongodb-flex: add stackitAdmin role --- docs/stackit_mongodbflex_user_create.md | 2 +- docs/stackit_mongodbflex_user_update.md | 2 +- internal/cmd/mongodbflex/user/create/create.go | 2 +- internal/cmd/mongodbflex/user/update/update.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/stackit_mongodbflex_user_create.md b/docs/stackit_mongodbflex_user_create.md index 99075fee8..2fb49a7ec 100644 --- a/docs/stackit_mongodbflex_user_create.md +++ b/docs/stackit_mongodbflex_user_create.md @@ -29,7 +29,7 @@ stackit mongodbflex user create [flags] --database string The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it -h, --help Help for "stackit mongodbflex user create" --instance-id string ID of the instance - --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase"] (default [read]) + --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase" "stackitAdmin"] (default [read]) --username string Username of the user. If not specified, a random username will be assigned ``` diff --git a/docs/stackit_mongodbflex_user_update.md b/docs/stackit_mongodbflex_user_update.md index 31a674972..a819b8739 100644 --- a/docs/stackit_mongodbflex_user_update.md +++ b/docs/stackit_mongodbflex_user_update.md @@ -23,7 +23,7 @@ stackit mongodbflex user update USER_ID [flags] --database string The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it -h, --help Help for "stackit mongodbflex user update" --instance-id string ID of the instance - --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase"] (default []) + --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase" "stackitAdmin"] (default []) ``` ### Options inherited from parent commands diff --git a/internal/cmd/mongodbflex/user/create/create.go b/internal/cmd/mongodbflex/user/create/create.go index e1e7a00cf..4b0b969ab 100644 --- a/internal/cmd/mongodbflex/user/create/create.go +++ b/internal/cmd/mongodbflex/user/create/create.go @@ -103,7 +103,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command { } func configureFlags(cmd *cobra.Command) { - roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase"} + roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase", "stackitAdmin"} cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "ID of the instance") cmd.Flags().String(usernameFlag, "", "Username of the user. If not specified, a random username will be assigned") diff --git a/internal/cmd/mongodbflex/user/update/update.go b/internal/cmd/mongodbflex/user/update/update.go index df408025e..88495fa96 100644 --- a/internal/cmd/mongodbflex/user/update/update.go +++ b/internal/cmd/mongodbflex/user/update/update.go @@ -97,7 +97,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command { } func configureFlags(cmd *cobra.Command) { - roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase"} + roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase", "stackitAdmin"} cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "ID of the instance") cmd.Flags().String(databaseFlag, "", "The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it") From 75b745ad6d057e8f72743bbe00741c8400372ce1 Mon Sep 17 00:00:00 2001 From: Piet van der Meulen Date: Wed, 22 Oct 2025 16:05:56 +0200 Subject: [PATCH 2/2] add readAnyDatabase role --- docs/stackit_mongodbflex_user_create.md | 2 +- docs/stackit_mongodbflex_user_update.md | 2 +- internal/cmd/mongodbflex/user/create/create.go | 2 +- internal/cmd/mongodbflex/user/update/update.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/stackit_mongodbflex_user_create.md b/docs/stackit_mongodbflex_user_create.md index 2fb49a7ec..4495f9131 100644 --- a/docs/stackit_mongodbflex_user_create.md +++ b/docs/stackit_mongodbflex_user_create.md @@ -29,7 +29,7 @@ stackit mongodbflex user create [flags] --database string The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it -h, --help Help for "stackit mongodbflex user create" --instance-id string ID of the instance - --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase" "stackitAdmin"] (default [read]) + --role strings Roles of the user, possible values are ["read" "readWrite" "readAnyDatabase" "readWriteAnyDatabase" "stackitAdmin"] (default [read]) --username string Username of the user. If not specified, a random username will be assigned ``` diff --git a/docs/stackit_mongodbflex_user_update.md b/docs/stackit_mongodbflex_user_update.md index a819b8739..c1d311895 100644 --- a/docs/stackit_mongodbflex_user_update.md +++ b/docs/stackit_mongodbflex_user_update.md @@ -23,7 +23,7 @@ stackit mongodbflex user update USER_ID [flags] --database string The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it -h, --help Help for "stackit mongodbflex user update" --instance-id string ID of the instance - --role strings Roles of the user, possible values are ["read" "readWrite" "readWriteAnyDatabase" "stackitAdmin"] (default []) + --role strings Roles of the user, possible values are ["read" "readWrite" "readAnyDatabase" "readWriteAnyDatabase" "stackitAdmin"] (default []) ``` ### Options inherited from parent commands diff --git a/internal/cmd/mongodbflex/user/create/create.go b/internal/cmd/mongodbflex/user/create/create.go index 4b0b969ab..f82cecd18 100644 --- a/internal/cmd/mongodbflex/user/create/create.go +++ b/internal/cmd/mongodbflex/user/create/create.go @@ -103,7 +103,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command { } func configureFlags(cmd *cobra.Command) { - roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase", "stackitAdmin"} + roleOptions := []string{"read", "readWrite", "readAnyDatabase", "readWriteAnyDatabase", "stackitAdmin"} cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "ID of the instance") cmd.Flags().String(usernameFlag, "", "Username of the user. If not specified, a random username will be assigned") diff --git a/internal/cmd/mongodbflex/user/update/update.go b/internal/cmd/mongodbflex/user/update/update.go index 88495fa96..587b78b52 100644 --- a/internal/cmd/mongodbflex/user/update/update.go +++ b/internal/cmd/mongodbflex/user/update/update.go @@ -97,7 +97,7 @@ func NewCmd(params *params.CmdParams) *cobra.Command { } func configureFlags(cmd *cobra.Command) { - roleOptions := []string{"read", "readWrite", "readWriteAnyDatabase", "stackitAdmin"} + roleOptions := []string{"read", "readWrite", "readAnyDatabase", "readWriteAnyDatabase", "stackitAdmin"} cmd.Flags().Var(flags.UUIDFlag(), instanceIdFlag, "ID of the instance") cmd.Flags().String(databaseFlag, "", "The database inside the MongoDB instance that the user has access to. If it does not exist, it will be created once the user writes to it")