Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support for authenticating updates from github #4

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

junkafarian
Copy link
Contributor

No description provided.

@@ -163,7 +161,9 @@ def update_pull_data(self, pull, data):
def accept_github_update():
""" View for github web hooks to handle updates
"""
# TODO: verify request is from github
update_secret = app.config.get('GITHUB_UPDATE_SECRET')
if update_secret and request.args.get('secret') != update_secret:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to be paranoid we could use werkzeug.security.safe_str_cmp: ("This function compares strings in somewhat constant time.")

@davidszotten
Copy link
Contributor

👍

@davidszotten
Copy link
Contributor

can we have a test for this?

On branch update-secret
Your branch is up-to-date with 'origin/update-secret'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

	modified:   tests/conftest.py
	new file:   tests/test_github.py
Conflicts:
	cinch/github.py
	tests/conftest.py
	tests/test_github.py
@davidszotten
Copy link
Contributor

does this make use of https://developer.github.com/webhooks/securing/?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants