xtypebee / rietveld

Automatically exported from code.google.com/p/rietveld
Apache License 2.0
0 stars 0 forks source link

Logic for hosted accounts incorrect #344

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using a Google account on Google hosted domains, attempt to upload a patch 
to codereview.appspot.com.

What is the expected output? What do you see instead?

Expect the patch to be uploaded, instead:

PS C:\Users\jaraco\projects\public\httplib2> upload --rev 198:219
Upload server: codereview.appspot.com (change with -s/--server)
New issue subject: Script to generate CAs
Email (login for uploading to codereview.appspot.com) [jaraco@jaraco.com]:
Using password from system keyring.

Traceback (most recent call last):
  File "C:\Users\jaraco\scripts\upload.py", line 2330, in <module>
    main()
  File "C:\Users\jaraco\scripts\upload.py", line 2322, in main
    RealMain(sys.argv)
  File "C:\Users\jaraco\scripts\upload.py", line 2284, in RealMain
    response_body = rpc_server.Send("/upload", body, content_type=ctype)
  File "C:\Users\jaraco\scripts\upload.py", line 375, in Send
    self._Authenticate()
  File "C:\Users\jaraco\scripts\upload.py", line 421, in _Authenticate
    super(HttpRpcServer, self)._Authenticate()
  File "C:\Users\jaraco\scripts\upload.py", line 310, in _Authenticate
    auth_token = self._GetAuthToken(credentials[0], credentials[1])
  File "C:\Users\jaraco\scripts\upload.py", line 264, in _GetAuthToken
    e.headers, response_dict)
__main__.ClientLoginError: HTTP Error 403: Forbidden

The problem appears to be with the logic in upload.py. It assumes 'GOOGLE' 
account type unless the host ends with google.com. Unfortunately, that logic 
fails when using a google hosted domain account for appspot.com.

For now, I've patched the upload script in my environment to account for the 
mismatch. What's the proper fix?

Original issue reported on code.google.com by jar...@jaraco.com on 3 Nov 2011 at 8:44

GoogleCodeExporter commented 9 years ago
Were you transitioned?

See http://support.google.com/a/bin/answer.py?hl=en&answer=182075

Original comment by maruel@chromium.org on 7 Jan 2012 at 10:02

GoogleCodeExporter commented 9 years ago
Yes. I was transitioned on 2-Sep-2011.

My Google account, jaraco@jaraco.com, is a transitioned Google account hosted 
in the Google-hosted jaraco.com domain. In this situation, I need a 'HOSTED' 
account type when connecting to codereview.appspot.com, else I get a 403: 
Forbidden.

Can you please re-open or suggest why the existing implementation is adequate?

Original comment by jar...@jaraco.com on 8 Jan 2012 at 4:32

GoogleCodeExporter commented 9 years ago
I've tested upload with my custom domain account and it went ok. Can you update 
`upload.py`?

Original comment by techtonik@gmail.com on 9 Jan 2012 at 9:54

GoogleCodeExporter commented 9 years ago
Sure enough. I just grabbed the latest upload.py and ran it (unpatched) and it 
worked like a charm.

I'm not sure why it didn't work before and it does now, but in any case, I'm 
glad it's fixed. WontFix disposition is fine.

Original comment by jar...@jaraco.com on 9 Jan 2012 at 1:07

GoogleCodeExporter commented 9 years ago
That's nice. =)

There were changes both to upload.py and to AppEngine, so it is hard to tell 
what fixed the issue without `bisect`. I feel like we need to embed a version 
in upload.py to ask client to update if update is needed.

Original comment by techtonik@gmail.com on 9 Jan 2012 at 3:15