Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 77 additions & 69 deletions docs/API.md

Large diffs are not rendered by default.

197 changes: 91 additions & 106 deletions minio/api.py

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions minio/commonconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,22 +466,22 @@ def build_headers(self, object_size: int, etag: str):
@property
def object_size(self) -> Optional[int]:
"""Get object size."""
if self.object_size is None:
if self._object_size is None:
raise MinioException(
"build_headers() must be called prior to "
"this method invocation",
)
return self.object_size
return self._object_size

@property
def headers(self) -> dict[str, str]:
"""Get headers."""
if self.headers is None:
if self._headers is None:
raise MinioException(
"build_headers() must be called prior to "
"this method invocation",
)
return self.headers.copy()
return self._headers.copy()

@classmethod
def of(cls: Type[F], src: ObjectConditionalReadArgs) -> F:
Expand Down
6 changes: 0 additions & 6 deletions minio/credentials/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class AssumeRoleProvider(Provider):

def __init__(
self,
*,
sts_endpoint: str,
access_key: str,
secret_key: str,
Expand Down Expand Up @@ -396,7 +395,6 @@ class IamAwsProvider(Provider):

def __init__(
self,
*,
custom_endpoint: Optional[str] = None,
http_client: Optional[PoolManager] = None,
auth_token: Optional[str] = None,
Expand Down Expand Up @@ -556,7 +554,6 @@ class LdapIdentityProvider(Provider):

def __init__(
self,
*,
sts_endpoint: str,
ldap_username: str,
ldap_password: str,
Expand Down Expand Up @@ -628,7 +625,6 @@ class WebIdentityClientGrantsProvider(Provider, ABC):

def __init__(
self,
*,
jwt_provider_func: Callable[[], dict[str, str]],
sts_endpoint: str,
duration_seconds: int = 0,
Expand Down Expand Up @@ -724,7 +720,6 @@ class ClientGrantsProvider(WebIdentityClientGrantsProvider):

def __init__(
self,
*,
jwt_provider_func: Callable[[], dict[str, str]],
sts_endpoint: str,
duration_seconds: int = 0,
Expand Down Expand Up @@ -755,7 +750,6 @@ class CertificateIdentityProvider(Provider):

def __init__(
self,
*,
sts_endpoint: str,
cert_file: Optional[str] = None,
key_file: Optional[str] = None,
Expand Down
5 changes: 0 additions & 5 deletions minio/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ def update(self, length: int):


def read_part_data(
*,
stream: BinaryIO,
size: int,
part_data: bytes = b"",
Expand Down Expand Up @@ -436,7 +435,6 @@ def sha256_hash(data: Optional[str | bytes]) -> str:


def url_replace(
*,
url: urllib.parse.SplitResult,
scheme: Optional[str] = None,
netloc: Optional[str] = None,
Expand Down Expand Up @@ -678,7 +676,6 @@ def virtual_style_flag(self, flag: bool):
@classmethod
def _build_aws_url(
cls,
*,
aws_info: dict,
url: urllib.parse.SplitResult,
bucket_name: Optional[str],
Expand Down Expand Up @@ -742,7 +739,6 @@ def _build_list_buckets_url(

def build(
self,
*,
method: str,
region: str,
bucket_name: Optional[str] = None,
Expand Down Expand Up @@ -820,7 +816,6 @@ class ObjectWriteResult:
@classmethod
def new(
cls: Type[ObjectWriteResult],
*,
headers: HTTPHeaderDict,
bucket_name: str,
object_name: str,
Expand Down
4 changes: 0 additions & 4 deletions minio/minioadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class MinioAdmin:

def __init__(
self,
*,
endpoint: str,
credentials: Provider,
region: str = "",
Expand Down Expand Up @@ -163,7 +162,6 @@ def __del__(self):

def _url_open(
self,
*,
method: str,
command: _COMMAND,
query_params: Optional[HTTPQueryDict] = None,
Expand Down Expand Up @@ -789,7 +787,6 @@ def list_service_account(self, user: str) -> str:
return plain_data.decode()

def add_service_account(self,
*,
access_key: Optional[str] = None,
secret_key: Optional[str] = None,
name: Optional[str] = None,
Expand Down Expand Up @@ -842,7 +839,6 @@ def add_service_account(self,
return plain_data.decode()

def update_service_account(self,
*,
access_key: str,
secret_key: Optional[str] = None,
name: Optional[str] = None,
Expand Down
5 changes: 0 additions & 5 deletions minio/signer.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def _get_authorization(


def _sign_v4(
*,
service_name: str,
method: str,
url: SplitResult,
Expand Down Expand Up @@ -213,7 +212,6 @@ def _sign_v4(


def sign_v4_s3(
*,
method: str,
url: SplitResult,
region: str,
Expand All @@ -236,7 +234,6 @@ def sign_v4_s3(


def sign_v4_sts(
*,
method: str,
url: SplitResult,
region: str,
Expand All @@ -259,7 +256,6 @@ def sign_v4_sts(


def _get_presign_canonical_request_hash( # pylint: disable=invalid-name
*,
method: str,
url: SplitResult,
access_key: str,
Expand Down Expand Up @@ -304,7 +300,6 @@ def _get_presign_canonical_request_hash( # pylint: disable=invalid-name


def presign_v4(
*,
method: str,
url: SplitResult,
region: str,
Expand Down
4 changes: 4 additions & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ bad-names=foo,bar,baz,toto,tutu,tata
# Maximum number of arguments for function / method
max-args=12

# Maximum number of positional arguments for function / method
# We allow more than the default 5 for backwards compatibility
max-positional-arguments=16

# Maximum number of locals for function / method body
max-locals=30

Expand Down
Loading