|
31 | 31 | from io import BytesIO
|
32 | 32 | from random import random
|
33 | 33 | from threading import Thread
|
34 |
| -from typing import BinaryIO |
| 34 | +from typing import BinaryIO, TextIO |
35 | 35 | from urllib.parse import urlunsplit
|
36 | 36 | from xml.etree import ElementTree as ET
|
37 | 37 |
|
38 | 38 | import certifi
|
39 | 39 | import urllib3
|
| 40 | +from urllib3 import PoolManager |
40 | 41 | from urllib3._collections import HTTPHeaderDict
|
41 | 42 |
|
42 | 43 | from . import __title__, __version__, time
|
43 | 44 | from .commonconfig import COPY, REPLACE, ComposeSource, CopySource, Tags
|
44 | 45 | from .credentials import StaticProvider
|
| 46 | +from .credentials.providers import Provider |
45 | 47 | from .datatypes import (CompleteMultipartUploadResult, EventIterable,
|
46 | 48 | ListAllMyBucketsResult, ListMultipartUploadsResult,
|
47 | 49 | ListPartsResult, Object, Part, PostPolicy,
|
@@ -113,16 +115,26 @@ class Minio: # pylint: disable=too-many-public-methods
|
113 | 115 | object in each process, and not share it between processes.
|
114 | 116 |
|
115 | 117 | """
|
| 118 | + _region_map: dict[str, str] |
| 119 | + _base_url: BaseURL |
| 120 | + _user_agent: str |
| 121 | + _trace_stream: TextIO | None |
| 122 | + _provider: Provider | None |
| 123 | + _http: PoolManager |
116 | 124 |
|
117 | 125 | # pylint: disable=too-many-function-args
|
118 |
| - def __init__(self, endpoint, access_key=None, |
119 |
| - secret_key=None, |
120 |
| - session_token=None, |
121 |
| - secure=True, |
122 |
| - region=None, |
123 |
| - http_client=None, |
124 |
| - credentials=None, |
125 |
| - cert_check=True): |
| 126 | + def __init__( |
| 127 | + self, |
| 128 | + endpoint: str, |
| 129 | + access_key: str | None = None, |
| 130 | + secret_key: str | None = None, |
| 131 | + session_token: str | None = None, |
| 132 | + secure: bool = True, |
| 133 | + region: str | None = None, |
| 134 | + http_client: urllib3.PoolManager | None = None, |
| 135 | + credentials: Provider | None = None, |
| 136 | + cert_check: bool = True |
| 137 | + ): |
126 | 138 | # Validate http client has correct base class.
|
127 | 139 | if http_client and not isinstance(
|
128 | 140 | http_client,
|
|
0 commit comments