Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
For OS X dev, fixing dependency conflicts (swig/m2crypto) and disabli…
Browse files Browse the repository at this point in the history
…ng csrf protection and CORS
  • Loading branch information
Patrick Kelley committed Aug 21, 2015
1 parent 828f4d7 commit e633cd4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion env-config/config-local.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
MAIL_USERNAME = 'username'
MAIL_PASSWORD = 'password'

WTF_CSRF_ENABLED = True
WTF_CSRF_ENABLED = False
WTF_CSRF_SSL_STRICT = True # Checks Referer Header. Set to False for API access.
WTF_CSRF_METHODS = ['DELETE', 'POST', 'PUT', 'PATCH']

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ python-dateutil==2.2
python-memcached==1.53
PyYAML==3.11
requests==2.2.1
py-bcrypt==0.4
bcrypt==2.0.0
Sphinx==1.2.2
gunicorn==18.0
M2Crypto==0.22.3
M2Crypto==0.21.1
boto3==0.0.11
dpath==1.3.2
jira==0.32
2 changes: 2 additions & 0 deletions security_monkey/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def crossdomain(allowed_origins=None, methods=None, headers=None,

def get_origin(allowed_origins):
origin = request.headers.get("Origin", None)
if origin and current_app.config.get('DEBUG', False):
return origin
if origin and origin in allowed_origins:
return origin
return None
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
'python-dateutil==2.2',
'python-memcached==1.53',
'requests==2.2.1',
'py-bcrypt==0.4',
'bcrypt==2.0.0',
'Sphinx==1.2.2',
'gunicorn==18.0',
'M2Crypto==0.22.3',
'M2Crypto==0.21.1',
'boto3==0.0.11',
'dpath==1.3.2',
'pyyaml==3.11',
Expand Down

0 comments on commit e633cd4

Please sign in to comment.