@web/security
v1.0.0
MIT
.cap
✓ Verified by capdux.org
AI-First .d.cp
Official Helmet security headers (HSTS/CSP/X-Frame-Options/Referrer-Policy) and Double-Submit CSRF plugin for cap:web
Install with Cap
$ cap add @web/security
AI Interface Stub .d.cp
// Type definitions for CP
import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export class SecurityConfig {
hsts: string,
csp: string,
x_frame_options: string,
x_content_type_options: string,
referrer_policy: string,
permissions_policy: string,
enable_csrf: bool,
csrf_cookie_name: string,
csrf_header_name: string,
csrf_min_token_len: usize,
}
export fn constantTimeEql(a: string, b: string): bool;
export fn isSafeHttpMethod(m: AppMethod): bool;
export fn securityOnRequest(ctx: &mut Context): bool;
export fn createSecurityPlugin(cfg: SecurityConfig): Plugin;
export fn registerSecurity(app: &mut App, cfg: SecurityConfig): &mut App;
README
MarkdownNo README provided for this package version.
Version History
1 release| Version | Format / Size | Integrity (SHA-256) | Downloads | Published | Status |
|---|---|---|---|---|---|
| v1.0.0 | .cap · 2.3 KB | sha256-836c408d301bbb02… | 0 | 2026-11-26 | latest |