Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Python client for GitHub API
Note octokit and octokit.py were already taken in the cheese shop
::
pip install octokitpy
https://octokitpy.readthedocs.io/en/latest/
REST API::
from octokit import Octokit
repos = Octokit().repos.list_for_user(username="octokit")
for repo in repos.json:
print(repo["name"])
# Make an unauthenticated request for octokit's public repositories
Webhooks::
from octokit import webhook
webhook.verify(headers, payload, secret, events=['push'])
:code:octokit.py
provides a function to verify webhooks <https://developer.github.com/webhooks/>
_ sent to your application.
headers
dictionary of request headers
payload
string; payload of request
secret
string; secret provided to GitHub to sign webhook
events
list; events that you want to receive
verify_user_agent
boolean; whether or not you want to verify the user agent string of the request
return_app_id
boolean; whether or not you want to return the app id from the ping event for GitHub applications. This will only return the ``id`` if the event is the ``ping`` event. Otherwise the return value will be boolean.
Note that webhook names are available at :code:from octokit_routes import webhook_names
Instantiate a client with the authentication scheme and credentials that you want to use.
basic::
octokit = Octokit(auth='basic', username='myuser', password='mypassword')
token::
response = Octokit(auth='token', token='yak').authorization.get(id=100)
app::
octokit = Octokit(auth='app', app_id='42', private_key=private_key)
app installation::
octokit = Octokit(auth='installation', app_id='42', private_key=private_key)
For applications, provide the application id either from the ping webhook or the application's page on GitHub.
The :code:private_key
is a string of your private key provided for the application.
The :code:app
scheme will use the application id and private key to get a token for the first installation id of the application.
One can instantiate the Octokit
with routes=specification
where the specification
is one of api.github.com
, ghe-2.15
, etc.
The :code:octokit
client based on the available route data <https://github.com/khornberg/octokitpy-routes>
_ and webhook data <https://github.com/khornberg/octokitpy-routes>
_
::
[-] REST (see best practices, integration tests, and errors)
[ ] GraphQL client
[x] GitHub Apps
[ ] OAuth Apps
[x] Webhooks
::
[x] unit tests
[ ] integration tests - need fixtures to assert against
[x] coverage uploaded to code climate
::
[ ] Raise `OctokitValidationError` for param validation error
[ ] Raise `OctokitAuthenticationError` for auth error
[ ] Raise `OctokitRateLimitError` for rate limiting errors
::
[ ] throttling
[ ] handles rate limiting
[x] pagination
::
[ ] Auto generated documentation
::
[x] Deploy wheels
[ ] GitHub releases
Check box guide
::
[ ] Incomplete
[-] Partially completed
[x] Completed
To run the all tests run::
tox
Pull requests are very welcome!
Please see CONTRIBUTING.md for more information.
Package based on cookiecutter-pylibrary <https://github.com/ionelmc/cookiecutter-pylibrary>
_
MIT
Breaking changes
FAQs
Python client for GitHub API
We found that octokitpy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.