Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Helios Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Helios Server
Commits
dae3ae3f
Commit
dae3ae3f
authored
13 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
check for 404 in security checks
parent
a427cdef
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
helios/security.py
+4
-0
4 additions, 0 deletions
helios/security.py
helios/tests.py
+4
-0
4 additions, 0 deletions
helios/tests.py
with
8 additions
and
0 deletions
helios/security.py
+
4
−
0
View file @
dae3ae3f
...
@@ -9,6 +9,7 @@ from functools import update_wrapper
...
@@ -9,6 +9,7 @@ from functools import update_wrapper
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
django.core.exceptions
import
*
from
django.core.exceptions
import
*
from
django.http
import
*
from
django.conf
import
settings
from
django.conf
import
settings
from
models
import
*
from
models
import
*
...
@@ -92,6 +93,9 @@ def election_view(**checks):
...
@@ -92,6 +93,9 @@ def election_view(**checks):
def
election_view_wrapper
(
request
,
election_uuid
=
None
,
*
args
,
**
kw
):
def
election_view_wrapper
(
request
,
election_uuid
=
None
,
*
args
,
**
kw
):
election
=
get_election_by_uuid
(
election_uuid
)
election
=
get_election_by_uuid
(
election_uuid
)
if
not
election
:
raise
Http404
# do checks
# do checks
do_election_checks
(
election
,
checks
)
do_election_checks
(
election
,
checks
)
...
...
This diff is collapsed.
Click to expand it.
helios/tests.py
+
4
−
0
View file @
dae3ae3f
...
@@ -390,6 +390,10 @@ class ElectionBlackboxTests(WebTest):
...
@@ -390,6 +390,10 @@ class ElectionBlackboxTests(WebTest):
response
=
self
.
client
.
get
(
"
/helios/elections/params
"
)
response
=
self
.
client
.
get
(
"
/helios/elections/params
"
)
self
.
assertEquals
(
response
.
content
,
views
.
ELGAMAL_PARAMS_LD_OBJECT
.
serialize
())
self
.
assertEquals
(
response
.
content
,
views
.
ELGAMAL_PARAMS_LD_OBJECT
.
serialize
())
def
test_election_404
(
self
):
response
=
self
.
client
.
get
(
"
/helios/elections/foobar
"
)
self
.
assertEquals
(
response
.
status_code
,
404
)
def
test_election_bad_trustee
(
self
):
def
test_election_bad_trustee
(
self
):
response
=
self
.
client
.
get
(
"
/helios/t/%s/foobar@bar.com/badsecret
"
%
self
.
election
.
short_name
)
response
=
self
.
client
.
get
(
"
/helios/t/%s/foobar@bar.com/badsecret
"
%
self
.
election
.
short_name
)
self
.
assertEquals
(
response
.
status_code
,
404
)
self
.
assertEquals
(
response
.
status_code
,
404
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment