Improve the authentication interface

RESOLVED DUPLICATE of bug 659155

Status

Cloud Services
Server: Core
RESOLVED DUPLICATE of bug 659155
7 years ago
7 years ago

People

(Reporter: tarek, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
From bug 625001

> Comment on attachment 503127 [details] [diff] [review]
> Make sure the password_reset API is public
> 
> +        user_name = request.sync_info['username']
> +        user_id = self.auth.get_user_id(user_name)
> +        user_name, user_email = self.auth.get_user_info(user_id)
> 
> This trio is a little weirdly loopy, though I understand why. Perhaps we should
> just add a get_user_email into auth.
> 

This is not optimal for sure. 

Another solution would be to add an optional "fields" argument to
get_user_info() ala ldapsearch, to filter out the fields we want to get back:

  user_email = self.auth.get_user_info(user_id, fields=['email'])

This can be useful as long as we're able to define a generic list of fields for
the user, every backend can translate to its own internal representation.
This would work. For now, I'd just leave it until we have more idea what else might get packed in. The code there works (though I might go with __, user_email to raise fewer eyebrows)
(Reporter)

Comment 2

7 years ago
(In reply to comment #1)
> This would work. For now, I'd just leave it until we have more idea what else
> might get packed in. The code there works

Sure.

> (though I might go with __, user_email to raise fewer eyebrows)

Yeah that's what I ended up doing for clarity
(Reporter)

Comment 3

7 years ago
A user object is coming up, we'll be bale to use (bug 659155)
Depends on: 659155
(Reporter)

Updated

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