Skip to content

Commit

Permalink
Only apply ip filtering when valid ips list are configured in gitlab …
Browse files Browse the repository at this point in the history
…and bitbucket hooks
  • Loading branch information
jespino authored and bameda committed Dec 2, 2014
1 parent edcb186 commit 1518758
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion taiga/hooks/bitbucket/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _validate_signature(self, project, request):

valid_origin_ips = project.modules_config.config.get("bitbucket", {}).get("valid_origin_ips", settings.BITBUCKET_VALID_ORIGIN_IPS)
origin_ip = get_real_ip(request)
if not origin_ip or not origin_ip in valid_origin_ips:
if valid_origin_ips and (not origin_ip or not origin_ip in valid_origin_ips):
return False

return project_secret == secret_key
Expand Down
2 changes: 1 addition & 1 deletion taiga/hooks/gitlab/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _validate_signature(self, project, request):

valid_origin_ips = project.modules_config.config.get("gitlab", {}).get("valid_origin_ips", settings.GITLAB_VALID_ORIGIN_IPS)
origin_ip = get_real_ip(request)
if not origin_ip or origin_ip not in valid_origin_ips:
if valid_origin_ips and (not origin_ip or origin_ip not in valid_origin_ips):
return False

return project_secret == secret_key
Expand Down

0 comments on commit 1518758

Please sign in to comment.