Skip to content

Commit

Permalink
Remove AllowedIPs from passed parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Ben <[email protected]>
  • Loading branch information
Neon-White committed Nov 10, 2023
1 parent f5d422c commit ae3db6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/nb/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
7 changes: 0 additions & 7 deletions pkg/sts/sts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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,
}

Expand Down

0 comments on commit ae3db6a

Please sign in to comment.