Skip to content

Commit b152b26

Browse files
committed
Remove AllowedIPs from passed parameters
Signed-off-by: Ben <[email protected]>
1 parent 11f2b82 commit b152b26

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

pkg/nb/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ type UpdateAccountParams struct {
578578
MustChangePassword *bool `json:"must_change_password,omitempty"`
579579
NewEmail *string `json:"new_email,omitempty"`
580580
ForceMd5Etag *bool `json:"force_md5_etag,omitempty"`
581-
AllowedIPs []struct {
581+
AllowedIPs *[]struct {
582582
Start string `json:"start"`
583583
End string `json:"end"`
584584
} `json:"ips,omitempty"`

pkg/sts/sts.go

-7
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,11 @@ func RunAssign(cmd *cobra.Command, args []string) {
8282
if err != nil {
8383
log.Fatalf("❌ Failed to parse role config - %s", err)
8484
}
85-
readAccountParams := nb.ReadAccountParams{Email: email}
86-
accountInfo, err := NBClient.ReadAccountAPI(readAccountParams)
8785
if err != nil {
8886
log.Fatalf(`❌ Failed to read account - %s`, err)
8987
}
9088
UpdateAccountParams := nb.UpdateAccountParams{
9189
Email: email,
92-
AllowedIPs: accountInfo.AllowedIPs,
9390
RoleConfig: roleConfigObject,
9491
}
9592

@@ -109,12 +106,8 @@ func RunRemove(cmd *cobra.Command, args []string) {
109106
}
110107
NBClient := sysClient.NBClient
111108

112-
readAccountParams := nb.ReadAccountParams{Email: email}
113-
accountInfo, _ := NBClient.ReadAccountAPI(readAccountParams)
114-
115109
UpdateAccountParams := nb.UpdateAccountParams{
116110
Email: email,
117-
AllowedIPs: accountInfo.AllowedIPs,
118111
RemoveRoleConfig: true,
119112
}
120113

0 commit comments

Comments
 (0)