Skip to content

Commit

Permalink
Switched ALLOW_ANONYMOUS_POST to True by default.
Browse files Browse the repository at this point in the history
- Also added warnings for potentially insecure configuration
  • Loading branch information
mwatts15 committed Mar 1, 2017
1 parent 8b12ff8 commit d0483f4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions codespeed/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default_app_config = 'codespeed.apps.CodespeedConfig'
18 changes: 18 additions & 0 deletions codespeed/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from django.apps import AppConfig
from django.conf import settings


class CodespeedConfig(AppConfig):
name = 'codespeed'

def ready(self):
import warnings
if settings.ALLOW_ANONYMOUS_POST:
warnings.warn("Results can be posted by unregistered users")
warnings.warn(
"In the future anonymous posting will be disabled by default",
category=FutureWarning)
elif not settings.REQUIRE_SECURE_AUTH:
warnings.warn(
"REQUIRE_SECURE_AUTH is not True. This server may prompt for"
" user credentials to be submitted in plaintext")
2 changes: 1 addition & 1 deletion codespeed/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
USE_MEDIAN_BANDS = True # True to enable median bands on Timeline view


ALLOW_ANONYMOUS_POST = False # Whether anonymous users can post results
ALLOW_ANONYMOUS_POST = True # Whether anonymous users can post results
REQUIRE_SECURE_AUTH = True # Whether auth needs to be over a secure channel

0 comments on commit d0483f4

Please sign in to comment.