capdux.org CP REGISTRY

@web/basic-auth

v1.0.0 MIT .cap ✓ Verified by capdux.org AI-First .d.cp

Official HTTP Basic Auth (RFC 7617) and X-API-Key constant-time authentication plugin for cap:web

Install with Cap
$ cap add @web/basic-auth

AI Interface Stub .d.cp

// Type definitions for CP

import { App, AppMethod, Context, Response, Plugin, PluginScope } from "../../../../lib/web/app.cp";
export class BasicAuthConfig {
    username: string,
    password: string,
    api_key: string,
    api_key_header: string,
    realm: string,
    optional_auth: bool,
}

export fn baConstTimeEql(a: string, b: string): bool;
export fn baDecodeVal(c: u8): u8?;
export fn basicAuthDecodeBase64(input: string, out_buf: []u8): usize?;
export fn baStartsWithIgnoreCase(s: string, prefix: string): bool;
export fn basicAuthHook(ctx: &mut Context): bool;
export fn createBasicAuthPlugin(cfg: BasicAuthConfig): Plugin;
export fn registerBasicAuth(app: &mut App, cfg: BasicAuthConfig): &mut App;

README

Markdown

No README provided for this package version.

Version History

1 release
Version Format / Size Integrity (SHA-256) Downloads Published Status
v1.0.0 .cap · 2.4 KB sha256-03affd4a0d9ad0a7… 0 2026-11-26 latest