feat: implement HTTP Security Headers management (Issue #20)

Add comprehensive security header management system with reusable
profiles, interactive builders, and security scoring.

Features:
- SecurityHeaderProfile model with 11+ header types
- CRUD API with 10 endpoints (/api/v1/security/headers/*)
- Caddy integration for automatic header injection
- 3 built-in presets (Basic, Strict, Paranoid)
- Security score calculator (0-100) with suggestions
- Interactive CSP builder with validation
- Permissions-Policy builder
- Real-time security score preview
- Per-host profile assignment

Headers Supported:
- HSTS with preload support
- Content-Security-Policy with report-only mode
- X-Frame-Options, X-Content-Type-Options
- Referrer-Policy, Permissions-Policy
- Cross-Origin-Opener/Resource/Embedder-Policy
- X-XSS-Protection, Cache-Control security

Implementation:
- Backend: models, handlers, services (85% coverage)
- Frontend: React components, hooks (87.46% coverage)
- Tests: 1,163 total tests passing
- Docs: Comprehensive feature documentation

Closes #20
This commit is contained in:
GitHub Actions
2025-12-18 02:58:26 +00:00
parent 01ec910d58
commit 8cf762164f
33 changed files with 7978 additions and 69 deletions

View File

@@ -0,0 +1,32 @@
import { forwardRef } from 'react';
import { cn } from '../../utils/cn';
export interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
error?: boolean;
}
export const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
({ className, error, ...props }, ref) => {
return (
<select
ref={ref}
className={cn(
'flex h-10 w-full items-center justify-between gap-2',
'rounded-lg border px-3 py-2',
'bg-surface-base text-content-primary text-sm',
'placeholder:text-content-muted',
'transition-colors duration-fast',
error
? 'border-error focus:ring-error'
: 'border-border hover:border-border-strong focus:border-brand-500',
'focus:outline-none focus:ring-2 focus:ring-brand-500/20',
'disabled:cursor-not-allowed disabled:opacity-50',
className
)}
{...props}
/>
);
}
);
NativeSelect.displayName = 'NativeSelect';