logo       

Re: auth_type issues: msg#00071

Subject: Re: auth_type issues

granted, having two names for the same thing is confusing, especially in Perl-land where we access both through $r, but I like the way it turned out - $r->ap_auth_type represents the actual name of the request_rec slot, while $r->auth_type represents the function, and it's common to strip the ap_ prefix from functions when we port them to mod_perl.


IMHO, that's too confusing. May be we should have $r->per_dir_config->auth_type and $r->auth_type?


yeah, it is confusing. but it's not my fault - I'm sure there is a good reason why the folks over in core thought it was ok to have a function called ap_auth_type and a slot in the request_rec called ap_auth_type.

however, the more I look at things, the more I like the way it turned out. with my patch set...

  - $r->auth_type means the same thing in 1.0 and 2.0 (it accesses the
configured AuthType directive for the current request)

- $r->ap_auth_type matches the associated slot in the request_rec by name, just like $r->assbackwards and $r->user

- $r->ap_auth_type is autogenerated, so we don't have to support additional code for it's access

- migration of authentication code from 1.0 to 2.0 is as simple as "$r->connection->user is now $r->ap_auth_type" (and possibly a patch in 1.0 to ease migration, similar to how $r->user is an alias in 1.0)

the only other option is probably what you say and what I brought up before - use $r->per_dir_config->auth_type. but I think that has the chance to be equally misleading - we should be using the ap_auth_type() function for access to AuthType, and $r->per_dir_config->auth_type suggests (or really is) accessing the per_dir_config structure directly.

of course, if you go with $r->per_dir_config->auth_type then that means that $r->auth_type is really accessing r->ap_auth_type, which is _really_ confusing if you think about 1.0 portability, where $r->auth_type is _completely_ different between 1.0 and 2.0.

so, all in all, I don't think it's so bad the way I've set it up. my suggested change has minimal impact on those using the API already, and for those being introduced to it things sorta fall into place (if you think in terms of the request_rec). the only place it will likely get confusing is for we hard-core Apache types, who never expect to see ap_ in a method call, but in that case it even makes sense - since we never include ap_ in a method, it must be something else (like a real name in the request_rec, go figure).

anyway, I guess I'm saying that I'm comfortable with it, it works, it involves the least number of changes for both core and end users, and it's the least confusing option in a very confusing situation.

--Geoff


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe