Allow all rbt commands to authenticate using web-based login.

Review Request #14576 — Created Sept. 8, 2025 and submitted

Information

RBTools
release-5.x

Reviewers

This is the final change in a series of changes that ultimately allow
using web-based login for authentication in any rbt command.

We pass a web login callback function through to the
ReviewBoardHTTPPasswordMgr where our other auth callbacks live. We
also add a ReviewBoardWebLoginHandler auth handler which attempts
web-based login once upon the first HTTP 401. If it fails, we fall back
on our existing handlers.

  • Tested rbt post and rbt status passing --web-login to log in to
    a local dev server.
  • Tested rbt post and rbt status passing --web-login to log in to
    the real https://reviews.reviewboard.org server.
  • In the above tests, made sure that the ReviewBoardWebLoginHandler
    auth handler logic was reached by rbt post, and the
    get_authenticated_session logic was reached by rbt status.
  • Tested on RB6 and RB7.1.
  • Ran unit tests and add unit tests in an upcoming change.
Summary ID
Allow all rbt commands to authenticate using web-based login.
This is the final change in a series of changes that ultimately allow using web-based login for authentication in any rbt command. We pass a web login callback function through to the `ReviewBoardHTTPPasswordMgr` where our other auth callbacks live. We also add a `ReviewBoardWebLoginHandler` auth handler which attempts web-based login once upon the first HTTP 401. If it fails, we fall back on our existing handlers.
a386d7e788ee684b3a6c58c9d7465e413859d518
Description From Last Updated

Can you add docs and a "Version Added" for this?

chipx86chipx86

Let's put two blank lines on either side.

daviddavid

This should include a "Version Changed" with the new argument.

chipx86chipx86

The description shouldn't be indented.

chipx86chipx86

Is this to address a circular import? If so, can you add a comment for that?

chipx86chipx86

Blank line after the class docstring.

chipx86chipx86

This can be HTTPResponse | None now.

chipx86chipx86

Same here.

chipx86chipx86

This can be (WebLoginCallback | None) = None.

chipx86chipx86

Can you also add this to a "Version Changed" on the method?

chipx86chipx86

Same comment re: | None.

chipx86chipx86

Same comment re: "Version Changed" on the method.

chipx86chipx86

Description should be indented one level.

chipx86chipx86

Let's go with 5.4 for this release.

chipx86chipx86

web_login_callback appears last in the argument list.

chipx86chipx86
chipx86
  1. 
      
  2. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues

    Can you add docs and a "Version Added" for this?

  3. rbtools/api/request.py (Diff revision 1)
     
     
     
    Show all issues

    This should include a "Version Changed" with the new argument.

  4. rbtools/api/request.py (Diff revision 1)
     
     
     
    Show all issues

    The description shouldn't be indented.

  5. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues

    Is this to address a circular import? If so, can you add a comment for that?

  6. rbtools/api/request.py (Diff revision 1)
     
     
     
    Show all issues

    Blank line after the class docstring.

  7. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues

    This can be HTTPResponse | None now.

  8. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues

    Same here.

  9. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues

    This can be (WebLoginCallback | None) = None.

  10. rbtools/api/request.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    Can you also add this to a "Version Changed" on the method?

  11. rbtools/api/transport/sync.py (Diff revision 1)
     
     
    Show all issues

    Same comment re: | None.

  12. rbtools/api/transport/sync.py (Diff revision 1)
     
     
     
     
     
     
    Show all issues

    Same comment re: "Version Changed" on the method.

  13. rbtools/commands/base/commands.py (Diff revision 1)
     
     
     
    Show all issues

    Description should be indented one level.

  14. 
      
maubin
david
  1. 
      
  2. rbtools/api/request.py (Diff revisions 1 - 2)
     
     
     
     
     
     
     
     
    Show all issues

    Let's put two blank lines on either side.

  3. 
      
chipx86
  1. 
      
  2. rbtools/api/request.py (Diff revision 2)
     
     
    Show all issues

    Let's go with 5.4 for this release.

  3. rbtools/api/request.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
    Show all issues

    web_login_callback appears last in the argument list.

  4. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (f3878d9)