diff --git a/helios/models.py b/helios/models.py index be0fa2f79..76c993b2d 100644 --- a/helios/models.py +++ b/helios/models.py @@ -428,7 +428,7 @@ def set_eligibility(self): if self.voter_set.filter(user=None).count() > 0: voter_types.append('password') else: - # no password users, remove password from the possible helios_auth systems + # no password users, remove password from the possible auth systems if 'password' in auth_systems: auth_systems.remove('password') diff --git a/helios/templates/cast_done.html b/helios/templates/cast_done.html index 450d4ac98..14b61fbf9 100644 --- a/helios/templates/cast_done.html +++ b/helios/templates/cast_done.html @@ -19,7 +19,7 @@

{{election.name}} — Vote Successfully Cast!

{% if logout %}

For your safety, we have logged you out.

- {% endif %} diff --git a/helios/templates/election_bboard.html b/helios/templates/election_bboard.html index cff3d1a9c..d170e666c 100644 --- a/helios/templates/election_bboard.html +++ b/helios/templates/election_bboard.html @@ -39,7 +39,7 @@

{{election.name}} — Ballot Tracking Center {% if voter.name %}{{voter.name}}{% else %}{{voter.voter_id}}{% endif %} +{{voter.voter_type}} {% if voter.name %}{{voter.name}}{% else %}{{voter.voter_id}}{% endif %} {% endif %}{% if voter.vote_hash %}{{voter.vote_hash}} [view]{% else %}—{% endif %} {% endfor %} diff --git a/helios/templates/voters_list.html b/helios/templates/voters_list.html index 051d449dd..ce32bd122 100644 --- a/helios/templates/voters_list.html +++ b/helios/templates/voters_list.html @@ -127,7 +127,7 @@

{{election.name}} — Voters and Ballot Tracking Center email] [x] {% endif %} -{{voter.voter_type}} {{voter.name}} +{{voter.voter_type}} {{voter.name}} {% endif %} {% if election.use_voter_aliases %} {{voter.alias}} diff --git a/helios/tests.py b/helios/tests.py index 40be0f35e..3f1e63daa 100644 --- a/helios/tests.py +++ b/helios/tests.py @@ -465,7 +465,7 @@ def test_election_creation_not_logged_in(self): "use_advanced_audit_features": "1", "private_p" : "0"}) - self.assertRedirects(response, "/helios_auth/?return_url=/helios/elections/new") + self.assertRedirects(response, "/auth/?return_url=/helios/elections/new") def test_election_edit(self): # a bogus call to set up the session diff --git a/helios/views.py b/helios/views.py index c2cf8e32b..673e4a054 100644 --- a/helios/views.py +++ b/helios/views.py @@ -79,7 +79,7 @@ def get_socialbuttons_url(url, text): ## -## remote helios_auth utils +## remote auth utils def user_reauth(request, user): # FIXME: should we be wary of infinite redirects here, and diff --git a/helios_auth/__init__.py b/helios_auth/__init__.py index c9382b262..ca245ff38 100644 --- a/helios_auth/__init__.py +++ b/helios_auth/__init__.py @@ -3,7 +3,7 @@ TEMPLATE_BASE = settings.AUTH_TEMPLATE_BASE or "helios_auth/templates/base.html" -# enabled helios_auth systems +# enabled auth systems import auth_systems ENABLED_AUTH_SYSTEMS = settings.AUTH_ENABLED_AUTH_SYSTEMS or auth_systems.AUTH_SYSTEMS.keys() DEFAULT_AUTH_SYSTEM = settings.AUTH_DEFAULT_AUTH_SYSTEM or None diff --git a/helios_auth/auth_systems/facebook.py b/helios_auth/auth_systems/facebook.py index 53799e171..a6b6cecae 100644 --- a/helios_auth/auth_systems/facebook.py +++ b/helios_auth/auth_systems/facebook.py @@ -61,7 +61,7 @@ def get_user_info_after_auth(request): def update_status(user_id, user_info, token, message): """ - post a message to the helios_auth system's update stream, e.g. twitter stream + post a message to the auth system's update stream, e.g. twitter stream """ result = facebook_post('/me/feed', { 'access_token': token['access_token'], diff --git a/helios_auth/auth_systems/facebookclient/__init__.py b/helios_auth/auth_systems/facebookclient/__init__.py index b1cda2a4b..6e5e6ce92 100644 --- a/helios_auth/auth_systems/facebookclient/__init__.py +++ b/helios_auth/auth_systems/facebookclient/__init__.py @@ -126,8 +126,8 @@ class json(object): pass ], }, - # helios_auth methods - 'helios_auth': { + # auth methods + 'auth': { 'revokeAuthorization': [ ('uid', int, ['optional']), ], @@ -655,10 +655,10 @@ def __str__(self): class AuthProxy(AuthProxy): - """Special proxy for facebook.helios_auth.""" + """Special proxy for facebook.auth.""" def getSession(self): - """Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=helios_auth.getSession""" + """Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=auth.getSession""" args = {} try: args['auth_token'] = self._client.auth_token @@ -672,7 +672,7 @@ def getSession(self): return result def createToken(self): - """Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=helios_auth.createToken""" + """Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=auth.createToken""" token = self._client('%s.createToken' % self._name) self._client.auth_token = token return token @@ -829,7 +829,7 @@ class Facebook(object): to canvas pages. auth_token - The helios_auth token that Facebook gives you, either with facebook.helios_auth.createToken, + The auth token that Facebook gives you, either with facebook.auth.createToken, or through a GET parameter. callback_path @@ -882,7 +882,7 @@ class Facebook(object): Your application's secret key, as set in the constructor. session_key - The current session key. Set automatically by helios_auth.getSession, but can be set + The current session key. Set automatically by auth.getSession, but can be set manually for doing infinite sessions. session_key_expires @@ -890,7 +890,7 @@ class Facebook(object): uid After a session is created, you can get the user's UID with this variable. Set - automatically by helios_auth.getSession. + automatically by auth.getSession. ---------------------------------------------------------------------- @@ -902,15 +902,15 @@ def __init__(self, api_key, secret_key, auth_token=None, app_name=None, callback If this is a desktop application, the next couple of steps you might want to take are: - facebook.helios_auth.createToken() # create an helios_auth token + facebook.auth.createToken() # create an auth token facebook.login() # show a browser window wait_login() # somehow wait for the user to log in - facebook.helios_auth.getSession() # get a session key + facebook.auth.getSession() # get a session key For web apps, if you are passed an auth_token from Facebook, pass that in as a named parameter. Then call: - facebook.helios_auth.getSession() + facebook.auth.getSession() """ self.api_key = api_key @@ -1034,7 +1034,7 @@ def _add_session_args(self, args=None): if not self.session_key: return args #some calls don't need a session anymore. this might be better done in the markup - #raise RuntimeError('Session key not set. Make sure helios_auth.getSession has been called.') + #raise RuntimeError('Session key not set. Make sure auth.getSession has been called.') args['session_key'] = self.session_key args['call_id'] = str(int(time.time() * 1000)) @@ -1226,7 +1226,7 @@ def request_extended_permission(self, ext_perm, popup=False): def check_session(self, request): """ Checks the given Django HttpRequest for Facebook parameters such as - POST variables or an helios_auth token. If the session is valid, returns True + POST variables or an auth token. If the session is valid, returns True and this object can now be used to access the Facebook API. Otherwise, it returns False, and the application should take the appropriate action (either log the user in or have him add the application). @@ -1251,7 +1251,7 @@ def check_session(self, request): self.auth_token = request.GET['auth_token'] try: - self.helios_auth.getSession() + self.auth.getSession() except FacebookError, e: self.auth_token = None return False @@ -1396,7 +1396,7 @@ def validate_cookie_signature(self, cookies): facebook = Facebook(api_key, secret_key) - facebook.helios_auth.createToken() + facebook.auth.createToken() # Show login window # Set popup=True if you want login without navigational elements @@ -1406,7 +1406,7 @@ def validate_cookie_signature(self, cookies): print 'After logging in, press enter...' raw_input() - facebook.helios_auth.getSession() + facebook.auth.getSession() print 'Session Key: ', facebook.session_key print 'Your UID: ', facebook.uid diff --git a/helios_auth/auth_systems/facebookclient/djangofb/context_processors.py b/helios_auth/auth_systems/facebookclient/djangofb/context_processors.py index 551c4dff3..6f9543973 100644 --- a/helios_auth/auth_systems/facebookclient/djangofb/context_processors.py +++ b/helios_auth/auth_systems/facebookclient/djangofb/context_processors.py @@ -1,5 +1,5 @@ def messages(request): - """Returns messages similar to ``django.core.context_processors.helios_auth``.""" + """Returns messages similar to ``django.core.context_processors.auth``.""" if hasattr(request, 'facebook') and request.facebook.uid is not None: from models import Message messages = Message.objects.get_and_delete_all(uid=request.facebook.uid) diff --git a/helios_auth/auth_systems/facebookclient/webappfb.py b/helios_auth/auth_systems/facebookclient/webappfb.py index 5fdfe0f34..5fdf77af5 100644 --- a/helios_auth/auth_systems/facebookclient/webappfb.py +++ b/helios_auth/auth_systems/facebookclient/webappfb.py @@ -93,7 +93,7 @@ def initialize(self, request, response): return if not (require_app or require_login) and need_session: - self.facebook.helios_auth.getSession() + self.facebook.auth.getSession() def redirect(self, url, **kwargs): """ diff --git a/helios_auth/auth_systems/google.py b/helios_auth/auth_systems/google.py index 17325baf2..4a50f4403 100644 --- a/helios_auth/auth_systems/google.py +++ b/helios_auth/auth_systems/google.py @@ -21,7 +21,7 @@ # FIXME! # TRUST_ROOT = 'http://localhost:8000' -# RETURN_TO = 'http://localhost:8000/helios_auth/after' +# RETURN_TO = 'http://localhost:8000/auth/after' def get_auth_url(request, redirect_url): # FIXME?? TRUST_ROOT should be diff than return_url? diff --git a/helios_auth/auth_systems/linkedin.py b/helios_auth/auth_systems/linkedin.py index a54d82f54..69e3e9a08 100644 --- a/helios_auth/auth_systems/linkedin.py +++ b/helios_auth/auth_systems/linkedin.py @@ -76,7 +76,7 @@ def _get_client_by_request(request): def update_status(user_id, user_info, token, message): """ - post a message to the helios_auth system's update stream, e.g. twitter stream + post a message to the auth system's update stream, e.g. twitter stream """ return #twitter_client = _get_client_by_token(token) diff --git a/helios_auth/auth_systems/live.py b/helios_auth/auth_systems/live.py index aece51d90..6a1b20eb4 100644 --- a/helios_auth/auth_systems/live.py +++ b/helios_auth/auth_systems/live.py @@ -56,7 +56,7 @@ def get_user_info_after_auth(request): def update_status(user_id, user_info, token, message): """ - post a message to the helios_auth system's update stream, e.g. twitter stream + post a message to the auth system's update stream, e.g. twitter stream """ result = facebook_post('/me/feed', { 'access_token': token['access_token'], diff --git a/helios_auth/auth_systems/twitter.py b/helios_auth/auth_systems/twitter.py index 04ed4b890..343b55519 100644 --- a/helios_auth/auth_systems/twitter.py +++ b/helios_auth/auth_systems/twitter.py @@ -78,7 +78,7 @@ def _get_client_by_request(request): def update_status(user_id, user_info, token, message): """ - post a message to the helios_auth system's update stream, e.g. twitter stream + post a message to the auth system's update stream, e.g. twitter stream """ twitter_client = _get_client_by_token(token) result = twitter_client.oauth_request('http://api.twitter.com/1/statuses/update.json', args={'status': message}, method='POST') diff --git a/helios_auth/migrations/0001_initial.py b/helios_auth/migrations/0001_initial.py index bd39c99a0..4ba2a3a2b 100644 --- a/helios_auth/migrations/0001_initial.py +++ b/helios_auth/migrations/0001_initial.py @@ -9,7 +9,7 @@ class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'User' - db.create_table('auth_user', ( + db.create_table('helios_auth_user', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('user_type', self.gf('django.db.models.fields.CharField')(max_length=50)), ('user_id', self.gf('django.db.models.fields.CharField')(max_length=100)), @@ -21,16 +21,16 @@ def forwards(self, orm): db.send_create_signal('helios_auth', ['User']) # Adding unique constraint on 'User', fields ['user_type', 'user_id'] - db.create_unique('auth_user', ['user_type', 'user_id']) + db.create_unique('helios_auth_user', ['user_type', 'user_id']) def backwards(self, orm): # Removing unique constraint on 'User', fields ['user_type', 'user_id'] - db.delete_unique('auth_user', ['user_type', 'user_id']) + db.delete_unique('helios_auth_user', ['user_type', 'user_id']) # Deleting model 'User' - db.delete_table('auth_user') + db.delete_table('helios_auth_user') models = { diff --git a/helios_auth/models.py b/helios_auth/models.py index 81d0e69c6..d34b12970 100644 --- a/helios_auth/models.py +++ b/helios_auth/models.py @@ -104,11 +104,11 @@ def is_eligible_for(self, eligibility_case): if not eligibility_case.has_key('constraint'): return True - # from here on we know we match the helios_auth system, but do we match one of the constraints? + # from here on we know we match the auth system, but do we match one of the constraints? auth_system = AUTH_SYSTEMS[self.user_type] - # does the helios_auth system allow for checking a constraint? + # does the auth system allow for checking a constraint? if not hasattr(auth_system, 'check_constraint'): return False @@ -153,7 +153,7 @@ def _display_html(self, size): else: name_display = self.pretty_name - return """%s %s""" % ( + return """%s %s""" % ( str(int(size)), self.user_type, self.user_type, name_display) @property diff --git a/helios_auth/security/__init__.py b/helios_auth/security/__init__.py index c49a2df42..373c9dace 100644 --- a/helios_auth/security/__init__.py +++ b/helios_auth/security/__init__.py @@ -1,5 +1,5 @@ """ -Generic Security -- for the helios_auth system +Generic Security -- for the auth system Ben Adida (ben@adida.net) """ diff --git a/helios_auth/templates/login_box.html b/helios_auth/templates/login_box.html index 5b2d52bc3..bd85be018 100644 --- a/helios_auth/templates/login_box.html +++ b/helios_auth/templates/login_box.html @@ -6,7 +6,7 @@ {% else %}

-{{auth_system}} {{auth_system}} +{{auth_system}} {{auth_system}} {% endifequal %}

diff --git a/helios_auth/urls.py b/helios_auth/urls.py index 9dd3676c5..9db44e420 100644 --- a/helios_auth/urls.py +++ b/helios_auth/urls.py @@ -22,7 +22,7 @@ ## should make the following modular - # password helios_auth + # password auth (r'^password/login', password_login_view), (r'^password/forgot', password_forgotten_view), diff --git a/helios_auth/view_utils.py b/helios_auth/view_utils.py index 42d4e33c9..8e27cdfb3 100644 --- a/helios_auth/view_utils.py +++ b/helios_auth/view_utils.py @@ -32,8 +32,8 @@ def prepare_vars(request, vars): vars_with_user['csrf_token'] = request.session['csrf_token'] vars_with_user['SECURE_URL_HOST'] = settings.SECURE_URL_HOST - vars_with_user['STATIC'] = '/static/helios_auth' - vars_with_user['MEDIA_URL'] = '/static/helios_auth/' + vars_with_user['STATIC'] = '/static/auth' + vars_with_user['MEDIA_URL'] = '/static/auth/' vars_with_user['TEMPLATE_BASE'] = helios_auth.TEMPLATE_BASE vars_with_user['settings'] = settings @@ -45,7 +45,7 @@ def render_template(request, template_name, vars = {}): vars_with_user = prepare_vars(request, vars) - return render_to_response('helios_auth/templates/%s.html' % template_name, vars_with_user) + return render_to_response('auth/templates/%s.html' % template_name, vars_with_user) def render_template_raw(request, template_name, vars={}): t = loader.get_template(template_name + '.html') diff --git a/helios_auth/views.py b/helios_auth/views.py index 1249445b4..b85f82e79 100644 --- a/helios_auth/views.py +++ b/helios_auth/views.py @@ -29,7 +29,7 @@ def index(request): user = get_user(request) - # single helios_auth system? + # single auth system? if len(helios_auth.ENABLED_AUTH_SYSTEMS) == 1 and not user: return HttpResponseRedirect(reverse(start, args=[helios_auth.ENABLED_AUTH_SYSTEMS[0]])+ '?return_url=' + request.GET.get('return_url', '')) @@ -55,7 +55,7 @@ def login_box_raw(request, return_url='/', auth_systems = None): if helios_auth.DEFAULT_AUTH_SYSTEM: default_auth_system_obj = AUTH_SYSTEMS[helios_auth.DEFAULT_AUTH_SYSTEM] - # make sure that auth_systems includes only available and enabled helios_auth systems + # make sure that auth_systems includes only available and enabled auth systems if auth_systems != None: enabled_auth_systems = set(auth_systems).intersection(set(helios_auth.ENABLED_AUTH_SYSTEMS)).intersection(set(AUTH_SYSTEMS.keys())) else: @@ -109,7 +109,7 @@ def do_remote_logout(request, user, return_url="/"): # FIXME: do something with return_url auth_system = AUTH_SYSTEMS[user['type']] - # does the helios_auth system have a special logout procedure? + # does the auth system have a special logout procedure? user_for_remote_logout = request.session.get('user_for_remote_logout', None) del request.session['user_for_remote_logout'] if hasattr(auth_system, 'do_logout'): @@ -159,7 +159,7 @@ def start(request, system_name): # why is this here? Let's try without it # request.session.save() - # store in the session the name of the system used for helios_auth + # store in the session the name of the system used for auth request.session['auth_system_name'] = system_name # where to return to when done @@ -174,7 +174,7 @@ def perms_why(request): return _do_auth(request) def after(request): - # which helios_auth system were we using? + # which auth system were we using? if not request.session.has_key('auth_system_name'): do_local_logout(request) return HttpResponseRedirect("/") @@ -192,7 +192,7 @@ def after(request): else: return HttpResponseRedirect("%s?%s" % (reverse(perms_why), urllib.urlencode({'system_name' : request.session['auth_system_name']}))) - # does the helios_auth system want to present an additional view? + # does the auth system want to present an additional view? # this is, for example, to prompt the user to follow @heliosvoting # so they can hear about election results if hasattr(system, 'user_needs_intervention'): diff --git a/server_ui/glue.py b/server_ui/glue.py index f3af751db..bcb0995e1 100644 --- a/server_ui/glue.py +++ b/server_ui/glue.py @@ -37,7 +37,7 @@ def vote_cast_send_message(user, voter, election, cast_vote, **kwargs): %s """ % settings.SITE_TITLE - # send it via the notification system associated with the helios_auth system + # send it via the notification system associated with the auth system user.send_message(subject, body) helios.signals.vote_cast.connect(vote_cast_send_message) diff --git a/settings.py b/settings.py index 0170114a5..a1bfc89b4 100644 --- a/settings.py +++ b/settings.py @@ -68,7 +68,7 @@ def get_from_env(var, default): MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.helios_auth.middleware.AuthenticationMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'urls' @@ -80,7 +80,7 @@ def get_from_env(var, default): ) INSTALLED_APPS = ( -# 'django.contrib.helios_auth', +# 'django.contrib.auth', # 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', @@ -111,7 +111,7 @@ def get_from_env(var, default): DEFAULT_FROM_NAME = get_from_env('DEFAULT_FROM_NAME', 'Ben for Helios') SERVER_EMAIL = '%s <%s>' % (DEFAULT_FROM_NAME, DEFAULT_FROM_EMAIL) -LOGIN_URL = '/helios_auth/' +LOGIN_URL = '/auth/' LOGOUT_ON_CONFIRMATION = True # The two hosts are here so the main site can be over plain HTTP diff --git a/urls.py b/urls.py index 64e711d82..c69f6bab1 100644 --- a/urls.py +++ b/urls.py @@ -5,14 +5,14 @@ urlpatterns = patterns( '', - (r'^helios_auth/', include('helios_auth.urls')), + (r'^auth/', include('helios_auth.urls')), (r'^helios/', include('helios.urls')), # SHOULD BE REPLACED BY APACHE STATIC PATH (r'booth/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/heliosbooth'}), (r'verifier/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/heliosverifier'}), - (r'static/helios_auth/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/helios_auth/media'}), + (r'static/auth/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/helios_auth/media'}), (r'static/helios/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/helios/media'}), (r'static/(?P.*)$', 'django.views.static.serve', {'document_root' : settings.ROOT_PATH + '/server_ui/media'}),