Support authenticating in RBTools with API tokens.

Review Request #6237 — Created Aug. 16, 2014 and submitted

Information

RBTools
release-0.6.x
cf108dd...

Reviewers

Review Board 2.1+ supports authenticating using API tokens. This change
adds a new --api-token= parameter for commands to make use of these when
authenticating.

Since authentication happens before accessing resources, we can't really
check for a capability before deciding whether or not to allow a user to
pass a token. Passing a token to a server that doesn't support it is
harmless, though.

Tested this with different policies, including Full Access, Read-Only, and
custom policies. I used rbt api-get, rbt post, rbt close, rbt status,
and rbt diff.

I tried posting this change using a read-only API token, and got an error about
not having permission. I then tried with my full access token, and it succeeded.

Description From Last Updated

redefinition of unused 'StringIO' from line 11

reviewbotreviewbot
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/transport/sync.py
        rbtools/api/request.py
        rbtools/commands/__init__.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        rbtools/api/transport/sync.py
        rbtools/api/request.py
        rbtools/commands/__init__.py
    
    
  2. rbtools/api/request.py (Diff revision 1)
     
     
    Show all issues
     redefinition of unused 'StringIO' from line 11
    
  3. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.6.x (b3ad370)
Loading...