Skip to content

Commit 222b107

Browse files
authored
Add new notification categories SECURITY and TOPOLOGY (#975)
1 parent ace72e9 commit 222b107

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

docs/source/api.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ Notifications are available via :attr:`.ResultSummary.notifications` and :attr:`
629629
:data:`None` will apply the server's default setting.
630630

631631
.. Note::
632-
If configured, the server or all servers of the cluster need to support notifications filtering.
632+
If configured, the server or all servers of the cluster need to support notifications filtering
633+
(server version 5.7 and newer).
633634
Otherwise, the driver will raise a :exc:`.ConfigurationError` as soon as it encounters a server that does not.
634635

635636
:Type: :data:`None`, :class:`.NotificationMinimumSeverity`, or :class:`str`
@@ -652,7 +653,8 @@ Notifications are available via :attr:`.ResultSummary.notifications` and :attr:`
652653
:data:`None` will apply the server's default setting.
653654

654655
.. Note::
655-
If configured, the server or all servers of the cluster need to support notifications filtering.
656+
If configured, the server or all servers of the cluster need to support notifications filtering
657+
(server version 5.7 and newer).
656658
Otherwise, the driver will raise a :exc:`.ConfigurationError` as soon as it encounters a server that does not.
657659

658660
:Type: :data:`None`, :term:`iterable` of :class:`.NotificationDisabledCategory` and/or :class:`str`
@@ -1778,15 +1780,15 @@ BookmarkManager
17781780
Constants, Enums, Helpers
17791781
*************************
17801782

1781-
.. autoclass:: neo4j.NotificationMinimumSeverity
1783+
.. autoclass:: neo4j.NotificationMinimumSeverity()
17821784
:show-inheritance:
17831785
:members:
17841786

1785-
.. autoclass:: neo4j.NotificationDisabledCategory
1787+
.. autoclass:: neo4j.NotificationDisabledCategory()
17861788
:show-inheritance:
17871789
:members:
17881790

1789-
.. autoclass:: neo4j.RoutingControl
1791+
.. autoclass:: neo4j.RoutingControl()
17901792
:show-inheritance:
17911793
:members:
17921794

src/neo4j/_api.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class NotificationMinimumSeverity(str, Enum):
4040
"""Filter notifications returned by the server by minimum severity.
4141
4242
Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
43-
:class:`.NotificationFilter` value will also accept a string::
43+
:class:`.NotificationMinimumSeverity` value will also accept a string::
4444
4545
>>> NotificationMinimumSeverity.OFF == "OFF"
4646
True
@@ -128,23 +128,20 @@ class NotificationDisabledCategory(str, Enum):
128128
"""Filter notifications returned by the server by category.
129129
130130
Inherits from :class:`str` and :class:`Enum`. Every driver API accepting a
131-
:class:`.NotificationFilter` value will also accept a string::
131+
:class:`.NotificationDisabledCategory` value will also accept a string::
132132
133-
>>> NotificationDisabledCategory.HINT == "HINT"
134-
True
135133
>>> NotificationDisabledCategory.UNRECOGNIZED == "UNRECOGNIZED"
136134
True
137-
>>> NotificationDisabledCategory.UNSUPPORTED == "UNSUPPORTED"
138-
True
139135
>>> NotificationDisabledCategory.PERFORMANCE == "PERFORMANCE"
140136
True
141137
>>> NotificationDisabledCategory.DEPRECATION == "DEPRECATION"
142138
True
143-
>>> NotificationDisabledCategory.GENERIC == "GENERIC"
144-
True
145139
146140
.. versionadded:: 5.7
147141
142+
.. versionchanged:: 5.14
143+
Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.
144+
148145
.. seealso::
149146
driver config :ref:`driver-notifications-disabled-categories-ref`,
150147
session config :ref:`session-notifications-disabled-categories-ref`
@@ -156,6 +153,10 @@ class NotificationDisabledCategory(str, Enum):
156153
PERFORMANCE = "PERFORMANCE"
157154
DEPRECATION = "DEPRECATION"
158155
GENERIC = "GENERIC"
156+
#: Requires server version 5.14 or newer.
157+
SECURITY = "SECURITY"
158+
#: Requires server version 5.14 or newer.
159+
TOPOLOGY = "TOPOLOGY"
159160

160161

161162
if t.TYPE_CHECKING:
@@ -168,6 +169,8 @@ class NotificationDisabledCategory(str, Enum):
168169
"PERFORMANCE",
169170
"DEPRECATION",
170171
"GENERIC",
172+
"SECURITY",
173+
"TOPOLOGY",
171174
],
172175
]
173176
__all__.append("T_NotificationDisabledCategory")
@@ -188,6 +191,9 @@ class NotificationCategory(str, Enum):
188191
189192
.. versionadded:: 5.7
190193
194+
.. versionchanged:: 5.14
195+
Added categories :attr:`.SECURITY` and :attr:`.TOPOLOGY`.
196+
191197
.. seealso:: :attr:`SummaryNotification.category`
192198
"""
193199

@@ -197,6 +203,8 @@ class NotificationCategory(str, Enum):
197203
PERFORMANCE = "PERFORMANCE"
198204
DEPRECATION = "DEPRECATION"
199205
GENERIC = "GENERIC"
206+
SECURITY = "SECURITY"
207+
TOPOLOGY = "TOPOLOGY"
200208
#: Used when the server provides a Category which the driver is unaware of.
201209
#: This can happen when connecting to a server newer than the driver or
202210
#: before notification categories were introduced.

src/neo4j/_work/summary.py

+2
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ def contains_system_updates(self) -> bool:
229229
"PERFORMANCE": NotificationCategory.PERFORMANCE,
230230
"DEPRECATION": NotificationCategory.DEPRECATION,
231231
"GENERIC": NotificationCategory.GENERIC,
232+
"SECURITY": NotificationCategory.SECURITY,
233+
"TOPOLOGY": NotificationCategory.TOPOLOGY,
232234
}
233235

234236

0 commit comments

Comments
 (0)