Hi everyone, i've seen this entry on the book:
http://web2py.com/books/default/chapter/29/9?search=wsgi#Using-web2py-to-authorize-non-web2py-apps
but
i think that it needs to have an active session on the web application, and
I need something a little more complex
I need to ask from a wsgi script if a user is in the system
(authenthorization) and if that user has access (authorization) to the SVN
or DAV resource.
I have followed some recipes and i have this
In apache:
# Work around authz and SVNListParentPath issue
RedirectMatch ^(/svntest)$ $1/
# Enable Subversion logging
#CustomLog logs/svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
<Location /svntest/>
# Enable Subversion
DAV svn
# Directory containing all repository for this path
SVNParentPath /home/demetrio/www/svn_test
# Enable repository listing when browing the Location root
SVNListParentPath On
AuthType Basic
AuthName "User required"
AuthBasicProvider wsgi
WSGIAuthUserScript /home/demetrio/www/wsgi_svn_script/wsgi.py
WSGIAccessScript /home/demetrio/www/wsgi_svn_script/wsgi.py
Require valid-user
</Location>
And in the wsgi script (following the instructions of
http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms):
#Authentication
def check_password(environ, user, password):
if user == 'user':
if password == 'pass':
return True
return False
return None
#Authorization
def allow_access(environ, host):
#test condition
if environ['REQUEST_URI'] == '/svntest/project1':
return True
else:
return False
Now the question, somebody knows how to connect the wsgi script with my
application?
Thanks in advance