Index: /main/waeup.cas/trunk/waeup/cas/server.py
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/server.py	(revision 10350)
+++ /main/waeup.cas/trunk/waeup/cas/server.py	(revision 10351)
@@ -2,4 +2,5 @@
 """
 import os
+import tempfile
 from webob import exc, Response
 from webob.dec import wsgify
@@ -10,5 +11,24 @@
 class CASServer(object):
     """A WSGI CAS server.
+
+    This CAS server stores credential data (tickets, etc.) in a local
+    sqlite3 database file.
+
+    `db_path` -
+       The filesystem path to the database to use. If none is given
+       CAS server will create a new one in some new, temporary
+       directory. Please note that credentials will be lost after a
+       CAS server restart.
+
+       If the path is given and the file exists already, it will be
+       used.
+
+       If the database file does not exist, it will be created.
     """
+    def __init__(self, db_path=None):
+        if db_path is None:
+            db_path = os.path.join(tempfile.mkdtemp(), 'cas.db')
+        self.db_path = db_path
+
     @wsgify
     def __call__(self, req):
Index: /main/waeup.cas/trunk/waeup/cas/tests/sample2.ini
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/tests/sample2.ini	(revision 10351)
+++ /main/waeup.cas/trunk/waeup/cas/tests/sample2.ini	(revision 10351)
@@ -0,0 +1,3 @@
+# A sample config to run WSGI components with paster
+[app:main]
+use = egg:waeup.cas#server
Index: /main/waeup.cas/trunk/waeup/cas/tests/test_server.py
===================================================================
--- /main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10350)
+++ /main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10351)
@@ -38,4 +38,17 @@
         assert isinstance(app, CASServer)
 
+    def test_init(self):
+        # we get a db dir set automatically
+        app = CASServer()
+        assert hasattr(app, 'db_path')
+        assert app.db_path is not None
+        assert os.path.exists(os.path.dirname(app.db_path))
+
+    def test_init_explicit_db_path(self):
+        # we can set a db_path explicitly
+        app = CASServer(db_path=self.db_path)
+        assert hasattr(app, 'db_path')
+        assert app.db_path == self.db_path
+
     def test_call_root(self):
         # the CAS protocol requires no root
