Files
Inboxintel/src/InboxIntel.Infrastructure/Configuration/Options.cs
T
cesnimda 2b19bddf7b
CI / backend (push) Successful in 52s
CI / frontend (push) Successful in 11s
Deploy Staging / deploy (push) Successful in 24s
Security / secrets (push) Successful in 4s
Security / dependencies (push) Successful in 52s
CI / backend (pull_request) Successful in 49s
CI / frontend (pull_request) Successful in 10s
Security / secrets (pull_request) Successful in 3s
Security / dependencies (pull_request) Successful in 55s
feat(security): audit batch C — data posture, retention, DP keys (#22)
2026-07-02 10:13:07 +02:00

85 lines
3.3 KiB
C#

using InboxIntel.Domain.Enums;
namespace InboxIntel.Infrastructure.Configuration;
public class GoogleOAuthOptions
{
public const string SectionName = "GoogleOAuth";
public string ClientId { get; set; } = string.Empty;
public string ClientSecret { get; set; } = string.Empty;
/// <summary>Scopes requested. Gmail read + modify (no send).</summary>
public string[] Scopes { get; set; } =
{
"openid", "email", "profile",
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.modify"
};
}
public class GmailSyncOptions
{
public const string SectionName = "GmailSync";
/// <summary>Message-id list page size (Gmail max is 500).</summary>
public int PageSize { get; set; } = 500;
/// <summary>Concurrent Gmail message fetches during sync (kept well under quota).</summary>
public int MaxParallelism { get; set; } = 8;
public int MaxRetries { get; set; } = 5;
/// <summary>Base delay in ms for exponential backoff.</summary>
public int BackoffBaseMs { get; set; } = 500;
/// <summary>Cron-like daily sync hour (UTC) for the scheduled worker.</summary>
public int DailySyncHourUtc { get; set; } = 3;
/// <summary>
/// Cap on messages stored during a full sync. 0 = unlimited. In dev this is
/// set to 1000 so the initial load pulls only the most recent emails.
/// </summary>
public int MaxMessages { get; set; } = 0;
}
public class AiOptions
{
public const string SectionName = "Ai";
public AiProviderMode Mode { get; set; } = AiProviderMode.Disabled;
// Ollama (local)
public string OllamaBaseUrl { get; set; } = "http://localhost:11434";
public string OllamaModel { get; set; } = "llama3.1";
// Embedding model for semantic search (per docs/discovery/06). Small, always-on when local.
public string EmbeddingModel { get; set; } = "nomic-embed-text";
// OpenAI (cloud, optional)
public string OpenAiApiKey { get; set; } = string.Empty;
public string OpenAiModel { get; set; } = "gpt-4o-mini";
}
public class SmtpOptions
{
public const string SectionName = "Smtp";
public bool Enabled { get; set; } = false;
public string Host { get; set; } = string.Empty;
public int Port { get; set; } = 587;
public bool UseSsl { get; set; } = true;
public string User { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string FromAddress { get; set; } = string.Empty;
public string FromName { get; set; } = "InboxIntel";
}
public class DigestOptions
{
public const string SectionName = "Digest";
/// <summary>How often a digest is sent to each opted-in user.</summary>
public int FrequencyDays { get; set; } = 7;
/// <summary>Hour (UTC) the background worker checks for due digests.</summary>
public int SendHourUtc { get; set; } = 8;
}
/// <summary>AUDIT H-3: opt-in local data retention. 0 = disabled (keep forever).</summary>
public class DataRetentionOptions
{
public const string SectionName = "DataRetention";
/// <summary>Purge locally stored emails flagged Trashed older than this many days.</summary>
public int PurgeTrashedAfterDays { get; set; } = 0;
/// <summary>Purge ALL locally stored emails older than this many days (local copy only).</summary>
public int PurgeAllAfterDays { get; set; } = 0;
}