Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-minio for openSUSE:Factory checked in at 2025-01-12 11:14:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-minio (Old) and /work/SRC/openSUSE:Factory/.python-minio.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-minio" Sun Jan 12 11:14:18 2025 rev:22 rq:1236181 version:7.2.14 Changes: -------- --- /work/SRC/openSUSE:Factory/python-minio/python-minio.changes 2024-12-05 17:11:17.144238989 +0100 +++ /work/SRC/openSUSE:Factory/.python-minio.new.1881/python-minio.changes 2025-01-12 11:19:57.136736085 +0100 @@ -1,0 +2,10 @@ +Wed Jan 8 15:02:42 UTC 2025 - Yunus Acar <[email protected]> + +- Update to 7.2.14: + * MinioAdmin: add IDP/LDAP attach/detach/list APIs by @balamurugana in #1470 + * MinioAdmin: add {attach,detach}_policy and get_policy_entities APIs by @balamurugana in #1471 +- Update to 7.2.13: + * Add NewerNoncurrentVersions in LifecycleConfig by @balamurugana in #1469 + * IamAwsProvider: fix url with role name by @balamurugana in #1465 + +------------------------------------------------------------------- Old: ---- minio-7.2.12.tar.gz New: ---- minio-7.2.14.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-minio.spec ++++++ --- /var/tmp/diff_new_pack.Gfhpiz/_old 2025-01-12 11:19:57.556753361 +0100 +++ /var/tmp/diff_new_pack.Gfhpiz/_new 2025-01-12 11:19:57.556753361 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-minio # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-minio -Version: 7.2.12 +Version: 7.2.14 Release: 0 Summary: Minio library for Amazon S3 compatible cloud storage License: Apache-2.0 ++++++ minio-7.2.12.tar.gz -> minio-7.2.14.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/PKG-INFO new/minio-7.2.14/PKG-INFO --- old/minio-7.2.12/PKG-INFO 2024-11-26 01:50:27.701191000 +0100 +++ new/minio-7.2.14/PKG-INFO 2025-01-06 10:30:42.938953000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: minio -Version: 7.2.12 +Version: 7.2.14 Summary: MinIO Python SDK for Amazon S3 Compatible Cloud Storage Home-page: https://github.com/minio/minio-py Download-URL: https://github.com/minio/minio-py/releases diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/minio/__init__.py new/minio-7.2.14/minio/__init__.py --- old/minio-7.2.12/minio/__init__.py 2024-11-26 01:48:56.000000000 +0100 +++ new/minio-7.2.14/minio/__init__.py 2025-01-06 10:29:11.000000000 +0100 @@ -33,7 +33,7 @@ __title__ = "minio-py" __author__ = "MinIO, Inc." -__version__ = "7.2.12" +__version__ = "7.2.14" __license__ = "Apache 2.0" __copyright__ = "Copyright 2015, 2016, 2017, 2018, 2019, 2020 MinIO, Inc." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/minio/credentials/providers.py new/minio-7.2.14/minio/credentials/providers.py --- old/minio-7.2.12/minio/credentials/providers.py 2024-11-26 01:48:56.000000000 +0100 +++ new/minio-7.2.14/minio/credentials/providers.py 2025-01-06 10:29:11.000000000 +0100 @@ -505,21 +505,17 @@ headers = {"X-aws-ec2-metadata-token": token} if token else None # Get role name - res = _urlopen( - self._http_client, - "GET", - urlunsplit( - url_replace( - urlsplit(url), - path="/latest/meta-data/iam/security-credentials/", - ), + url = urlunsplit( + url_replace( + urlsplit(url), + path="/latest/meta-data/iam/security-credentials/", ), - headers=headers, ) + res = _urlopen(self._http_client, "GET", url, headers=headers) role_names = res.data.decode("utf-8").split("\n") if not role_names: raise ValueError(f"no IAM roles attached to EC2 service {url}") - url += "/" + role_names[0].strip("\r") + url += role_names[0].strip("\r") if not url: raise ValueError("url is empty; this should not happen") self._credentials = self.fetch(url, headers=headers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/minio/lifecycleconfig.py new/minio-7.2.14/minio/lifecycleconfig.py --- old/minio-7.2.12/minio/lifecycleconfig.py 2024-11-26 01:48:56.000000000 +0100 +++ new/minio-7.2.14/minio/lifecycleconfig.py 2025-01-06 10:29:11.000000000 +0100 @@ -118,9 +118,11 @@ self, noncurrent_days: int | None = None, storage_class: str | None = None, + newer_noncurrent_versions: int | None = None, ): self._noncurrent_days = noncurrent_days self._storage_class = storage_class + self._newer_noncurrent_versions = newer_noncurrent_versions @property def noncurrent_days(self) -> int | None: @@ -132,6 +134,11 @@ """Get storage class.""" return self._storage_class + @property + def newer_noncurrent_versions(self) -> int | None: + """Get Newer Noncurrent versions.""" + return self._newer_noncurrent_versions + @classmethod def fromxml(cls: Type[B], element: ET.Element) -> B: """Create new object with values from XML element.""" @@ -140,9 +147,11 @@ find(element, "NoncurrentVersionTransition", True), ) noncurrent_days = findtext(element, "NoncurrentDays") + versions = findtext(element, "NewerNoncurrentVersions") return cls( int(noncurrent_days) if noncurrent_days else None, findtext(element, "StorageClass"), + int(versions) if versions else None, ) def toxml(self, element: ET.Element | None) -> ET.Element: @@ -154,6 +163,9 @@ SubElement(element, "NoncurrentDays", str(self._noncurrent_days)) if self._storage_class: SubElement(element, "StorageClass", self._storage_class) + if self._newer_noncurrent_versions: + SubElement(element, "NewerNoncurrentVersions", + str(self._newer_noncurrent_versions)) return element @@ -163,14 +175,21 @@ class NoncurrentVersionExpiration: """Noncurrent version expiration.""" - def __init__(self, noncurrent_days: int | None = None): + def __init__(self, noncurrent_days: int | None = None, + newer_noncurrent_versions: int | None = None): self._noncurrent_days = noncurrent_days + self._newer_noncurrent_versions = newer_noncurrent_versions @property def noncurrent_days(self) -> int | None: """Get Noncurrent days.""" return self._noncurrent_days + @property + def newer_noncurrent_versions(self) -> int | None: + """Get Newer Noncurrent versions.""" + return self._newer_noncurrent_versions + @classmethod def fromxml(cls: Type[C], element: ET.Element) -> C: """Create new object with values from XML element.""" @@ -179,7 +198,9 @@ find(element, "NoncurrentVersionExpiration", True), ) noncurrent_days = findtext(element, "NoncurrentDays") - return cls(int(noncurrent_days) if noncurrent_days else None) + versions = findtext(element, "NewerNoncurrentVersions") + return cls(int(noncurrent_days) if noncurrent_days else None, + int(versions) if versions else None) def toxml(self, element: ET.Element | None) -> ET.Element: """Convert to XML.""" @@ -188,6 +209,9 @@ element = SubElement(element, "NoncurrentVersionExpiration") if self._noncurrent_days: SubElement(element, "NoncurrentDays", str(self._noncurrent_days)) + if self._newer_noncurrent_versions: + SubElement(element, "NewerNoncurrentVersions", + str(self._newer_noncurrent_versions)) return element diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/minio/minioadmin.py new/minio-7.2.14/minio/minioadmin.py --- old/minio-7.2.12/minio/minioadmin.py 2024-11-26 01:48:56.000000000 +0100 +++ new/minio-7.2.14/minio/minioadmin.py 2025-01-06 10:29:11.000000000 +0100 @@ -62,7 +62,6 @@ SET_USER_OR_GROUP_POLICY = "set-user-or-group-policy" LIST_CANNED_POLICIES = "list-canned-policies" REMOVE_CANNED_POLICY = "remove-canned-policy" - UNSET_USER_OR_GROUP_POLICY = "idp/builtin/policy/detach" CANNED_POLICY_INFO = "info-canned-policy" SET_BUCKET_QUOTA = "set-bucket-quota" GET_BUCKET_QUOTA = "get-bucket-quota" @@ -94,6 +93,13 @@ SERVICE_ACCOUNT_ADD = "add-service-account" SERVICE_ACCOUNT_UPDATE = "update-service-account" SERVICE_ACCOUNT_DELETE = "delete-service-account" + IDP_LDAP_POLICY_ATTACH = "idp/ldap/policy/attach" + IDP_LDAP_POLICY_DETACH = "idp/ldap/policy/detach" + IDP_LDAP_LIST_ACCESS_KEYS = "idp/ldap/list-access-keys" + IDP_LDAP_LIST_ACCESS_KEYS_BULK = "idp/ldap/list-access-keys-bulk" + IDP_BUILTIN_POLICY_ATTACH = "idp/builtin/policy/attach" + IDP_BUILTIN_POLICY_DETACH = "idp/builtin/policy/detach" + IDP_BUILTIN_POLICY_ENTITIES = "idp/builtin/policy-entities" def _safe_str(value: Any) -> str: @@ -472,7 +478,7 @@ def policy_set( self, - policy_name: str | list[str], + policy_name: str, user: str | None = None, group: str | None = None, ) -> str: @@ -495,29 +501,9 @@ group: str | None = None, ) -> str: """Unset an IAM policy for a user or group.""" - if (user is not None) ^ (group is not None): - policies = ( - policy_name if isinstance(policy_name, list) else [policy_name] - ) - data: dict[str, str | list[str]] = {"policies": policies} - if user: - data["user"] = user - if group: - data["group"] = group - response = self._url_open( - "POST", - _COMMAND.UNSET_USER_OR_GROUP_POLICY, - body=encrypt( - json.dumps(data).encode(), - self._provider.retrieve().secret_key, - ), - preload_content=False, - ) - plain_data = decrypt( - response, self._provider.retrieve().secret_key, - ) - return plain_data.decode() - raise ValueError("either user or group must be set") + return self.detach_policy( + policy_name if isinstance(policy_name, list) else [policy_name], + user, group) def config_get(self, key: str | None = None) -> str: """Get configuration parameters.""" @@ -842,3 +828,123 @@ query_params={"accessKey": access_key}, ) return response.data.decode() + + def _attach_detach_policy( + self, + command: _COMMAND, + policies: list[str], + user: str | None = None, + group: str | None = None, + ) -> str: + """Attach or detach policies for builtin or LDAP.""" + if (user is not None) ^ (group is not None): + key = "user" if user else "group" + body = json.dumps( + {"policies": policies, + key: cast(str, user or group)}, + ).encode() + response = self._url_open( + "POST", + command, + body=encrypt(body, self._provider.retrieve().secret_key), + ) + return response.data.decode() + raise ValueError("either user or group must be set") + + def attach_policy_ldap( + self, + policies: list[str], + user: str | None = None, + group: str | None = None, + ) -> str: + """Attach policies for LDAP.""" + return self._attach_detach_policy( + _COMMAND.IDP_LDAP_POLICY_ATTACH, policies, user, group, + ) + + def detach_policy_ldap( + self, + policies: list[str], + user: str | None = None, + group: str | None = None, + ) -> str: + """Detach policies for LDAP.""" + return self._attach_detach_policy( + _COMMAND.IDP_LDAP_POLICY_DETACH, policies, user, group, + ) + + def list_access_keys_ldap( + self, + user_dn: str, + list_type: str, + ) -> str: + """List service accounts belonging to the specified user.""" + response = self._url_open( + "GET", _COMMAND.IDP_LDAP_LIST_ACCESS_KEYS, + query_params={"userDN": user_dn, "listType": list_type}, + preload_content=False, + ) + plain_data = decrypt( + response, self._provider.retrieve().secret_key, + ) + return plain_data.decode() + + def list_access_keys_ldap_bulk( + self, + users: list[str], + list_type: str, + all_users: bool, + ) -> str: + """List access keys belonging to the given users or all users.""" + if len(users) != 0 and all_users: + raise ValueError("both users and all_users are not permitted") + + key, value = ("all", "true") if all_users else ("userDNs", users) + response = self._url_open( + "GET", _COMMAND.IDP_LDAP_LIST_ACCESS_KEYS_BULK, + query_params={"listType": list_type, key: value}, + preload_content=False, + ) + plain_data = decrypt( + response, self._provider.retrieve().secret_key, + ) + return plain_data.decode() + + def attach_policy( + self, + policies: list[str], + user: str | None = None, + group: str | None = None, + ) -> str: + """Attach builtin policies.""" + return self._attach_detach_policy( + _COMMAND.IDP_BUILTIN_POLICY_ATTACH, policies, user, group, + ) + + def detach_policy( + self, + policies: list[str], + user: str | None = None, + group: str | None = None, + ) -> str: + """Detach builtin policies.""" + return self._attach_detach_policy( + _COMMAND.IDP_BUILTIN_POLICY_DETACH, policies, user, group, + ) + + def get_policy_entities( + self, + users: list[str], + groups: list[str], + policies: list[str], + ) -> str: + """Get builtin policy entities.""" + response = self._url_open( + "GET", _COMMAND.IDP_BUILTIN_POLICY_ENTITIES, + query_params={"user": users, "group": groups, "policy": policies}, + preload_content=False, + ) + plain_data = decrypt( + response, self._provider.retrieve().secret_key, + ) + return plain_data.decode() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/minio-7.2.12/minio.egg-info/PKG-INFO new/minio-7.2.14/minio.egg-info/PKG-INFO --- old/minio-7.2.12/minio.egg-info/PKG-INFO 2024-11-26 01:50:26.000000000 +0100 +++ new/minio-7.2.14/minio.egg-info/PKG-INFO 2025-01-06 10:30:42.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: minio -Version: 7.2.12 +Version: 7.2.14 Summary: MinIO Python SDK for Amazon S3 Compatible Cloud Storage Home-page: https://github.com/minio/minio-py Download-URL: https://github.com/minio/minio-py/releases
