From 2475fa669a82c2ca028dded7b69ddd39d66926ca Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 5 May 2020 21:23:22 +1000 Subject: [PATCH] Raise a FutureWarning on use of client_{id,secret} (#1506) client_id and client_secret are sent to GitHub encoded on the query string, which GitHub has firmly deprecated, so much so as to email people who are doing so. To discourage its use, raise a FutureWarning if they are specified. Fixes #1500 --- github/MainClass.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/github/MainClass.py b/github/MainClass.py index 4602ce7a..b117a97f 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -51,6 +51,7 @@ import datetime import pickle import time +import warnings import jwt import requests @@ -132,6 +133,12 @@ class Github(object): or isinstance(retry, (int)) or isinstance(retry, (urllib3.util.Retry)) ) + if client_id is not None or client_secret is not None: + warnings.warn( + "client_id and client_secret are deprecated and will be removed in a future release, switch to token authentication", + FutureWarning, + stacklevel=2, + ) self.__requester = Requester( login_or_token, password,