diff --git a/gvm/protocols/gmp/_gmpnext.py b/gvm/protocols/gmp/_gmpnext.py index ebc994ac..362f0a4a 100644 --- a/gvm/protocols/gmp/_gmpnext.py +++ b/gvm/protocols/gmp/_gmpnext.py @@ -532,7 +532,8 @@ def get_active_directory_objects( or "group". Defaults to "ou", "computer", and "group". Duplicates are ignored, preserving first-occurrence order. max_results: Maximum number of objects to fetch after LDAP - filtering, from 1 to 1000. Omit to use the server default. + filtering. Must be a positive integer within the server's + configured limit. Omit to use that limit. include_disabled_computers: Include disabled computers. Defaults to True. targets: Include matching targets for computers. Defaults to False. diff --git a/gvm/protocols/gmp/requests/next/_active_directory.py b/gvm/protocols/gmp/requests/next/_active_directory.py index 103cad63..21b99a3f 100644 --- a/gvm/protocols/gmp/requests/next/_active_directory.py +++ b/gvm/protocols/gmp/requests/next/_active_directory.py @@ -66,7 +66,8 @@ def get_active_directory_objects( or "group". Defaults to "ou", "computer", and "group". Duplicates are ignored, preserving first-occurrence order. max_results: Maximum number of objects to fetch after LDAP - filtering, from 1 to 1000. Omit to use the server default. + filtering. Must be a positive integer within the server's + configured limit. Omit to use that limit. include_disabled_computers: Include disabled computers. Defaults to True. targets: Include matching targets for computers. Defaults to False. @@ -134,7 +135,7 @@ def get_active_directory_objects( if max_results is not None and ( isinstance(max_results, bool) or not isinstance(max_results, int) - or not 1 <= max_results <= 1000 + or max_results < 1 ): raise InvalidArgument( function=cls.get_active_directory_objects.__name__, diff --git a/tests/protocols/gmpnext/entities/active_directory/test_get_active_directory_objects.py b/tests/protocols/gmpnext/entities/active_directory/test_get_active_directory_objects.py index 5c7c9a88..b79471e4 100644 --- a/tests/protocols/gmpnext/entities/active_directory/test_get_active_directory_objects.py +++ b/tests/protocols/gmpnext/entities/active_directory/test_get_active_directory_objects.py @@ -289,11 +289,6 @@ def test_get_active_directory_objects_with_invalid_max_results(self): credential_id="credential-id", max_results=0 ) - with self.assertRaises(InvalidArgument): - self.gmp.get_active_directory_objects( - credential_id="credential-id", max_results=1001 - ) - with self.assertRaises(InvalidArgument): self.gmp.get_active_directory_objects( credential_id="credential-id", max_results="10"