python change_password should support sreg proxy

RESOLVED FIXED

Status

Cloud Services
Server: Registration
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: atoll, Assigned: tarek)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
I wasn't able to get change-password to work on Python reg/sreg.  syncreg/controllers/user.py:change_password() is missing a proxy line.  i tried adding it, but it keeps getting 401 Unauthorized from the proxy.

The proxy line added was:

    def change_password(self, request):
        """Changes the user e-mail"""
        if self.app.config.get('auth.proxy'):
            return self._proxy(request)

The full transmission to sreg with a simply proxy line added is:

  POST /user/1.0/tecl6j3lujzcgmz4f4vv5yka3cxcdgkc/password HTTP/1.1
  Accept-Encoding: identity
  Content-Length: 16
  X-Forwarded-For: 10.250.64.84
  Connection: close
  User-Agent: Python-urllib/2.6
  Host: weave-stage-sreg01
  Content-Type: application/x-www-form-urlencoded

And the response is "401 Unauthorized".
(Reporter)

Comment 1

7 years ago
Response:

HTTP/1.1 401 Unauthorized
Server: gunicorn/0.11.2
Date: Fri, 24 Dec 2010 12:14:46 GMT
Connection: close
WWW-Authenticate: Basic realm=\"Sync\"
Content-Length: 253
Content-Type: text/plain

401 Unauthorized

This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
(Reporter)

Comment 2

7 years ago
If it helps any, delete-account works fine.
(Reporter)

Updated

7 years ago
Blocks: 609634
(Assignee)

Comment 3

7 years ago
The 401 is unrelated and your patch looks good: a proxy call was missing.

I am fixing this and check that it works in -dev. Will follow-up on the 401 next
(Assignee)

Comment 4

7 years ago
The problem was located and fixed -- The proxy calls are not covered by the tests -- although I will add in the old functional test suite a test for this, as it is running on the -dev stack so it's able to exercise the proxy (via hudson)

Fixes:

- the proxy function needs to pass the auth header: http://hg.mozilla.org/services/server-core/rev/96249a5d025a
- the password change in the backend was not converting the right using md5: http://hg.mozilla.org/services/server-core/rev/2b0d7e7787d9
- the proxy, as you noticed was missing: http://hg.mozilla.org/services/server-reg/rev/0a30905af825

I controlled that it works properly in dev and notify the result here.
(Reporter)

Comment 5

7 years ago
Deployed hg tip to staging, change password works now
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.