Skip to content

Add Heimdall authentication gateway: robust multi-method auth, validation, rate limiting, and audit logging#62

Open
cto-new[bot] wants to merge 1 commit into
mainfrom
feat-heimdall-auth-validation-rate-limit-audit-tests-e01
Open

Add Heimdall authentication gateway: robust multi-method auth, validation, rate limiting, and audit logging#62
cto-new[bot] wants to merge 1 commit into
mainfrom
feat-heimdall-auth-validation-rate-limit-audit-tests-e01

Conversation

@cto-new

@cto-new cto-new Bot commented Nov 6, 2025

Copy link
Copy Markdown

Summary

This PR establishes a comprehensive Heimdall authentication gateway, securing the relay layer through advanced authentication, request validation, rate limiting, and structured audit logging. It modernizes the API's security architecture and observability.

Details

  • Adds Heimdall middleware supporting API key, JWT, and mTLS authentication
  • Enforces request replay protection (Redis) and strict JSON schema validation
  • Implements per-token and per-IP rate limiting using token bucket algorithm
  • Emits structured, sanitized audit logs (JSON) with user, token, IP, TLS, and request IDs
  • Backward-compatible integration: enables Heimdall via configuration, falls back to legacy auth otherwise
  • Documentation, configuration examples, and both unit/integration testing included
  • Provides migration, monitoring, and troubleshooting guidance in included docs
  • No plaintext secrets are exposed, stored, or logged anywhere in the flow

Warning: Task VM test is not passing, cto.new will perform much better if you fix the setup

… and gateway integration

Adds a robust authentication gateway called Heimdall, providing strong multi-method auth, schema validation, replay protection, rate limiting, and audit logging. This is needed to secure the gateway with modular backend integration, observability, and security controls.

- Introduces Heimdall middleware supporting API key, JWT, and mTLS authentication
- Adds request validation, replay protection with Redis, and strict JSON schema enforcement
- Implements per-key/IP rate limiting and structured audit logging with secure truncation
- Integrates Heimdall router with environment-based config and backward compatibility
- Comprehensive unit/integration tests, documentation, and migration support

Heimdall can be enabled in production with configuration and fully replaces legacy relay auth when enabled.

BREAKING CHANGE: New Heimdall middleware replaces and deprecates legacy TokenAuth for relay routes if enabled; review migration steps and config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants