Re: Direction of PEAR Auth
| From: | Hugues Peeters | Date: | Mon, 27 Feb 2006 15:24:15 +0000 |
| Subject: | Re: Direction of PEAR Auth | ||
| Groups: | php.pear.qa | ||
| Request: | Send a blank email to pear-qa+get-3563@lists.php.net to get a copy of this message | ||
Dear Pear contributors,
Christophe Gesché (aka Moosh) has already forwarded one of my
message concerning Auth::LDAP (see http://news.php.net/php.pear.qa/3510).
Last week, I worked on the Auth LDAP container to make it work
again in our own Application. I forward in attachment the adapted
container code for 1.3 Auth branches.
Here are the main changes common in both branches :
- Fix a detected bug in _quoteFilterString()
(Note : I just noted that it has been fixed by someone
else since then ...)- Rename checkGroup() method in _checkGroup() to follow the convention of other private class methods. - Set a default value for $this->options['url'] rather than test later in the code if it is set. - Limit the _deconnect() method calls by refactoring a bit the code. Concerning Auth LDAP 1.3 branch, aside the changes cited above, here are the other changes : - Refactor fetchData() method extracting the code for the additional attributes retrieval and put it in a new method called '_fetchAdditionalAttributes()'. - Add a new method called _setV12OptionsToV13() who manage the compatibility problems that could arise when user will pass from Auth LDAP 1.2 to 1.3. I've read that Adam Ashley aim to release Auth 1.3 stable bery soon. I hope that the following remarks concerning the Auth LDAP container don't come too late, but I think it is certainly preferable to communicate them to you rather than keep them to me, isn't it ? 1. The main remark concerns the 'attrformat' option recently
added by Moosh. This option was added because when Jan Wagner
implement the possibility to fetch additional user attributes
in the 1.3 branch, he choose to store them in pure LDAP
format. This format is NOT compatible with data format used
by other Auth containers (actually the 'DB' one ...) and it
will probably pose problems when user will try to retrieve
these data from the Auth getAuthData() interface. Later,
after discussions with Arnaud Limbourg, Moosh has added the
'attrformat' option allowing user to set these data format to
'AUTH' or 'LDAP'. At that time it was decided to set the
default value to 'LDAP' to not break the compatibility. But
Moosh didn't really figure out that the 'additional
attributes' feature was only implemented in Auth 1.3, not
flagged as stable yet. Thus, couldn't we reconsider the
default value of 'attrformat' option and set it to 'AUTH'
before releasing the stable version ? It would probably be
far easier for Auth library user, wouldn't it ?
2. The 'attributes' option of the LDAP container expects an
array. On the other side, the equivalent option for the DB
container ('db_fields') expects a comma separated list in
string format. Wouldn't it be better if both options, in LDAP
and DB share, a similar format ? That just mean a simple
explode() statement to add in the current code.
3. This remark is really minor. I wonder if 'attributes' is
really the most appropriate name for this option as we know
that there is also an other option called 'userattr' in this
container . Considering the existence of this other 'attr'
option, maybe another name for 'attributes', like
'otherattr', would clarify the option purpose in a greater
degree, wouldn't it ? For your information, that's what has
already been done for the 'scope', option which as been
converted in 'userscope' and 'groupscope' in the Auth LDAP
1.3 version.
I hipe that this message doesn't upset too much the release
planning.
Best regards,
Hugues Peeters
PS. I would like to test the attached code again juste before
sending it to you. Sadly the computer hosting our LDAP server has
just crashed. As time is running, I indulge myself to send it
nevertheless (it worked yesterday, it should today ... ). But,
please, could you test it again before commit it into Pear CVS.