← Back to Pull requests

feat: basic auth identity support #288

Open
unknown opened this pull request with 304 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 29, 2026 00:02 UTC
Author

Summary

Implements U1 and U2 of the Basic Auth plan for #189: RFC 7617 credential decoding, a Basic-specific directory contract, and a username-indexed .htpasswd backend. Resolver wiring, facade registration, the YAML and HTTP providers, the benchmark, and the operator recipe are later work units.

Changes

  • U1 — credential decoding and directory contract: Reuses the shared CredentialLocation gate for case-insensitive Basic scheme matching and 1SP, then decodes canonical STANDARD base64, splits on the first colon, normalizes the user ID to NFC, and rejects malformed credentials. The password and decoded intermediates are zeroized; the password cannot be formatted or serialized, and decode errors do not expose credential bytes or offsets. Adds the basic feature and per-feature check.

  • U2 — .htpasswd backend: Adds username-indexed bcrypt and Argon2 verification, dummy verification on a miss, bounded blocking verification, and atomic file refresh with a required staleness ceiling. Refuses weak and malformed hashes, duplicate normalized user IDs, and files mixing hash schemes. Tests cover decoding, verification, file reloads, rejection paths, and concurrency limits.

  • Plan review: Updates the plan against #189, including the hash-cost timing requirement, challenge and host responsibilities, missing work items, and explicit scope differences from the epic. The revised plan requires uniform hash parameters within a local directory; the current U2 implementation still accepts different bcrypt costs and needs to be aligned before merge.
  • Refs #189
    Closes #293
    Closes #294

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added optional HTTP Basic credential decoding with normalized user IDs and configurable size limits.
    Added password verification for bcrypt, Argon2, and SHA-crypt hashes, with configurable parameter limits.
    Added an .htpasswd directory backend with automatic refresh, stale-data limits, and bounded concurrent verification.
    These APIs are available through the built-ins basic feature; a by-kind factory is not yet registered.
    Documentation
    Added guidance that Basic credentials require TLS and that hosts should handle credential headers carefully.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 304 lines (+228 / -76) across 3 files Reviewer: guicassolato Review duration: 33633m
    All Vouch review confidence checks passed
    Residual risk 0.36 = Change Risk (0.63) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.63 · 304 lines diff across 3 files
    0.63
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.342
    Sensitive Paths sensitive_paths
    0.063
    Real PR Conversation Timeline
    1 comments
    "Review active on #288"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 43.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 63.3% (MEDIUM) · Higher = larger blast radius
    63.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 36.1% · Moderate risk
    36.1%