move constant NONCE_FIELD_NAME in module authentic.constants [module reorg]

This commit is contained in:
Benjamin Dauvergne 2014-02-12 14:07:14 +01:00
parent 2aa09a65c8
commit c651f6854a
7 changed files with 8 additions and 8 deletions

View File

@ -1 +0,0 @@
NONCE_FIELD_NAME = 'nonce'

View File

@ -7,7 +7,7 @@ from django_authopenid.utils import *
from django.core.urlresolvers import reverse
import authentic2.auth2_auth.models as models
from authentic2.auth2_auth import NONCE_FIELD_NAME
from authentic2.constants import NONCE_FIELD_NAME
from views import ask_openid, signin_failure
import views

View File

@ -3,7 +3,7 @@ import urllib
from django.utils.translation import gettext_noop
from django.http import HttpResponseRedirect
from django.contrib.auth import REDIRECT_FIELD_NAME
from authentic2.auth2_auth import NONCE_FIELD_NAME
from authentic2.constants import NONCE_FIELD_NAME
from authentic2.auth2_auth.auth2_ssl.login_ssl import *
import django.forms

View File

@ -18,7 +18,7 @@ from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import authenticate, login
from django.contrib.auth import REDIRECT_FIELD_NAME
from authentic2.auth2_auth import NONCE_FIELD_NAME
from authentic2.constants import NONCE_FIELD_NAME
from models import ClientCertificate
from util import SSLInfo

2
authentic2/constants.py Normal file
View File

@ -0,0 +1,2 @@
NONCE_FIELD_NAME = 'nonce'

View File

@ -67,7 +67,7 @@ from authentic2.saml.common import redirect_next, asynchronous_bindings, \
import authentic2.saml.saml2utils as saml2utils
from authentic2.auth2_auth.models import AuthenticationEvent
from common import redirect_to_login, kill_django_sessions
from authentic2.auth2_auth import NONCE_FIELD_NAME
from authentic2.constants import NONCE_FIELD_NAME
from authentic2.idp import signals as idp_signals
# from authentic2.idp.models import *

View File

@ -33,10 +33,9 @@ from django.contrib.auth.decorators import login_required
# FIXME: this decorator has nothing to do with an idp, should be moved in the
# a2 package
# FIXME: this constant should be moved in the a2 package
from authentic2.auth2_auth import NONCE_FIELD_NAME
from . import utils, app_settings, forms, compat, decorators
from . import utils, app_settings, forms, compat, decorators, constants
logger = logging.getLogger(__name__)
@ -234,7 +233,7 @@ def login(request, template_name='auth/login.html',
# question mark.
elif '//' in redirect_to and re.match(r'[^\?]*//', redirect_to):
redirect_to = settings.LOGIN_REDIRECT_URL
nonce = request.REQUEST.get(NONCE_FIELD_NAME)
nonce = request.REQUEST.get(constants.NONCE_FIELD_NAME)
frontends = utils.get_backends('AUTH_FRONTENDS')