-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched ALLOW_ANONYMOUS_POST to True by default.
- Also added warnings for potentially insecure configuration
- Loading branch information
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default_app_config = 'codespeed.apps.CodespeedConfig' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters