Files
OwnCord/Client/OwnCord.Client/Services/ICertificateTrustService.cs
T
jevb 6eba999233 feat: add Let's Encrypt ACME support, fix security issues, improve server UX
Server:
- Add Let's Encrypt (ACME) TLS mode with autocert, HTTP-01 challenges on :80,
  and automatic certificate renewal (tls.mode: "acme" in config.yaml)
- Add ASCII art startup banner with server info and endpoint URLs
- Fix CSP blocking admin panel inline styles/scripts (per-route override)
- Suppress TLS handshake error noise in console output
- Fix TOCTOU race in invite consumption (atomic UPDATE with row-count check)
- Fix sendMsg mutex race condition (hold lock for entire send)
- Fix permission override formula (deny-first, allow-wins)
- Fix voice join parsing channelID before permission check
- Add session expiry check at WebSocket auth and periodic revalidation
- Add message length limit (4000 chars) and emoji length validation (32 bytes)
- Add file size enforcement in storage after io.Copy
- Add checksum URL validation in updater
- Add backup path traversal protection (BackupToSafe)
- Add self-modification guard in admin handlePatchUser
- Fix admin ownerOnlyMiddleware to use context user instead of re-auth
- Remove redundant startup log lines (banner shows same info)
- Add periodic expired session cleanup (15-min ticker)
- Add permissions package with bitfield constants and EffectivePerms
- Add rate limiter cleanup goroutine to prevent unbounded growth
- Add auth helpers (IsEffectivelyBanned, IsSessionExpired)
- Add WebSocket origin validation

Client:
- Add TOFU certificate trust service
- Add receive loop error handling
- Fix redundant else-if in OnChatMessage
2026-03-15 07:07:59 +01:00

26 lines
1.1 KiB
C#

namespace OwnCord.Client.Services;
/// <summary>
/// Trust-On-First-Use (TOFU) certificate pinning service.
/// On the first connection to a host, the certificate fingerprint is automatically
/// trusted and stored. On subsequent connections, the stored fingerprint must match.
/// </summary>
public interface ICertificateTrustService
{
/// <summary>
/// Returns true if the given fingerprint is trusted for the host.
/// On first use (no stored fingerprint), automatically trusts and stores the fingerprint.
/// Returns false if a different fingerprint was previously stored for this host.
/// </summary>
bool IsTrusted(string host, string fingerprint);
/// <summary>Explicitly stores a fingerprint as trusted for the given host.</summary>
void TrustFingerprint(string host, string fingerprint);
/// <summary>Removes any stored trust record for the given host.</summary>
void RemoveTrust(string host);
/// <summary>Returns the stored fingerprint for the host, or null if none is stored.</summary>
string? GetTrustedFingerprint(string host);
}