Changeset 4123 for TI12-security


Ignore:
Timestamp:
14/08/08 16:19:34 (11 years ago)
Author:
pjkersha
Message:

Created ndg.security.server.pylons.container: generic pylons based container for NDG Security services. This is intended for OpenID Provider and Attribute Authority and Session Manager WSGI middleware. The latter two will replace Twisted based platform for these services.

Location:
TI12-security/trunk/python
Files:
48 added
4 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/Tests/openid-provider/op/op/lib/rendering.py

    r4122 r4123  
    7272     
    7373        return _render('ndg.security.mainPage', c=c, g=config['pylons.g'], h=h) 
    74      
     74 
     75 
     76    def renderIdentityPage(self, environ): 
     77        """Identity page""" 
     78        path = environ['PATH_INFO'] 
     79        username = path[4:] 
     80        if not username: 
     81            h.redirect_to(self.urls['url_mainpage']) 
     82             
     83        c = State(urls=self.urls, session=self.session) 
     84        c.title = "OpenID Identity Page" 
     85                         
     86        link_tag = '<link rel="openid.server" href="%s"/>' % \ 
     87              self.urls['url_openidserver'] 
     88               
     89        yadis_loc_tag = '<meta http-equiv="x-xrds-location" content="%s"/>' % \ 
     90            (self.urls['url_yadis']+'/'+username) 
     91             
     92        c.headExtras = link_tag + yadis_loc_tag 
     93        identityURL = self.base_url + path 
     94        c.xml = "<b><pre>%s</pre></b>" % identityURL 
     95         
     96        return _render('ndg.security.identityPage', 
     97                       c=c, g=config['pylons.g'], h=h)     
    7598     
    7699    def renderDecidePage(self, environ, oidRequest): 
     
    84107        return _render('ndg.security.decidePage', c=c,g=config['pylons.g'],h=h) 
    85108 
    86  
     109         
    87110    def renderErrorPage(self, environ, msg): 
    88111        c = State(urls=self.urls, session=self.session) 
  • TI12-security/trunk/python/Tests/openid-provider/op/op/templates/ndg/security/mainPage.kid

    r4105 r4123  
    66        <div py:replace="header()"/> 
    77        <div class="mainPageContent" style="text-indent:5px">         
    8             <h2>OpenID Provider</h2> 
     8            <h2>OpenID Identity Page</h2> 
    99            <p>This service manages your NDG OpenID Login.</p> 
    1010            <p>${XML(c.xml)}</p> 
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/wsgi/openid_provider.py

    r4122 r4123  
    178178        self._renderer.session = self.session 
    179179         
     180        # Strip trailing slashes 
     181        if self.path[-1] == '/': 
     182            self.path = self.path[:-1] 
     183             
    180184        # Match against the first level in the path only to allow for the 'id' 
    181185        # and 'yadis' cases where a sub-level could contain a user ID 
    182         if self.path.startswith(self.paths['path_id']) or \ 
     186        if self.path in (self.paths['path_id'], self.paths['path_yadis']): 
     187            log.debug("No user id given in URL %s" % self.path) 
     188            return self.app(environ, start_response) 
     189             
     190        elif self.path.startswith(self.paths['path_id']) or \ 
    183191           self.path.startswith(self.paths['path_yadis']): 
    184192             
  • TI12-security/trunk/python/ndg.security.server/setup.py

    r4020 r4123  
    3636 
    3737# Make a script interface to MyProxy client 
     38#_entryPoints = """ 
     39#    [console_scripts]  
     40#    myproxy-client=ndg.security.server.MyProxy:main 
     41#    init-credrepos-db=ndg.security.server.initCredReposDb:main 
     42# 
     43#    [paste.app_factory] 
     44#    main=ndg.security.server.sso.sso.config.middleware:make_app 
     45#    [paste.app_install] 
     46#    main=pylons.util:PylonsInstaller 
     47#    """ 
    3848_entryPoints = """ 
    3949    [console_scripts]  
     
    4252 
    4353    [paste.app_factory] 
    44     main=ndg.security.server.sso.sso.config.middleware:make_app 
     54    main=ndg.security.server.pylons.container.config.middleware:make_app 
    4555    [paste.app_install] 
    4656    main=pylons.util:PylonsInstaller 
    4757    """ 
    48  
    4958setup( 
    5059    name =                      'ndg_security_server', 
Note: See TracChangeset for help on using the changeset viewer.