mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Add authentication classes, move auth logic there (#2528)
This adds argument `auth` and deprecates `login_or_token`, `password`, `jwt`, and `app_auth` arguments of `github.Github`. This adds argument `auth` and deprecates `integration_id`, `private_key` of `github.GithubIntegration`. This deprecates the `create_jwt` method of `github.GithubIntegration`, replaced by `github.Auth.AppAuth.create_jwt`.
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
from typing import Union, Optional, Dict
|
||||
|
||||
from github.Auth import AppAuth
|
||||
from github.Installation import Installation
|
||||
from github.InstallationAuthorization import InstallationAuthorization
|
||||
from github.PaginatedList import PaginatedList
|
||||
from github.Requester import Requester
|
||||
|
||||
class GithubIntegration:
|
||||
integration_id: Union[int, str] = ...
|
||||
private_key: str = ...
|
||||
auth: AppAuth = ...
|
||||
base_url: str = ...
|
||||
jwt_expiry: int = ...
|
||||
jwt_issued_at: int = ...
|
||||
__requester: Requester = ...
|
||||
def __init__(
|
||||
self,
|
||||
integration_id: Union[int, str],
|
||||
private_key: str,
|
||||
integration_id: Optional[Union[int, str]] = ...,
|
||||
private_key: Optional[str] = ...,
|
||||
base_url: str = ...,
|
||||
jwt_expiry: int = ...,
|
||||
jwt_issued_at: int = ...,
|
||||
jwt_algorithm: str = ...,
|
||||
auth: Optional[AppAuth] = ...,
|
||||
) -> None: ...
|
||||
def _get_installed_app(self, url: str) -> Installation: ...
|
||||
def _get_headers(self) -> Dict[str, str]: ...
|
||||
|
||||
Reference in New Issue
Block a user