]> sipb.mit.edu Git - snippets/.git/log
snippets/.git
10 years agoScripts auth: don't activate on 127.0.0.1 either
Alex Dehnert [Sun, 7 Jul 2013 04:27:57 +0000 (00:27 -0400)] 
Scripts auth: don't activate on 127.0.0.1 either

The scripts auth module has long delegated to the standard Django auth when the
hostname was localhost, in order to ignore local dev server instances. This
makes it also delegate to standard Django for 127.0.0.1 as well.  I'm not sure
why this hadn't come up before now... A quick look at the Django codebase
suggests this isn't a recent change.

11 years agoUse API function instead of UNUSABLE_PASSWORD
Alex Dehnert [Mon, 24 Dec 2012 08:39:49 +0000 (03:39 -0500)] 
Use API function instead of UNUSABLE_PASSWORD

Yay abstractions, or something.

11 years agoSet a password of UNUSABLE_PASSWORD
Alex Dehnert [Mon, 24 Dec 2012 08:28:00 +0000 (03:28 -0500)] 
Set a password of UNUSABLE_PASSWORD

* Changes ScriptsRemoteUserBackend's configure_user method to set the default
  password to UNUSABLE_PASSWORD instead of ScriptsSSLAuth. UNUSABLE_PASSWORD
  displays in the admin as "Password: None", instead of an ugly error message.
  This should fix "Unknown password hashing algorithm" errors for users
  correctly created in the future. (ASA-#132)

* Adds a migration to change current users with passwords of "" or
  "ScriptsSSLAuth" to a password of UNUSABLE_PASSWORD ("!"). This will fix
  ASA-#132 and the symptoms of ASA-#133 for already-existent users.

11 years agokinit when creating a MoiraList object
Alex Dehnert [Mon, 17 Sep 2012 06:08:56 +0000 (02:08 -0400)] 
kinit when creating a MoiraList object

This allows group/diffs.py to work without kinit'ing outside the script, fixing
the key deficiency in ac9b167bcf85a9f723e27967649c2c033f2259da.

11 years agoWrappers for safely calling commands in a new PAG
Alex Dehnert [Sun, 16 Sep 2012 01:53:40 +0000 (21:53 -0400)] 
Wrappers for safely calling commands in a new PAG

The usual mechanism for starting a new PAG is pagsh(1). Unfortunately, because
it basically just execvp(3) /bin/sh passing the appropriate arguments, it isn't
immediately obvious how to safely pass arguments that may contain shell
metacharacters. By using the shell's exec and taking advantage of the fact that
later arguments to /bin/sh end up in $@ we can safely avoid shell
metacharacters. We wrap subprocess.check_{call,output} in
pag_check_{call,output}, which perform appropriate contortions to establish the
PAG before safely executing the passed commands without evaluating any
metacharacters.

11 years agoValidate constitution_url (ASA-#76)
Alex Dehnert [Mon, 10 Sep 2012 08:50:40 +0000 (04:50 -0400)] 
Validate constitution_url (ASA-#76)

12 years agoDjango MIT plugin: Don't crash on users with hidden emails (ASA Trac: #63)
Geoffrey Thomas [Tue, 24 Jan 2012 06:57:01 +0000 (01:57 -0500)] 
Django MIT plugin: Don't crash on users with hidden emails (ASA Trac: #63)

12 years agoFunction to create an MIT user with LDAP data
Alex Dehnert [Sun, 18 Dec 2011 05:49:59 +0000 (00:49 -0500)] 
Function to create an MIT user with LDAP data

This adds a function get_or_create_mit_user. As with the "get_or_create"
methods on managers, this returns an object satisfying some conditions,
creating it if necessary. In this case, we return a User object that's
populated using data from MIT's LDAP. If the user does not exist and
cannot be found in LDAP, we raise an exception.

12 years agoScripts auth: Use ldap-too for LDAP server
Alex Dehnert [Tue, 25 Oct 2011 16:25:33 +0000 (12:25 -0400)] 
Scripts auth: Use ldap-too for LDAP server

Apparently it includes email addresses for people who have suppressed it,
unlike ldap.mit.edu.

12 years agoMerge "upstream" fixes from SIPB's snippets
Alex Dehnert [Mon, 6 Jun 2011 07:10:15 +0000 (03:10 -0400)] 
Merge "upstream" fixes from SIPB's snippets

13 years agolocalhost check needs to use portless-HTTP_HOST
Alex Dehnert [Sun, 30 May 2010 02:34:45 +0000 (22:34 -0400)] 
localhost check needs to use portless-HTTP_HOST

As a bonus, this gets around the problem that the Django dev server doesn't
set REQUEST_URI.

13 years agoAdd scripts_login, to do cert login if possible
Alex Dehnert [Sun, 30 May 2010 01:10:59 +0000 (21:10 -0400)] 
Add scripts_login, to do cert login if possible

13 years agoShamelessly lift MIT-specific code from Remit
Alex Dehnert [Thu, 13 May 2010 09:58:47 +0000 (05:58 -0400)] 
Shamelessly lift MIT-specific code from Remit