#608 tests for handling user groups
Merged by mikem. Opened by tkopecek.
tkopecek/koji user-group  into  master

Download 608.patch

New unit test + few functional changes - mainly raising GenericErrors instead of TypeError for non-existing users/groups.

Related: https://pagure.io/koji/issue/603
Related: https://pagure.io/koji/issue/604
Related: https://pagure.io/koji/issue/607

:thumbsup:

This goes a step beyond the three issues and also errors when dropping a user from a group that they are not in. Before, this did not error. Perhaps this is inconsistent (since addGroupMember does error if the user is already in the group), but I'm slightly cautious of raising an error when there was none before.

I was thinking about this, but I suspect, that it is not used often and while it is linked to security issues (group-based policies), it would be better to raise errors in all unexpected cases.

One more option, I was thinking about, is adding strict parameter similar to other strict uses (raise exception vs. pass, default True)

I was thinking about this, but I suspect, that it is not used often and while it is linked to security issues (group-based policies), it would be better to raise errors in all unexpected cases.

Hmm, good point. Ok then...

Commit 6bc248cd fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

Metadata