Permissions, RateControl and Auditing

This commit is contained in:
2026-07-16 14:01:08 +03:00
parent 3a1b95dbc5
commit ba64a0c95a
62 changed files with 6095 additions and 2366 deletions
+22 -1
View File
@@ -1,9 +1,18 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
namespace Esiur.Net.Packets.Http
{
public enum HttpCookieSameSite
{
Unspecified,
Lax,
Strict,
None,
}
public struct HttpCookie
{
public string Name;
@@ -11,6 +20,8 @@ namespace Esiur.Net.Packets.Http
public DateTime Expires;
public string Path;
public bool HttpOnly;
public bool Secure;
public HttpCookieSameSite SameSite;
public string Domain;
public HttpCookie(string name, string value)
@@ -20,6 +31,8 @@ namespace Esiur.Net.Packets.Http
Path = null;
Expires = DateTime.MinValue;
HttpOnly = false;
Secure = false;
SameSite = HttpCookieSameSite.Unspecified;
Domain = null;
}
@@ -29,6 +42,8 @@ namespace Esiur.Net.Packets.Http
Value = value;
Expires = expires;
HttpOnly = false;
Secure = false;
SameSite = HttpCookieSameSite.Unspecified;
Domain = null;
Path = null;
}
@@ -40,7 +55,7 @@ namespace Esiur.Net.Packets.Http
var cookie = Name + "=" + Value;
if (Expires.Ticks != 0)
cookie += "; expires=" + Expires.ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss") + " GMT";
cookie += "; expires=" + Expires.ToUniversalTime().ToString("r", CultureInfo.InvariantCulture);
if (Domain != null)
cookie += "; domain=" + Domain;
@@ -51,6 +66,12 @@ namespace Esiur.Net.Packets.Http
if (HttpOnly)
cookie += "; HttpOnly";
if (Secure)
cookie += "; Secure";
if (SameSite != HttpCookieSameSite.Unspecified)
cookie += "; SameSite=" + SameSite;
return cookie;
}
}