From ae3db6aaccf095ca36ac22d79a4c4f47918f5168 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 10 Nov 2023 09:13:55 +0100 Subject: [PATCH] Remove AllowedIPs from passed parameters Signed-off-by: Ben --- pkg/nb/types.go | 2 +- pkg/sts/sts.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/nb/types.go b/pkg/nb/types.go index ce4a0bdf31..d2e1d967f2 100644 --- a/pkg/nb/types.go +++ b/pkg/nb/types.go @@ -578,7 +578,7 @@ type UpdateAccountParams struct { MustChangePassword *bool `json:"must_change_password,omitempty"` NewEmail *string `json:"new_email,omitempty"` ForceMd5Etag *bool `json:"force_md5_etag,omitempty"` - AllowedIPs []struct { + AllowedIPs *[]struct { Start string `json:"start"` End string `json:"end"` } `json:"ips,omitempty"` diff --git a/pkg/sts/sts.go b/pkg/sts/sts.go index f5696b3240..3fcd4afd4c 100644 --- a/pkg/sts/sts.go +++ b/pkg/sts/sts.go @@ -82,14 +82,11 @@ func RunAssign(cmd *cobra.Command, args []string) { if err != nil { log.Fatalf("❌ Failed to parse role config - %s", err) } - readAccountParams := nb.ReadAccountParams{Email: email} - accountInfo, err := NBClient.ReadAccountAPI(readAccountParams) if err != nil { log.Fatalf(`❌ Failed to read account - %s`, err) } UpdateAccountParams := nb.UpdateAccountParams{ Email: email, - AllowedIPs: accountInfo.AllowedIPs, RoleConfig: roleConfigObject, } @@ -109,12 +106,8 @@ func RunRemove(cmd *cobra.Command, args []string) { } NBClient := sysClient.NBClient - readAccountParams := nb.ReadAccountParams{Email: email} - accountInfo, _ := NBClient.ReadAccountAPI(readAccountParams) - UpdateAccountParams := nb.UpdateAccountParams{ Email: email, - AllowedIPs: accountInfo.AllowedIPs, RemoveRoleConfig: true, }