You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2002/02/18 19:11:25 UTC
Exporting of group information to modules...
For a little thing I'm doing, it would be so cool to have (if possible) the
groups in which a user is into somewhere in the request_rec structure
(something like ap_table_get(r->notes,"auth_groups") returns a list of all
groups in which the user is authenticated...
It's a pretty straightforward patch seeing the sources for mod_auth.c, but I
might be mislead. Basically, what I have to do is to check if a particular
user is a member of a group at request time: Let's say that my httpd.conf
looks like:
<Location /restricted>
...
Require group admins users
...
</Location>
At request processing stage, I have to figure out if a user is in the
"admins", the "users" or both groups...
Does it make any sense? Is it already there (meaning, am I stupid not to see
it?), and is something someone else wants/requires????
Cheeri'os!! :)
Pier
Re: Exporting of group information to modules...
Posted by di...@covalent.net.
On Mon, 18 Feb 2002, Pier Fumagalli wrote:
> Does it make any sense? Is it already there (meaning, am I stupid not to see
> it?), and is something someone else wants/requires????
Makes perfect sense - and blame me for not putting it in there - I've done
exactly this for customers abusing the r->notes.
The reason why a generic solution is hard is that basic auth is just one
of the many auth methods - not all of which have a natural 'group'
concept. So you may end up being very specific to the auth method. You
could make the argument that the Realm string is closer to the protocol.
It might be an idea to have an opaque key/value pair block keyed on the
auth name; i.e.
modulename ~+ m/mod_(\w+).c/
$1 . '_' . $key
auth_realm
auth_uname
auth_group
auth_group_required
secureid_uname
secureid_pin
secureid_tokenserial
sysem_userid
sysem_group
sysem_class
ssl_certid
ssl_x509...all :__)
Etc in r->notes or elsewhere.
Dw