PK%;¦8“Χ2EGG-INFO/dependency_links.txt PK%;¦8$χ M22EGG-INFO/entry_points.txt[trac.plugins] traccas.traccas = traccas.traccas PK%;¦8 έBZZEGG-INFO/PKG-INFOMetadata-Version: 1.0 Name: TracCAS Version: 2.0.1 Summary: A modified authentication plugin to use the Yale CAS system. Home-page: http://trac-hacks.org/wiki/TracCasPlugin Author: Noah Kantrowitz Author-email: noah@coderanger.net License: BSD Description: Notes ===== This is a modified login plugin to use a `JA-SIG CAS server`__ as the back-end. __ http://www.ja-sig.org/products/cas/ Configuration ============= Options in the ``[cas]`` section: ``server``: **required** The base URL of the CAS server. ``login_path``: Relative path to the login service. Defaults to ``/login``. ``logout_path``: Relative path to the logout service. Defaults to ``/logout``. ``validate_path``: Relative path to the validation service. Defaults to ``/validate``. To enable the plugin:: [components] traccas.* = enabled trac.web.auth.LoginModule = disabled :note: Even if installing locally, you must disable the default LoginModule. Example ======= An example configuration:: [cas] server = https://login.example.com/cas Keywords: trac 0.11 plugin cas authentication Platform: UNKNOWN PK%;¦8Σ‘šEGG-INFO/requires.txtTracPK%;¦8ϋ¦­‘EGG-INFO/SOURCES.txtREADME setup.py TracCAS.egg-info/PKG-INFO TracCAS.egg-info/SOURCES.txt TracCAS.egg-info/dependency_links.txt TracCAS.egg-info/entry_points.txt TracCAS.egg-info/requires.txt TracCAS.egg-info/top_level.txt traccas/__init__.py traccas/pycas.py traccas/traccas.py PK%;¦8²j΄―EGG-INFO/top_level.txttraccas PK%;¦8“Χ2EGG-INFO/zip-safe PK‘š€8Ίρrtraccas/__init__.pyfrom traccas import * PK%;¦8΄ ΄ traccas/pycas.pyc;ς ίDHc@s,dkZdkZdefd„ƒYZdS(NsPyCAScBsAtZdZed„Zd„Zed„Zd„Zd„Z RS(s&A class for working with a CAS server.cKsJ||_||_hdd<dd<dd<|_|ii|ƒdS(Ns login_paths/logins logout_paths validate_paths /validate(surlsselfsrenewspathssupdateskwords(sselfsurlsrenewskwords((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pys__init__s  $cCsE|i|iddti|ƒ}|io|d7}n|SdS(s+Return the login URL for the given service.s login_paths ?service=s &renew=trueN(sselfsurlspathssurllibs quote_plussservicesbasesrenew(sselfsservicesbase((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pys login_urls % cCs>|i|id}|o|dti|ƒ7}n|SdS(sReturn the logout URL.s logout_paths?url=N(sselfsurlspathssbasesurllibs quote_plus(sselfsurlsbase((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pys logout_urls cCsV|i|iddti|ƒdti|ƒ}|io|d7}n|SdS(s>Return the validation URL for the given service. (For CAS 1.0)s validate_paths ?service=s&ticket=s &renew=trueN( sselfsurlspathssurllibs quote_plussservicesticketsbasesrenew(sselfsservicesticketsbase((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pys validate_url s 6 cCsYti|i||ƒƒ}|iƒ}|i ƒdj}|iƒi ƒ}||fSdS(s4Validate the given ticket against the given service.syesN( surllib2surlopensselfs validate_urlsservicesticketsfsreadlinesvalidsstripsuser(sselfsservicesticketsfsvalidsuser((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pysvalidate_ticket's  ( s__name__s __module__s__doc__sFalses__init__s login_urlsNones logout_urls validate_urlsvalidate_ticket(((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pysPyCASs    (surllibsurllib2sobjectsPyCAS(surllib2surllibsPyCAS((s3build/bdist.darwin-8.11.1-i386/egg/traccas/pycas.pys?sPKHœ€8nΓ΄1? ? traccas/traccas.py# CASified login module for Trac from trac.core import * from trac.config import Option from trac.web.api import IAuthenticator, IRequestHandler from trac.web.chrome import INavigationContributor from trac.util import escape, hex_entropy, Markup from trac.web.auth import LoginModule from genshi.builder import tag from pycas import PyCAS class CasLoginModule(LoginModule): """A CAS-based login module.""" server = Option('cas', 'server', doc='Base URL for the CAS server') login_path = Option('cas', 'login_path', default='/login', doc='Path component for the login system') logout_path = Option('cas', 'logout_path', default='/logout', doc='Path component for the logout system') validate_path = Option('cas', 'validate_path', default='/validate', doc='Path component for the validation system') # IAuthenticatorMethods def authenticate(self, req): ticket = req.args.get('ticket') if ticket: valid, user = self.cas.validate_ticket(req.abs_href.login(), ticket) if valid: req.environ['REMOTE_USER'] = user return super(CasLoginModule, self).authenticate(req) # INavigationContributor methods def get_navigation_items(self, req): if req.authname and req.authname != 'anonymous': yield 'metanav', 'login', 'logged in as %s' % req.authname yield 'metanav', 'logout', tag.a('Logout', href=req.href.logout()) else: yield 'metanav', 'login', tag.a('Login', href=self.cas.login_url(req.abs_href.login())) # Internal methods def _do_login(self, req): if not req.remote_user: req.redirect(self.cas.login_url(req.abs_href.login())) super(CasLoginModule, self)._do_login(req) def _do_logout(self, req): if req.authname: super(CasLoginModule, self)._do_logout(req) req.redirect(self.cas.logout_url(req.abs_href())) else: req.redirect(req.abs_href()) def cas(self): paths = { 'login_path': self.login_path, 'logout_path': self.logout_path, 'validate_path': self.validate_path, } return PyCAS(self.server, **paths) cas = property(cas) PK%;¦8ΰήΞCCtraccas/traccas.pyc;ς ψGHc@sŽdkTdklZdklZlZdklZdkl Z l Z l Z dk l Z dklZdklZde fd „ƒYZd S( (s*(sOption(sIAuthenticatorsIRequestHandler(sINavigationContributor(sescapes hex_entropysMarkup(s LoginModule(stag(sPyCASsCasLoginModulecBs­tZdZeddddƒZeddddddƒZedd dd dd ƒZedd dd ddƒZd„Zd„Z d„Z d„Z d„Z e e ƒZ RS(sA CAS-based login module.scassserversdocsBase URL for the CAS servers login_pathsdefaults/logins#Path component for the login systems logout_paths/logouts$Path component for the logout systems validate_paths /validates(Path component for the validation systemcCss|iidƒ}|o@|ii|iiƒ|ƒ\}}|o||i dhd|i<d|i<d|i<}t|i|SdS(Ns login_paths logout_paths validate_path(sselfs login_paths logout_paths validate_pathspathssPyCASsserver(sselfspaths((s5build/bdist.darwin-8.11.1-i386/egg/traccas/traccas.pyscas7s*(s__name__s __module__s__doc__sOptionsservers login_paths logout_paths validate_paths authenticatesget_navigation_itemss _do_logins _do_logoutscassproperty(((s5build/bdist.darwin-8.11.1-i386/egg/traccas/traccas.pysCasLoginModule s        N(s trac.cores trac.configsOptions trac.web.apisIAuthenticatorsIRequestHandlerstrac.web.chromesINavigationContributors trac.utilsescapes hex_entropysMarkups trac.web.auths LoginModulesgenshi.builderstagspycassPyCASsCasLoginModule( sIAuthenticatorsINavigationContributorsOptionsIRequestHandlersCasLoginModulesMarkups LoginModulesPyCASs hex_entropystagsescape((s5build/bdist.darwin-8.11.1-i386/egg/traccas/traccas.pys?s     PK%;¦8“Χ2€EGG-INFO/dependency_links.txtPK%;¦8$χ M22€<EGG-INFO/entry_points.txtPK%;¦8 έBZZ€₯EGG-INFO/PKG-INFOPK%;¦8Σ‘š€.EGG-INFO/requires.txtPK%;¦8ϋ¦­‘€eEGG-INFO/SOURCES.txtPK%;¦8²j΄―€›EGG-INFO/top_level.txtPK%;¦8“Χ2€ΧEGG-INFO/zip-safePK‘š€8Ίρr€traccas/__init__.pyPK%;¦8΄ ΄ €gtraccas/pycas.pycPKHœ€8nΓ΄1? ? €Jtraccas/traccas.pyPK%;¦8ΰήΞCC€Ή#traccas/traccas.pycPK Z-3