From 7fe8f4e8ea9c199471240908c2a4588cd9b9b9e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:05:51 +0000 Subject: [PATCH 1/3] Bump urllib3 from 2.0.6 to 2.0.7 Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.0.6 to 2.0.7. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.0.6...2.0.7) --- updated-dependencies: - dependency-name: urllib3 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0720b3c4..3c0ca30a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1067,13 +1067,13 @@ files = [ [[package]] name = "urllib3" -version = "2.0.6" +version = "2.0.7" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.7" files = [ - {file = "urllib3-2.0.6-py3-none-any.whl", hash = "sha256:7a7c7003b000adf9e7ca2a377c9688bbc54ed41b985789ed576570342a375cd2"}, - {file = "urllib3-2.0.6.tar.gz", hash = "sha256:b19e1a85d206b56d7df1d5e683df4a7725252a964e3993648dd0fb5a1c157564"}, + {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, + {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, ] [package.extras] From be23eb06fbe3800ebd1f560c5c5d6f89c2d1d306 Mon Sep 17 00:00:00 2001 From: Adam Mcgrath Date: Thu, 19 Oct 2023 11:56:57 +0100 Subject: [PATCH 2/3] Add fields to all_organization_members --- auth0/management/organizations.py | 16 +++++++++++- auth0/test/management/test_organizations.py | 27 +++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/auth0/management/organizations.py b/auth0/management/organizations.py index 940aef7c..dabaf6c6 100644 --- a/auth0/management/organizations.py +++ b/auth0/management/organizations.py @@ -246,9 +246,14 @@ def all_organization_members( include_totals: bool = True, from_param: str | None = None, take: int | None = None, + fields: list[str] | None = None, + include_fields: bool = True, ): """Retrieves a list of all the organization members. + Member roles are not sent by default. Use `fields=roles` to retrieve the roles assigned to each listed member. + To use this parameter, you must include the `read:organization_member_roles scope` in the token. + Args: id (str): the ID of the organization. @@ -267,7 +272,14 @@ def all_organization_members( take (int, optional): The total amount of entries to retrieve when using the from parameter. When not set, the default value is up to the server. - See: https://auth0.com/docs/api/management/v2#!/Organizations/get_members + fields (list of str, optional): A list of fields to include or + exclude from the result (depending on include_fields). If fields is left blank, + all fields (except roles) are returned. + + include_fields (bool, optional): True if the fields specified are + to be included in the result, False otherwise. Defaults to True. + + See: https://auth0.com/docs/api/management/v2/organizations/get-members """ params = { @@ -276,6 +288,8 @@ def all_organization_members( "include_totals": str(include_totals).lower(), "from": from_param, "take": take, + "fields": fields and ",".join(fields) or None, + "include_fields": str(include_fields).lower(), } return self.client.get(self._url(id, "members"), params=params) diff --git a/auth0/test/management/test_organizations.py b/auth0/test/management/test_organizations.py index a445ebfd..ec1fc84b 100644 --- a/auth0/test/management/test_organizations.py +++ b/auth0/test/management/test_organizations.py @@ -232,6 +232,8 @@ def test_all_organization_members(self, mock_rc): "include_totals": "true", "from": None, "take": None, + "fields": None, + "include_fields": "true", }, ) @@ -253,6 +255,8 @@ def test_all_organization_members(self, mock_rc): "include_totals": "false", "from": None, "take": None, + "fields": None, + "include_fields": "true", }, ) @@ -272,6 +276,29 @@ def test_all_organization_members(self, mock_rc): "page": None, "per_page": None, "include_totals": "true", + "fields": None, + "include_fields": "true", + }, + ) + + # With fields + c.all_organization_members("test-org", fields=["a,b"], include_fields=False) + + args, kwargs = mock_instance.get.call_args + + self.assertEqual( + "https://domain/api/v2/organizations/test-org/members", args[0] + ) + self.assertEqual( + kwargs["params"], + { + "page": None, + "per_page": None, + "include_totals": "true", + "from": None, + "take": None, + "fields": "a,b", + "include_fields": "false", }, ) From f81ab0cf54079c26b6f3d3f0544f617a6327be2e Mon Sep 17 00:00:00 2001 From: Adam Mcgrath Date: Fri, 20 Oct 2023 13:49:08 +0100 Subject: [PATCH 3/3] Release 4.5.0 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a74b0b4e..e9cc1da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [4.5.0](https://github.com/auth0/auth0-python/tree/4.5.0) (2023-10-20) +[Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.2...4.5.0) + +**Added** +- [SDK-4656] Add fields to all_organization_members [\#537](https://github.com/auth0/auth0-python/pull/537) ([adamjmcgrath](https://github.com/adamjmcgrath)) + ## [4.4.2](https://github.com/auth0/auth0-python/tree/4.4.2) (2023-08-31) [Full Changelog](https://github.com/auth0/auth0-python/compare/4.4.1...4.4.2)