Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add security and topology notification types #738

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Neo4j.Driver/Neo4j.Driver/Internal/Result/SummaryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ private NotificationCategory ParseCategory(string category)
"unsupported" => NotificationCategory.Unsupported,
"performance" => NotificationCategory.Performance,
"deprecation" => NotificationCategory.Deprecation,
"security" => NotificationCategory.Security,
"topology" => NotificationCategory.Topology,
"generic" => NotificationCategory.Generic,
var _ => NotificationCategory.Unknown
};
Expand Down
8 changes: 8 additions & 0 deletions Neo4j.Driver/Neo4j.Driver/Summary/NotificationCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public enum NotificationCategory
/// <summary>The query/command use deprecated features that should be replaced.</summary>
Deprecation,

/// <summary>The result of the query or command indicates a potential security issue.</summary>
Security,

/// <summary>
/// Topology notifications provide additional information related to managing databases and servers.
/// </summary>
Topology,

/// <summary>Notification not covered by other categories.</summary>
Generic
}
20 changes: 17 additions & 3 deletions Neo4j.Driver/Neo4j.Driver/Types/Category.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ namespace Neo4j.Driver;

/// <summary>
/// Used In conjunction with <see cref="Severity"/> to filter which <see cref="INotification"/>s will be sent in
/// <see cref="IResultSummary.Notifications"/>.<br/><br/> Can be used in <see cref="ConfigBuilder.WithNotifications"/> and
/// <see cref="IResultSummary.Notifications"/>.<br/><br/>
/// Can be used in <see cref="ConfigBuilder.WithNotifications"/> and
/// <see cref="SessionConfigBuilder.WithNotifications"/>.
/// </summary>
public enum Category
Expand All @@ -28,7 +29,9 @@ public enum Category
/// <remarks>Returned as <see cref="NotificationCategory.Hint"/></remarks>
Hint,

/// <summary>Receive notifications when a query or command mentions entities that are unknown to the system.</summary>
/// <summary>
/// Receive notifications when a query or command mentions entities that are unknown to the system.
/// </summary>
/// <remarks>Returned as <see cref="NotificationCategory.Unrecognized"/></remarks>
Unrecognized,

Expand All @@ -43,10 +46,21 @@ public enum Category
/// <remarks>Returned as <see cref="NotificationCategory.Performance"/></remarks>
Performance,

/// <summary>Receive notifications when a query/command use deprecated features that should be replaced</summary>
/// <summary>Receive notifications when a query/command use deprecated features that should be replaced.</summary>
/// <remarks>Returned as <see cref="NotificationCategory.Deprecation"/></remarks>
Deprecation,

/// <summary>
/// Receive notifications when the result of the query or command indicates a
/// potential security issue.
/// </summary>
/// <remarks>Returned as <see cref="NotificationCategory.Security"/></remarks>
Security,

/// <summary>Receive notifications related to managing databases and servers.</summary>
/// <remarks>Returned as <see cref="NotificationCategory.Topology"/></remarks>
Topology,

/// <summary>Receive notifications not covered by other categories.</summary>
/// <remarks>Returned as <see cref="NotificationCategory.Generic"/></remarks>
Generic
Expand Down