mirror of
https://github.com/CannedNet/CannedNet.git
synced 2026-10-27 07:58:59 -07:00
notify server changes + logging changes
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
namespace CannedNet;
|
||||||
|
|
||||||
|
public enum JoinMode
|
||||||
|
{
|
||||||
|
Default = 0,
|
||||||
|
CreateIfNotExists = 1,
|
||||||
|
JoinOrRejoin = 2,
|
||||||
|
RejoinOnly = 3
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace CannedNet;
|
||||||
|
|
||||||
|
public enum ModerationState
|
||||||
|
{
|
||||||
|
Active = 0,
|
||||||
|
Junior_Pending = 1,
|
||||||
|
Moderation_Pending = 2,
|
||||||
|
Moderation_Closed = 3,
|
||||||
|
Moderation_Banned = 4,
|
||||||
|
MarkedForDelete = 5
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ public class NotificationMessage
|
|||||||
public string? NotificationId { get; set; }
|
public string? NotificationId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("notificationType")]
|
[JsonPropertyName("notificationType")]
|
||||||
public string? NotificationType { get; set; }
|
public PushNotificationId? NotificationType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("id")]
|
[JsonPropertyName("id")]
|
||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
@@ -95,7 +95,7 @@ public class RelationshipChangedNotification
|
|||||||
public int? AccountId { get; set; }
|
public int? AccountId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("relationshipType")]
|
[JsonPropertyName("relationshipType")]
|
||||||
public string? RelationshipType { get; set; }
|
public RelationshipType? RelationshipType { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("status")]
|
[JsonPropertyName("status")]
|
||||||
public string? Status { get; set; }
|
public string? Status { get; set; }
|
||||||
@@ -227,5 +227,5 @@ public class InventionModerationNotification
|
|||||||
public string? InventionId { get; set; }
|
public string? InventionId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("moderationState")]
|
[JsonPropertyName("moderationState")]
|
||||||
public string? ModerationState { get; set; }
|
public ModerationState? ModerationState { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
namespace CannedNet;
|
||||||
|
|
||||||
|
public enum RelationshipType
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
FriendRequestSent,
|
||||||
|
FriendRequestReceived,
|
||||||
|
Friend
|
||||||
|
}
|
||||||
@@ -101,7 +101,7 @@ public class NotificationService
|
|||||||
await hubContext.Clients.All.SendAsync("Notification", notification);
|
await hubContext.Clients.All.SendAsync("Notification", notification);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NotificationMessage CreateNotification(string notificationType, int? id = null, int? fromAccountId = null, int? toAccountId = null, Dictionary<string, object>? data = null)
|
public NotificationMessage CreateNotification(PushNotificationId notificationType, int? id = null, int? fromAccountId = null, int? toAccountId = null, Dictionary<string, object>? data = null)
|
||||||
{
|
{
|
||||||
return new NotificationMessage
|
return new NotificationMessage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -58,14 +58,7 @@ public class RequestLoggingMiddleware
|
|||||||
|
|
||||||
private static bool IsSensitiveHeader(string headerName)
|
private static bool IsSensitiveHeader(string headerName)
|
||||||
{
|
{
|
||||||
var sensitiveHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
|
var sensitiveHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { };
|
||||||
{
|
|
||||||
"Authorization",
|
|
||||||
"Cookie",
|
|
||||||
"Set-Cookie",
|
|
||||||
"X-Auth-Token",
|
|
||||||
"X-Csrf-Token"
|
|
||||||
};
|
|
||||||
return sensitiveHeaders.Contains(headerName);
|
return sensitiveHeaders.Contains(headerName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user