veracode-api-py icon indicating copy to clipboard operation
veracode-api-py copied to clipboard

Support for removing a user's team assignments

Open Gby56 opened this issue 3 years ago • 6 comments

I think this comes down to the incremental vs partial choice in the api I managed to add new teams to a users, it was really easy because I just had to give the new team's id and it was added on the existing... but I knew this would probably be a problem if I wanted to remove that after.

Gby56 avatar Dec 02 '22 17:12 Gby56

~~Ah nevermind ! I could use the update_team and do the whole thing there also~~

Damn... the update_team is also incremental... there's no function yet to remove people from teams I think @tjarrettveracode ....

Gby56 avatar Dec 02 '22 17:12 Gby56

Yeah, the way you have to do it is to fetch the team's current info, remove the user from the list of team members, and update the team with the updated list. I don't think you need to specify incremental in that case…

tjarrettveracode avatar Dec 02 '22 18:12 tjarrettveracode

But I think the incremental is hardcoded so I can't do a full replacement of the team members

Just checked and the Params are hardcoded yeah

Gby56 avatar Dec 02 '22 19:12 Gby56

@tjarrettveracode Here's why I think it's currently not possible to remove a user from a team, from the user's API, it's hardcoded incremental. So I'll implement the other way as you mentioned, take the whole team members and remove, and push that to the team again https://github.com/veracode/veracode-api-py/blob/main/veracode_api_py/identity.py#L110

Gby56 avatar Dec 13 '22 17:12 Gby56

I actually don't think there is an API in the client to get all the members in a team right now... so I can't do that pull, remove, replace either

Gby56 avatar Dec 13 '22 17:12 Gby56

Created https://github.com/veracode/veracode-api-py/issues/46 because it's needed for this issue

Gby56 avatar Dec 13 '22 17:12 Gby56