diff --git a/docs/source/api.rst b/docs/source/api.rst index ca23b4fb..24f12de5 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -629,7 +629,8 @@ Notifications are available via :attr:`.ResultSummary.notifications` and :attr:` :data:`None` will apply the server's default setting. .. Note:: - If configured, the server or all servers of the cluster need to support notifications filtering. + If configured, the server or all servers of the cluster need to support notifications filtering + (server version 5.7 and newer). Otherwise, the driver will raise a :exc:`.ConfigurationError` as soon as it encounters a server that does not. :Type: :data:`None`, :class:`.NotificationMinimumSeverity`, or :class:`str` @@ -652,7 +653,8 @@ Notifications are available via :attr:`.ResultSummary.notifications` and :attr:` :data:`None` will apply the server's default setting. .. Note:: - If configured, the server or all servers of the cluster need to support notifications filtering. + If configured, the server or all servers of the cluster need to support notifications filtering + (server version 5.7 and newer). Otherwise, the driver will raise a :exc:`.ConfigurationError` as soon as it encounters a server that does not. :Type: :data:`None`, :term:`iterable` of :class:`.NotificationDisabledCategory` and/or :class:`str` @@ -1778,15 +1780,15 @@ BookmarkManager Constants, Enums, Helpers ************************* -.. autoclass:: neo4j.NotificationMinimumSeverity +.. autoclass:: neo4j.NotificationMinimumSeverity() :show-inheritance: :members: -.. autoclass:: neo4j.NotificationDisabledCategory +.. autoclass:: neo4j.NotificationDisabledCategory() :show-inheritance: :members: -.. autoclass:: neo4j.RoutingControl +.. autoclass:: neo4j.RoutingControl() :show-inheritance: :members: diff --git a/src/neo4j/_api.py b/src/neo4j/_api.py index a53cdff4..55d3f2c6 100644 --- a/src/neo4j/_api.py +++ b/src/neo4j/_api.py @@ -40,7 +40,7 @@ class NotificationMinimumSeverity(str, Enum): """Filter notifications returned by the server by minimum severity. Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a - :class:`.NotificationFilter` value will also accept a string:: + :class:`.NotificationMinimumSeverity` value will also accept a string:: >>> NotificationMinimumSeverity.OFF == "OFF" True @@ -128,23 +128,20 @@ class NotificationDisabledCategory(str, Enum): """Filter notifications returned by the server by category. Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a - :class:`.NotificationFilter` value will also accept a string:: + :class:`.NotificationDisabledCategory` value will also accept a string:: - >>> NotificationDisabledCategory.HINT == "HINT" - True >>> NotificationDisabledCategory.UNRECOGNIZED == "UNRECOGNIZED" True - >>> NotificationDisabledCategory.UNSUPPORTED == "UNSUPPORTED" - True >>> NotificationDisabledCategory.PERFORMANCE == "PERFORMANCE" True >>> NotificationDisabledCategory.DEPRECATION == "DEPRECATION" True - >>> NotificationDisabledCategory.GENERIC == "GENERIC" - True .. versionadded:: 5.7 + .. versionchanged:: 5.14 + Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`. + .. seealso:: driver config :ref:`driver-notifications-disabled-categories-ref`, session config :ref:`session-notifications-disabled-categories-ref` @@ -156,6 +153,10 @@ class NotificationDisabledCategory(str, Enum): PERFORMANCE = "PERFORMANCE" DEPRECATION = "DEPRECATION" GENERIC = "GENERIC" + #: Requires server version 5.14 or newer. + SECURITY = "SECURITY" + #: Requires server version 5.14 or newer. + TOPOLOGY = "TOPOLOGY" if t.TYPE_CHECKING: @@ -168,6 +169,8 @@ class NotificationDisabledCategory(str, Enum): "PERFORMANCE", "DEPRECATION", "GENERIC", + "SECURITY", + "TOPOLOGY", ], ] __all__.append("T_NotificationDisabledCategory") @@ -188,6 +191,9 @@ class NotificationCategory(str, Enum): .. versionadded:: 5.7 + .. versionchanged:: 5.14 + Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`. + .. seealso:: :attr:`SummaryNotification.category` """ @@ -197,6 +203,8 @@ class NotificationCategory(str, Enum): PERFORMANCE = "PERFORMANCE" DEPRECATION = "DEPRECATION" GENERIC = "GENERIC" + SECURITY = "SECURITY" + TOPOLOGY = "TOPOLOGY" #: Used when the server provides a Category which the driver is unaware of. #: This can happen when connecting to a server newer than the driver or #: before notification categories were introduced. diff --git a/src/neo4j/_work/summary.py b/src/neo4j/_work/summary.py index e2642654..6317d9d7 100644 --- a/src/neo4j/_work/summary.py +++ b/src/neo4j/_work/summary.py @@ -229,6 +229,8 @@ def contains_system_updates(self) -> bool: "PERFORMANCE": NotificationCategory.PERFORMANCE, "DEPRECATION": NotificationCategory.DEPRECATION, "GENERIC": NotificationCategory.GENERIC, + "SECURITY": NotificationCategory.SECURITY, + "TOPOLOGY": NotificationCategory.TOPOLOGY, }