PK‘76“Χ2EGG-INFO/dependency_links.txt PK‘76”Ѝ22EGG-INFO/entry_points.txt[trac.plugins] httpauth.filter = httpauth.filter PK‘76ŒW¨˜ppEGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: TracHTTPAuth Version: 1.1 Summary: Use the AccountManager plugin to provide HTTP authentication from Trac itself. Home-page: http://trac-hacks.org/wiki/HttpAuthPlugin Author: Noah Kantrowitz Author-email: coderanger@yahoo.com License: BSD Description: UNKNOWN Keywords: trac plugin http auth Platform: UNKNOWN Classifier: Framework :: Trac PK‘76Αm>{EGG-INFO/requires.txtTracAccountManagerPK‘76 UΦs  EGG-INFO/SOURCES.txtsetup.py TracHTTPAuth.egg-info/PKG-INFO TracHTTPAuth.egg-info/SOURCES.txt TracHTTPAuth.egg-info/dependency_links.txt TracHTTPAuth.egg-info/entry_points.txt TracHTTPAuth.egg-info/requires.txt TracHTTPAuth.egg-info/top_level.txt httpauth/__init__.py httpauth/filter.py PK‘76ο—ά EGG-INFO/top_level.txthttpauth PK‘76“Χ2EGG-INFO/zip-safe PK,~5httpauth/__init__.pyPK‘76P “††httpauth/__init__.pyc;ς ΔrnEc@sdS(N((((s6build/bdist.darwin-8.8.1-i386/egg/httpauth/__init__.pys?sPKƒ76…χ² httpauth/filter.pyfrom trac.core import * from trac.config import ListOption from trac.web.api import IRequestFilter, RequestDone, IAuthenticator from trac.web.chrome import INavigationContributor try: from base64 import b64decode except ImportError: from base64 import decodestring as b64decode from acct_mgr.api import AccountManager __all__ = ['HTTPAuthFilter'] class HTTPAuthFilter(Component): """Request filter and handler to provide HTTP authentication.""" paths = ListOption('httpauth', 'paths', default='/login/xmlrpc', doc='Paths to force HTTP authentication on.') formats = ListOption('httpauth', 'formats', doc='Request formats to force HTTP authentication on') implements(IRequestFilter, IAuthenticator) # IRequestFilter methods def pre_process_request(self, req, handler): check = False for path in self.paths: if req.path_info.startswith(path): check = True break if req.args.get('format') in self.formats: check = True if check and not self._check_password(req): self.log.info('HTTPAuthFilter: No/bad authentication data given, returing 403') return self return handler def post_process_request(self, req, template, content_type): return template, content_type # IRequestHandler methods (sort of) def process_request(self, req): if req.session: req.session.save() # Just in case req.send_response(401) req.send_header('WWW-Authenticate', 'Basic realm="Control Panel"') req.send_header('Content-Type', 'text/plain') req.send_header('Pragma', 'no-cache') req.send_header('Cache-control', 'no-cache') req.send_header('Expires', 'Fri, 01 Jan 1999 00:00:00 GMT') req.end_headers() if req.method != 'HEAD': req.write('Authentication required') raise RequestDone # IAuthenticator methods def authenticate(self, req): user = self._check_password(req) if user: self.log.debug('HTTPAuthFilter: Authentication okay for %s', user) return user # Internal methods def _check_password(self, req): header = req.get_header('Authorization') if header: token = header.split()[1] user, passwd = b64decode(token).split(':', 1) if AccountManager(self.env).check_password(user, passwd): return user PK‘76ϊœŒΣΣhttpauth/filter.pyc;ς &™΅Ec@sždkTdklZdklZlZlZdklZydk l Z Wn e j odk l Z nXdk lZdgZdefd„ƒYZd S( (s*(s ListOption(sIRequestFilters RequestDonesIAuthenticator(sINavigationContributor(s b64decode(s decodestring(sAccountManagersHTTPAuthFiltercBsxtZdZeddddddƒZeddddƒZeeeƒd „Z d „Z d „Z d „Z d „Z RS(s:Request filter and handler to provide HTTP authentication.shttpauthspathssdefaults /login/xmlrpcsdocs&Paths to force HTTP authentication on.sformatss/Request formats to force HTTP authentication oncCs–t}x/|iD]$}|ii|ƒo t}PqqW|i i dƒ|i jo t}n|o|i |ƒ o|i idƒ|Sn|SdS(Nsformats>HTTPAuthFilter: No/bad authentication data given, returing 403(sFalseschecksselfspathsspathsreqs path_infos startswithsTruesargssgetsformatss_check_passwordslogsinfoshandler(sselfsreqshandlerspathscheck((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pyspre_process_requests   cCs||fSdS(N(stemplates content_type(sselfsreqstemplates content_type((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pyspost_process_request'scCs­|io|iiƒn|idƒ|iddƒ|iddƒ|iddƒ|iddƒ|id d ƒ|iƒ|id jo|id ƒnt‚dS( Ni‘sWWW-AuthenticatesBasic realm="Control Panel"s Content-Types text/plainsPragmasno-caches Cache-controlsExpiressFri, 01 Jan 1999 00:00:00 GMTsHEADsAuthentication required( sreqssessionssaves send_responses send_headers end_headerssmethodswrites RequestDone(sselfsreq((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pysprocess_request+s   cCs5|i|ƒ}|o|iid|ƒ|SndS(Ns*HTTPAuthFilter: Authentication okay for %s(sselfs_check_passwordsreqsuserslogsdebug(sselfsreqsuser((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pys authenticate<scCsp|idƒ}|oV|iƒd}t|ƒiddƒ\}}t|i ƒi ||ƒo|SqlndS(Ns Authorizationis:( sreqs get_headersheaderssplitstokens b64decodesuserspasswdsAccountManagersselfsenvscheck_password(sselfsreqspasswdsheaderstokensuser((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pys_check_passwordCs (s__name__s __module__s__doc__s ListOptionspathssformatss implementssIRequestFiltersIAuthenticatorspre_process_requestspost_process_requestsprocess_requests authenticates_check_password(((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pysHTTPAuthFilters      N(s trac.cores trac.configs ListOptions trac.web.apisIRequestFilters RequestDonesIAuthenticatorstrac.web.chromesINavigationContributorsbase64s b64decodes ImportErrors decodestrings acct_mgr.apisAccountManagers__all__s ComponentsHTTPAuthFilter( sIAuthenticators ListOptions RequestDones__all__sIRequestFiltersINavigationContributorsHTTPAuthFilters b64decodesAccountManager((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pys?s    PK‘76“Χ2€EGG-INFO/dependency_links.txtPK‘76”Ѝ22€<EGG-INFO/entry_points.txtPK‘76ŒW¨˜pp€₯EGG-INFO/PKG-INFOPK‘76Αm>{€DEGG-INFO/requires.txtPK‘76 UΦs  €‰EGG-INFO/SOURCES.txtPK‘76ο—ά €ΖEGG-INFO/top_level.txtPK‘76“Χ2€EGG-INFO/zip-safePK,~5€3httpauth/__init__.pyPK‘76P “††€ehttpauth/__init__.pycPKƒ76…χ² €httpauth/filter.pyPK‘76ϊœŒΣΣ€Yhttpauth/filter.pycPK ί]