Skip to content
Snippets Groups Projects
Commit ad5c20a3 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Added public url patterns in ligoauth/middlware/auth.py. Note: This is a...

Added public url patterns in ligoauth/middlware/auth.py. Note: This is a temporary hack to facilitate registration with InCommon.
parent 27f870d0
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,15 @@ from django.http import HttpResponseForbidden
proxyPattern = re.compile(r'^(.*?)(/CN=\d+)*$')
# XXX Hack. This will go away when we get the new perms infrastructure in place.
PUBLIC_URLS = [
'/',
'/SPInfo',
'/SPInfo/',
'/SPPrivacy',
'/SPPrivacy/',
]
def cert_dn_from_request(request):
"""Take a request, rummage through SSL_* headers, return the DN for the user."""
certdn = request.META.get('SSL_CLIENT_S_DN')
......@@ -79,7 +88,9 @@ class LigoAuthMiddleware:
request.user = user
if user is None:
# Check: Is the requested URL allowed for the PUBLIC?
#if user is None:
if user is None and request.path_info not in PUBLIC_URLS:
# Forbidden!
is_cli = request.POST.get('cli_version') or \
request.GET.get('cli_version')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment