diff --git a/apply_issue.py b/apply_issue.py index 52f31882d..6784ce535 100755 --- a/apply_issue.py +++ b/apply_issue.py @@ -24,6 +24,10 @@ def main(): parser.add_option( '-v', '--verbose', action='count', default=0, help='Prints debugging infos') + parser.add_option( + '-e', + '--email', + help='Email address for authenticating with Rietveld') parser.add_option( '-i', '--issue', type='int', help='Rietveld issue number') parser.add_option( @@ -48,7 +52,7 @@ def main(): if not options.issue: parser.error('Require --issue') - obj = rietveld.Rietveld(options.server, None, None) + obj = rietveld.Rietveld(options.server, options.email, None) if not options.patchset: options.patchset = obj.get_issue_properties( diff --git a/rietveld.py b/rietveld.py index 0323332cd..e3da3f0e5 100644 --- a/rietveld.py +++ b/rietveld.py @@ -47,6 +47,12 @@ class Rietveld(object): extra_headers=extra_headers or {}) else: self.rpc_server = upload.GetRpcServer(url, email) + # If email is given as an empty string, then assume we want to make + # requests that do not need authentication. Bypass authentication by + # setting the flag to True. + if email == '': + self.rpc_server.authenticated = True + self._xsrf_token = None self._xsrf_token_time = None