Allow logging in with an API token.

Review Request #13108 — Created June 15, 2023 and submitted

Information

RBTools
release-5.x

Reviewers

This updates the login methods on the server and transport classes to allow
logging in to the Review Board server with either a username and password
combination or an API token.

  • Ran unit tests.
  • Tested with the upcoming web based login flow change which uses an API
    token to login.
  • Tested logging in with a username and password.
  • Tested logging out.
  • Tested passing --username and --password options to commands.
  • Tested passing --api-token option to commands.
Summary ID
Allow logging in with an API token.
7c31af309f8e08535fc9439d27b198692fa527d5
Description From Last Updated

Let's make this a keyword-only argument. In fact, ideally, they'd all be (we can use housekeeping to deprecate old behavior). …

chipx86chipx86

We should probably put the same notice in reset().

chipx86chipx86

Looks like these None values can be removed now, right? They're all defaults.

chipx86chipx86

Let's call these with keyword arguments now, since the call's starting to get more complex and less obvious. I want …

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

    Let's make this a keyword-only argument. In fact, ideally, they'd all be (we can use housekeeping to deprecate old behavior).

    Same with reset(), probably.

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

    We should probably put the same notice in reset().

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

    Looks like these None values can be removed now, right? They're all defaults.

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

    Let's call these with keyword arguments now, since the call's starting to get more complex and less obvious.

    I want to start using keyword-only arguments in more places to give us room to expand and change the API implementation as we grow it.

  6. 
      
maubin
maubin
chipx86
  1. Looks good! Since it uses housekeeping, you'll want to wait until https://reviews.reviewboard.org/r/13124/ is landed, but otherwise, Ship It!

  2. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (0062708)