Skip to content

Commit d0483f4

Browse files
committed
Switched ALLOW_ANONYMOUS_POST to True by default.
- Also added warnings for potentially insecure configuration
1 parent 8b12ff8 commit d0483f4

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

codespeed/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
default_app_config = 'codespeed.apps.CodespeedConfig'

codespeed/apps.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from django.apps import AppConfig
2+
from django.conf import settings
3+
4+
5+
class CodespeedConfig(AppConfig):
6+
name = 'codespeed'
7+
8+
def ready(self):
9+
import warnings
10+
if settings.ALLOW_ANONYMOUS_POST:
11+
warnings.warn("Results can be posted by unregistered users")
12+
warnings.warn(
13+
"In the future anonymous posting will be disabled by default",
14+
category=FutureWarning)
15+
elif not settings.REQUIRE_SECURE_AUTH:
16+
warnings.warn(
17+
"REQUIRE_SECURE_AUTH is not True. This server may prompt for"
18+
" user credentials to be submitted in plaintext")

codespeed/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@
7070
USE_MEDIAN_BANDS = True # True to enable median bands on Timeline view
7171

7272

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

0 commit comments

Comments
 (0)