diff --git a/core/database_arango.py b/core/database_arango.py index 7d5e074cd..530b02491 100644 --- a/core/database_arango.py +++ b/core/database_arango.py @@ -953,7 +953,7 @@ def filter( else: aql_string += "\nRETURN o" aql_args["@collection"] = colname - print(f"aql_string: {aql_string}, aql_args: {aql_args}") + logging.debug(f"aql_string: {aql_string}, aql_args: {aql_args}") documents = cls._db.aql.execute( aql_string, bind_vars=aql_args, count=True, full_count=True ) diff --git a/core/schemas/tag.py b/core/schemas/tag.py index 4d006e54a..b5f7f12af 100644 --- a/core/schemas/tag.py +++ b/core/schemas/tag.py @@ -18,7 +18,7 @@ ) ) -MAX_TAG_LENGTH = 50 +MAX_TAG_LENGTH = 250 MAX_TAGS_REQUEST = 50 diff --git a/tests/apiv2/observables.py b/tests/apiv2/observables.py index b3916c252..ec3e16a46 100644 --- a/tests/apiv2/observables.py +++ b/tests/apiv2/observables.py @@ -231,15 +231,16 @@ def test_create_observable_empty_tags(self): ) def test_create_observable_toolong_tag(self): + longtag = "a" * 300 response = client.post( "/api/v2/observables/", - json={"value": "toto.com", "type": "hostname", "tags": ["tag1", "a" * 200]}, + json={"value": "toto.com", "type": "hostname", "tags": ["tag1", longtag]}, ) data = response.json() self.assertEqual(response.status_code, 422, data) self.assertEqual( data["detail"][0]["msg"], - f"Value error, Tag {'a'*200} exceeds max length (50)", + f"Value error, Tag {longtag} exceeds max length (250)", data, )