PKx*62EGG-INFO/dependency_links.txt PKx*6Ѝ22EGG-INFO/entry_points.txt[trac.plugins] httpauth.filter = httpauth.filter PKx*6xrrEGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: TracHTTPAuth Version: 1.0.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 PKx*6m>{EGG-INFO/requires.txtTracAccountManagerPKx*6 Us  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 PKx*6 EGG-INFO/top_level.txthttpauth PKx*62EGG-INFO/zip-safe PK,~5httpauth/__init__.pyPKx*6Phttpauth/__init__.pyc; rnEc@sdS(N((((s6build/bdist.darwin-8.8.1-i386/egg/httpauth/__init__.pys?sPKx*6+Rm m 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 import base64 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.') implements(IRequestFilter, IAuthenticator) # IRequestFilter methods def pre_process_request(self, req, handler): for path in self.paths: if req.path_info.startswith(path): header = req.get_header('Authorization') if header is None: self.log.info('HTTPAuthFilter: No authentication data given, returing 403') return self # Run HTTP auth else: token = header.split()[1] user, passwd = base64.b64decode(token).split(':', 1) if AccountManager(self.env).check_password(user, passwd): self.log.debug('HTTPAuthFilter: Authentication okay') req.__user = user else: self.log.info('HTTPAuthFilter: Bad authentication data given, returing 403') return self # Failed auth return handler def post_process_request(self, req, template, content_type): return template, content_type # IRequestHandler methods 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): try: return req.__user except AttributeError: return None # Bail out PKx*6'#; httpauth/filter.pyc; FEc@ssdkTdklZdklZlZlZdklZdk Z dk l Z dgZ de fdYZdS((s*(s ListOption(sIRequestFilters RequestDonesIAuthenticator(sINavigationContributorN(sAccountManagersHTTPAuthFiltercBsZtZdZeddddddZeeedZdZ d Z d Z RS( s:Request filter and handler to provide HTTP authentication.shttpauthspathssdefaults /login/xmlrpcsdocs&Paths to force HTTP authentication on.cCsx|iD]}|ii|o|id}|tjo|i i d|Sq|i d}t i|i dd\}}t|ii||o|i id||_q|i i d|Sq q W|SdS(Ns Authorizations:HTTPAuthFilter: No authentication data given, returing 403is:s#HTTPAuthFilter: Authentication okays;HTTPAuthFilter: Bad authentication data given, returing 403(sselfspathsspathsreqs path_infos startswiths get_headersheadersNoneslogsinfossplitstokensbase64s b64decodesuserspasswdsAccountManagersenvscheck_passwordsdebugs_HTTPAuthFilter__usershandler(sselfsreqshandlerspasswdsheaderstokensuserspath((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|iin|id|idd|idd|idd|idd|id d |i|id jo|id ntdS( NisWWW-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   cCs)y |iSWntj o tSnXdS(N(sreqs_HTTPAuthFilter__usersAttributeErrorsNone(sselfsreq((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pys authenticate=s ( s__name__s __module__s__doc__s ListOptionspathss implementssIRequestFiltersIAuthenticatorspre_process_requestspost_process_requestsprocess_requests authenticate(((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pysHTTPAuthFilter s      (s trac.cores trac.configs ListOptions trac.web.apisIRequestFilters RequestDonesIAuthenticatorstrac.web.chromesINavigationContributorsbase64s acct_mgr.apisAccountManagers__all__s ComponentsHTTPAuthFilter( sIAuthenticators ListOptions RequestDones__all__sbase64sIRequestFiltersINavigationContributorsHTTPAuthFiltersAccountManager((s4build/bdist.darwin-8.8.1-i386/egg/httpauth/filter.pys?s     PKx*62EGG-INFO/dependency_links.txtPKx*6Ѝ22<EGG-INFO/entry_points.txtPKx*6xrrEGG-INFO/PKG-INFOPKx*6m>{FEGG-INFO/requires.txtPKx*6 Us  EGG-INFO/SOURCES.txtPKx*6 EGG-INFO/top_level.txtPKx*62EGG-INFO/zip-safePK,~55httpauth/__init__.pyPKx*6Pghttpauth/__init__.pycPKx*6+Rm m  httpauth/filter.pyPKx*6'#; httpauth/filter.pycPK