Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions 2 .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
dist: xenial
language: python
python:
- "2.7"
- "3.6"
- "3.7"
- "pypy"
- "pypy3"
install:
- pip install tox-travis
Expand Down
2 changes: 1 addition & 1 deletion 2 github_webhook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:license: Apache License, Version 2.0
"""

from github_webhook.webhook import Webhook # noqa
from github_webhook.webhook import Webhook

# -----------------------------------------------------------------------------
# Copyright 2015 Bloomberg Finance L.P.
Expand Down
7 changes: 3 additions & 4 deletions 7 github_webhook/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import hmac
import logging
import json
import six
from flask import abort, request


Expand Down Expand Up @@ -35,7 +34,7 @@ def secret(self):

@secret.setter
def secret(self, secret):
if secret is not None and not isinstance(secret, six.binary_type):
if secret is not None and not isinstance(secret, bytes):
secret = secret.encode("utf-8")
self._secret = secret

Expand Down Expand Up @@ -65,8 +64,8 @@ def _postreceive(self):

if digest is not None:
sig_parts = _get_header("X-Hub-Signature").split("=", 1)
if not isinstance(digest, six.text_type):
digest = six.text_type(digest)
if not isinstance(digest, str):
digest = str(digest)

if len(sig_parts) < 2 or sig_parts[0] != "sha1" or not hmac.compare_digest(sig_parts[1], digest):
abort(400, "Invalid signature")
Expand Down
7 changes: 3 additions & 4 deletions 7 setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
author_email="achamberlai9@bloomberg.net, fphillips7@bloomberg.net, dkiss1@bloomberg.net, dbeer1@bloomberg.net",
license="Apache 2.0",
packages=["github_webhook"],
install_requires=["flask", "six"],
tests_require=["mock", "pytest"],
python_requires=">=3.6",
install_requires=["flask>=1.0.2"],
tests_require=["pytest"],
classifiers=[
"Development Status :: 4 - Beta",
"Framework :: Flask",
Expand All @@ -21,9 +22,7 @@
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Software Development :: Version Control",
],
test_suite="nose.collector",
)
6 changes: 2 additions & 4 deletions 6 tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
[tox]
envlist = py27,py36,py37,pypy,pypy3,flake8
envlist = py36,py37,pypy3,flake8

[testenv]
deps =
pytest
pytest-cov
flask
six
py{27,py}: mock
commands = pytest -vl --cov=github_webhook --cov-report term-missing --cov-fail-under 100
commands = pytest -vl --cov=github_webhook --cov-report term-missing --cov-fail-under 98

[testenv:flake8]
deps = flake8
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.