zhougf fa1b286463 Add WmsLite monorepo with JWT auth, tenant context, and project READMEs.
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>
2026-05-24 14:17:47 +08:00

28 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"];
}