mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-07 14:00:12 +08:00
Bump oauthlib to 3.3.* (#14300)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
version = "3.2.*"
|
||||
version = "3.3.*"
|
||||
upstream_repository = "https://github.com/oauthlib/oauthlib"
|
||||
partial_stub = true
|
||||
|
||||
|
||||
@@ -58,3 +58,8 @@ from .rfc6749.request_validator import RequestValidator as RequestValidator
|
||||
from .rfc6749.tokens import BearerToken as BearerToken, OAuth2Token as OAuth2Token
|
||||
from .rfc6749.utils import is_secure_transport as is_secure_transport
|
||||
from .rfc8628.clients import DeviceClient as DeviceClient
|
||||
from .rfc8628.endpoints import (
|
||||
DeviceApplicationServer as DeviceApplicationServer,
|
||||
DeviceAuthorizationEndpoint as DeviceAuthorizationEndpoint,
|
||||
)
|
||||
from .rfc8628.grant_types import DeviceCodeGrant as DeviceCodeGrant
|
||||
|
||||
@@ -2,6 +2,7 @@ from _typeshed import Unused
|
||||
from collections.abc import Callable
|
||||
|
||||
from oauthlib.common import Request
|
||||
from oauthlib.oauth2.rfc8628.grant_types import DeviceCodeGrant
|
||||
|
||||
from ..grant_types import (
|
||||
AuthorizationCodeGrant,
|
||||
@@ -24,6 +25,7 @@ class Server(AuthorizationEndpoint, IntrospectEndpoint, TokenEndpoint, ResourceE
|
||||
password_grant: ResourceOwnerPasswordCredentialsGrant
|
||||
credentials_grant: ClientCredentialsGrant
|
||||
refresh_grant: RefreshTokenGrant
|
||||
device_code_grant: DeviceCodeGrant
|
||||
bearer: BearerToken
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -44,3 +44,4 @@ def parse_token_response(
|
||||
body: str | bytes | bytearray, scope: str | set[object] | tuple[object] | list[object] | None = None
|
||||
) -> OAuth2Token: ...
|
||||
def validate_token_parameters(params: dict[str, Incomplete]) -> None: ...
|
||||
def parse_expires(params: dict[str, Incomplete]) -> tuple[int | None, float | None, float | None]: ...
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
from logging import Logger
|
||||
|
||||
from .errors import (
|
||||
AuthorizationPendingError as AuthorizationPendingError,
|
||||
ExpiredTokenError as ExpiredTokenError,
|
||||
SlowDownError as SlowDownError,
|
||||
)
|
||||
|
||||
log: Logger
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
from .device_authorization import DeviceAuthorizationEndpoint as DeviceAuthorizationEndpoint
|
||||
from .pre_configured import DeviceApplicationServer as DeviceApplicationServer
|
||||
@@ -0,0 +1,32 @@
|
||||
from collections.abc import Callable
|
||||
from logging import Logger
|
||||
|
||||
from oauthlib.common import Request, _HTTPMethod
|
||||
from oauthlib.oauth2.rfc6749.endpoints.base import BaseEndpoint
|
||||
from oauthlib.openid.connect.core.request_validator import RequestValidator
|
||||
|
||||
log: Logger
|
||||
|
||||
class DeviceAuthorizationEndpoint(BaseEndpoint):
|
||||
request_validator: RequestValidator
|
||||
user_code_generator: Callable[[None], str] | None
|
||||
def __init__(
|
||||
self,
|
||||
request_validator: RequestValidator,
|
||||
verification_uri: str,
|
||||
expires_in: int = 1800,
|
||||
interval: int | None = None,
|
||||
verification_uri_complete: str | None = None,
|
||||
user_code_generator: Callable[[None], str] | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def interval(self) -> int | None: ...
|
||||
@property
|
||||
def expires_in(self) -> int: ...
|
||||
@property
|
||||
def verification_uri(self) -> str: ...
|
||||
def verification_uri_complete(self, user_code: str) -> str | None: ...
|
||||
def validate_device_authorization_request(self, request: Request) -> None: ...
|
||||
def create_device_authorization_response(
|
||||
self, uri: str, http_method: _HTTPMethod = "POST", body: str | None = None, headers: dict[str, str] | None = None
|
||||
) -> tuple[dict[str, str], dict[str, str | int], int]: ...
|
||||
@@ -0,0 +1,16 @@
|
||||
from collections.abc import Callable
|
||||
|
||||
from oauthlib.openid.connect.core.request_validator import RequestValidator
|
||||
|
||||
from .device_authorization import DeviceAuthorizationEndpoint
|
||||
|
||||
class DeviceApplicationServer(DeviceAuthorizationEndpoint):
|
||||
def __init__(
|
||||
self,
|
||||
request_validator: RequestValidator,
|
||||
verification_uri: str,
|
||||
interval: int = 5,
|
||||
verification_uri_complete: str | None = None,
|
||||
user_code_generator: Callable[[None], str] | None = None,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
@@ -0,0 +1,13 @@
|
||||
from oauthlib.oauth2.rfc6749.errors import OAuth2Error
|
||||
|
||||
class AuthorizationPendingError(OAuth2Error):
|
||||
error: str
|
||||
|
||||
class SlowDownError(OAuth2Error):
|
||||
error: str
|
||||
|
||||
class ExpiredTokenError(OAuth2Error):
|
||||
error: str
|
||||
|
||||
class AccessDenied(OAuth2Error):
|
||||
error: str
|
||||
@@ -0,0 +1 @@
|
||||
from .device_code import DeviceCodeGrant as DeviceCodeGrant
|
||||
@@ -0,0 +1,8 @@
|
||||
from oauthlib.common import Request
|
||||
from oauthlib.oauth2.rfc6749.grant_types.base import GrantTypeBase
|
||||
from oauthlib.oauth2.rfc6749.tokens import TokenBase
|
||||
|
||||
class DeviceCodeGrant(GrantTypeBase):
|
||||
def create_authorization_response(self, request: Request, token_handler: TokenBase) -> tuple[dict[str, str], str, int]: ...
|
||||
def validate_token_request(self, request: Request) -> None: ...
|
||||
def create_token_response(self, request: Request, token_handler: TokenBase) -> tuple[dict[str, str], str, int]: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from oauthlib.common import Request
|
||||
from oauthlib.oauth2 import RequestValidator as OAuth2RequestValidator
|
||||
|
||||
class RequestValidator(OAuth2RequestValidator):
|
||||
def client_authentication_required(self, request: Request, *args, **kwargs) -> bool: ...
|
||||
@@ -18,6 +18,7 @@ from oauthlib.oauth2.rfc6749.grant_types import (
|
||||
)
|
||||
from oauthlib.oauth2.rfc6749.request_validator import RequestValidator as OAuth2RequestValidator
|
||||
from oauthlib.oauth2.rfc6749.tokens import BearerToken
|
||||
from oauthlib.oauth2.rfc8628.grant_types import DeviceCodeGrant
|
||||
|
||||
from ..grant_types import AuthorizationCodeGrant, HybridGrant, ImplicitGrant
|
||||
from ..grant_types.dispatchers import (
|
||||
@@ -37,6 +38,7 @@ class Server(AuthorizationEndpoint, IntrospectEndpoint, TokenEndpoint, ResourceE
|
||||
openid_connect_auth: AuthorizationCodeGrant
|
||||
openid_connect_implicit: ImplicitGrant
|
||||
openid_connect_hybrid: HybridGrant
|
||||
device_code_grant: DeviceCodeGrant
|
||||
bearer: BearerToken
|
||||
jwt: JWTToken
|
||||
auth_grant_choice: AuthorizationCodeGrantDispatcher
|
||||
|
||||
Reference in New Issue
Block a user