Is the above code incorrect? it let me access
htt://localhost:8080/Admin/Auth without any identification...

"""
import turbogears
from turbogears import controllers

from turbogears.toolbox.catwalk import CatWalk

import turbogears.identity.model.somodel
from turbogears import identity

class Root(controllers.RootController):
    @turbogears.expose(template="wgstock.templates.welcome")
    def index(self):
        import time
        return dict(now=time.ctime())

    class Admin(controllers.Controller, identity.SecureResource):
        required_groups= ["admin"]
        identity_required= True

        Auth = CatWalk(turbogears.identity.model.somodel)
"""

Some log:
"""
2006/01/06 11:35:06 HTTP INFO Serving HTTP on http://localhost:8080/
2006/01/06 11:35:08 HTTP INFO 127.0.0.1 - GET / HTTP/1.1
2006-01-06 11:35:08,750 turbogears.identity INFO Retrieving identity
from reques
t
2006-01-06 11:35:08,750 turbogears.identity DEBUG Retrieving identity
from form
2006-01-06 11:35:08,750 turbogears.identity DEBUG Request didn't
contain form fi
elds for identity credentials
2006-01-06 11:35:08,765 turbogears.identity DEBUG Checking for identity
cookie
2006-01-06 11:35:08,765 turbogears.identity DEBUG Identity cookie not
found
2006-01-06 11:35:08,765 turbogears.identity DEBUG Checking for HTTP
Auth
2006-01-06 11:35:08,765 turbogears.identity DEBUG HTTP Auth header not
found
2006-01-06 11:35:08,765 turbogears.identity WARNING No identity found
2006-01-06 11:35:08,765 turbogears.identity INFO Creating anonymous
identity
2006-01-06 11:35:08,828 turbogears.kidsupport DEBUG Recompiling
template for tur
bogears.fastdata.templates.sitetemplate
2006-01-06 11:35:08,842 turbogears.kidsupport DEBUG Recompiling
template for wgs
tock.templates.welcome
2006-01-06 11:35:08,842 turbogears.kidsupport DEBUG Applying template
wgstock.te
mplates.welcome
127.0.0.1 - - [2006/01/06 11:35:08] "GET / HTTP/1.1" 200 1692
2006/01/06 11:35:56 HTTP INFO 127.0.0.1 - GET /Admin/Auth HTTP/1.1
2006-01-06 11:35:56,905 turbogears.identity INFO Retrieving identity
from reque
t
2006-01-06 11:35:56,905 turbogears.identity DEBUG Retrieving identity
from form
2006-01-06 11:35:56,905 turbogears.identity DEBUG Request didn't
contain form f
elds for identity credentials
2006-01-06 11:35:56,905 turbogears.identity DEBUG Checking for identity
cookie
2006-01-06 11:35:56,905 turbogears.identity DEBUG Identity cookie not
found
2006-01-06 11:35:56,905 turbogears.identity DEBUG Checking for HTTP
Auth
2006-01-06 11:35:56,905 turbogears.identity DEBUG HTTP Auth header not
found
2006-01-06 11:35:56,905 turbogears.identity WARNING No identity found
2006-01-06 11:35:56,905 turbogears.identity INFO Creating anonymous
identity
127.0.0.1 - - [2006/01/06 11:35:56] "GET /Admin/Auth HTTP/1.1" 302 167
2006/01/06 11:35:56 HTTP INFO 127.0.0.1 - GET /Admin/Auth/ HTTP/1.1
"""

Reply via email to