aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/gui/views.py
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2013-01-31 01:14:56 +0000
committerMichael Elkins <melkins@tislabs.com>2013-01-31 01:14:56 +0000
commit7f49d94068077fabfab83307c3f648b710ab369d (patch)
tree7cba90e23df1c22e0cedaa586f716a7fb0c2889a /rpkid/rpki/gui/views.py
parentef13cddc2f03d9e97d700e57454e164bfa6a4815 (diff)
parente065bbc64b4dc3fc51387eb5275ece174baf8242 (diff)
merging /branches/tk401
svn path=/trunk/; revision=4986
Diffstat (limited to 'rpkid/rpki/gui/views.py')
-rw-r--r--rpkid/rpki/gui/views.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/rpkid/rpki/gui/views.py b/rpkid/rpki/gui/views.py
new file mode 100644
index 00000000..5c62cf62
--- /dev/null
+++ b/rpkid/rpki/gui/views.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2013 SPARTA, Inc. a Parsons Company
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND SPARTA DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS. IN NO EVENT SHALL SPARTA BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+__version__ = '$Id$'
+
+import django.contrib.auth.views
+from rpki.gui.decorators import tls_required
+
+
+@tls_required
+def login(request, *args, **kwargs):
+ "Wrapper around django.contrib.auth.views.login to force use of TLS."
+ return django.contrib.auth.views.login(request, *args, **kwargs)
+
+
+@tls_required
+def logout(request, *args, **kwargs):
+ "Wrapper around django.contrib.auth.views.logout to force use of TLS."
+ return django.contrib.auth.views.login(request, *args, **kwargs)