diff options
author | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2010-04-03 21:56:39 -0600 |
---|---|---|
committer | Adolfo Fitoria <fitoria@fitoria-laptop.(none)> | 2010-04-03 21:56:39 -0600 |
commit | 388290fb2809fb024c20dbf7b033dbda0d7b7535 (patch) | |
tree | a3d1e63f52d4c3f22e3b4cc17d30fc4da75184c5 /forum/authentication/base.py | |
parent | 9911fa367920ada19b22db51ed787d38ec1499ed (diff) | |
download | askbot-388290fb2809fb024c20dbf7b033dbda0d7b7535.tar.gz askbot-388290fb2809fb024c20dbf7b033dbda0d7b7535.tar.bz2 askbot-388290fb2809fb024c20dbf7b033dbda0d7b7535.zip |
adding missing files?
Diffstat (limited to 'forum/authentication/base.py')
-rwxr-xr-x | forum/authentication/base.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/forum/authentication/base.py b/forum/authentication/base.py new file mode 100755 index 00000000..99005866 --- /dev/null +++ b/forum/authentication/base.py @@ -0,0 +1,44 @@ + +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 + + @classmethod + def readable_key(cls, key): + return key.key + +class InvalidAuthentication(Exception): + def __init__(self, message): + self.message = message + +
\ No newline at end of file |