Merge pull request #1021 from rigaspapas/implement-apps-oauth-endpoints

Implement OAuth for apps
This commit is contained in:
Jannis Gebauer
2020-07-20 11:51:32 +02:00
committed by GitHub
11 changed files with 352 additions and 3 deletions
+10
View File
@@ -29,6 +29,7 @@
# Copyright 2018 sfdye <tsfdye@gmail.com> #
# Copyright 2018 itsbruce <it.is.bruce@gmail.com> #
# Copyright 2019 Tomas Tomecek <tomas@tomecek.net> #
# Copyright 2019 Rigas Papathanasopoulos <rigaspapas@gmail.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
@@ -57,6 +58,7 @@ import jwt
import requests
import urllib3
import github.ApplicationOAuth
import github.Event
import github.Gist
import github.GithubObject
@@ -778,6 +780,14 @@ class Github(object):
self.__requester, headers={}, attributes={"id": id}, completed=True
)
def get_oauth_application(self, client_id, client_secret):
return github.ApplicationOAuth.ApplicationOAuth(
self.__requester,
headers={},
attributes={"client_id": client_id, "client_secret": client_secret},
completed=False,
)
class GithubIntegration(object):
"""