Revision 8f377cd6 aai/middleware.py

b/aai/middleware.py
2 2
from django.conf import settings
3 3
from django.http import HttpResponse, HttpResponseRedirect
4 4
from synnefo.db.models import SynnefoUser
5
from synnefo.logic.shibboleth import Tokens, register_shibboleth_user
5
from synnefo.aai.shibboleth import Tokens, register_shibboleth_user
6 6
import time
7 7

  
8 8
class SynnefoAuthMiddleware(object):
......
85 85
                response['X-CDN-Management-Url'] = ""
86 86
            return response
87 87

  
88
        #No authentication info found in headers, redirect to Shibboleth
89
        return HttpResponseRedirect(settings.SHIBBOLETH_HOST)
88
        if settings.TESTING:
89
            if 'TEST-AAI' in request.META:
90
                return HttpResponseRedirect(settings.SHIBBOLETH_HOST)
91
        else:
92
            #No authentication info found in headers, redirect to Shibboleth
93
            return HttpResponseRedirect(settings.SHIBBOLETH_HOST)
90 94

  
91 95
    def process_response(self, request, response):
92 96
        #Tell proxies and other interested parties that the

Also available in: Unified diff