summaryrefslogtreecommitdiffstats
path: root/forum/authentication/base.py
diff options
context:
space:
mode:
authorhrcerqueira <hrcerqueira@gmail.com>2010-03-01 17:37:32 +0000
committerhrcerqueira <hrcerqueira@gmail.com>2010-03-01 17:37:32 +0000
commitd01a3ff31d96aaedd9ce8ba38cb5d0cde53584fc (patch)
treebc5cd0632fdb2edbde77a5ea0db2be4cdeaedc59 /forum/authentication/base.py
parent0d29fc79deba22027187ae4627a7c38b3fdef2e4 (diff)
downloadaskbot-d01a3ff31d96aaedd9ce8ba38cb5d0cde53584fc.tar.gz
askbot-d01a3ff31d96aaedd9ce8ba38cb5d0cde53584fc.tar.bz2
askbot-d01a3ff31d96aaedd9ce8ba38cb5d0cde53584fc.zip
New auth system, see the wiki for details.
Diffstat (limited to 'forum/authentication/base.py')
-rwxr-xr-xforum/authentication/base.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/forum/authentication/base.py b/forum/authentication/base.py
new file mode 100755
index 00000000..995f7c96
--- /dev/null
+++ b/forum/authentication/base.py
@@ -0,0 +1,40 @@
+
+class AuthenticationConsumer(object):
+
+ def prepare_authentication_request(self, request, redirect_to):
+ raise NotImplementedError()
+
+ def process_authentication_request(self, response):
+ raise NotImplementedError()
+
+ def get_user_data(self, key):
+ raise NotImplementedError()
+
+
+class ConsumerTemplateContext(object):
+ """
+ Class that provides information about a certain authentication provider context in the signin page.
+
+ class attributes:
+
+ mode - one of BIGICON, SMALLICON, FORM
+
+ human_name - the human readable name of the provider
+
+ extra_js - some providers require us to load extra javascript on the signin page for them to work,
+ this is the place to add those files in the form of a list
+
+ extra_css - same as extra_js but for css files
+ """
+ mode = ''
+ weight = 500
+ human_name = ''
+ extra_js = []
+ extra_css = []
+ show_to_logged_in_user = True
+
+class InvalidAuthentication(Exception):
+ def __init__(self, message):
+ self.message = message
+
+ \ No newline at end of file