Fixed HTTP Digest backend unauthenticated user being added as reviewer issue- Bug-4929

Review Request #11980 — Created Jan. 22, 2022 and updated — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

Currently, non-existing username is allowed to be added as a reviewer in Review Board review request even though the username does not exist in the HTTP Digest .htpasswd file.
The fix involves creating a new helper function that checks if the username is found in the .htpasswd file and have both the authenticate and get_or_create_user functions call this helper function. It will not create a user if the username is not found, and hence it will not allow non-existing username to be added as a reviewer.

Added a test suite for the HTTPDigestBackend class that covers the three methods in the class.

As for manual checking, I attached a couple of files to show the output on the review request.
The first screenshot shows error when adding non-exsiting user as a reviewer.
The second screenshot shows that an existing user is added as a reviewer successfully.
The third screenshot shows all the users I have on the list.

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 7. See what's changed.

orig
1
2
3
4
5
6
7

Commits

First Last Summary ID Author
Fixed HTTP Digest backend unauthenticated user being added as reviewer issue
d13eacca0a862c1e23fa36110fc74e98c33b7978 sng06
Removed commented-out code
56e8ccaaa2f9c367f53fd7349c3c16e7bb9f9b53 sng06
reviewboard/accounts/backends/http_digest.py
Loading...