namespace Gateway.Security; /// /// Holds authenticated client information for the current request. /// Populated by ClientAuthMiddleware. /// public sealed class ClientContext { /// /// Session ID from session-based auth. /// public string? SessionId { get; set; } /// /// The authenticated client ID (from session, JWT sub claim, or dev header). /// This identifies the client/organization in our platform. /// public string? ClientId { get; set; } /// /// Optional tenant ID for the ad platform (e.g., Google Ads customer ID). /// May be derived from ClientId mapping or passed in request. /// public string? TenantId { get; set; } /// /// Display name from token or session (if available). /// public string? ClientName { get; set; } /// /// User ID from session (if using session auth). /// public string? UserId { get; set; } /// /// Email from token or session (if available). /// public string? Email { get; set; } /// /// User role from session (admin, user, readonly). /// public string? Role { get; set; } /// /// Whether this request was authenticated via dev bypass (vs real auth). /// public bool IsDevBypass { get; set; } /// /// The authentication provider used (microsoft, google, etc.) /// public string? AuthProvider { get; set; } /// /// True if we have a valid ClientId. /// public bool IsAuthenticated => !string.IsNullOrWhiteSpace(ClientId); }