Implement API security baseline (sys_user, JWT, audit fields, transactions, unique constraints) and Web real login with 401 handling. Document setup and development workflows in root, WmsLite.Api, and WmsLite.Web README files. Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
namespace WmsLite.Api.Infrastructure.HttpLogging;
|
||
|
||
/// <summary>
|
||
/// HTTP 请求/响应日志(中间件)配置。
|
||
/// </summary>
|
||
public class HttpLoggingOptions
|
||
{
|
||
public const string SectionName = "HttpLogging";
|
||
|
||
/// <summary>是否启用中间件记录。</summary>
|
||
public bool Enabled { get; set; } = true;
|
||
|
||
/// <summary>是否将访问信息写入 http_access_log 表(不包含 SQL)。</summary>
|
||
public bool PersistToDatabase { get; set; } = true;
|
||
|
||
/// <summary>
|
||
/// 路径(Path)包含任一子串时,将 POST/PUT/PATCH/DELETE 视为「类查询」:不落库、不打印响应体。
|
||
/// 默认含分页列表常见片段,与约定「变更类方法记响应」配合使用;空数组表示关闭白名单。
|
||
/// </summary>
|
||
public string[] PathsOmittingResponseBody { get; set; } = ["paged-list", "pagedlist"];
|
||
|
||
/// <summary>路径包含任一子串时不记录/不落库请求体(如登录)。</summary>
|
||
public string[] PathsOmittingRequestBody { get; set; } = ["/api/Auth/login"];
|
||
|
||
/// <summary>JSON 日志脱敏字段名(小写比较)。</summary>
|
||
public string[] SensitiveFieldNames { get; set; } = ["password", "token", "authorization", "accessToken", "refreshToken"];
|
||
}
|