Skip to content

fix: security and so on#5

Open
chuangyeshuo wants to merge 21 commits into
AlephantAI:devfrom
chuangyeshuo:main
Open

fix: security and so on#5
chuangyeshuo wants to merge 21 commits into
AlephantAI:devfrom
chuangyeshuo:main

Conversation

@chuangyeshuo

Copy link
Copy Markdown

fix: security and so on

ComunionIO and others added 21 commits May 10, 2026 19:40
Fix formatting in README.md for build instructions
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add SecurityPlugin trait with check_request and mask_response
- Add PluginLoader for config-driven plugin loading
- Add built-in plugins: NoOp, SensitiveDataDetector, DataClassifier
- Add SecurityLayer middleware for Tower integration
- Update config to support security plugins in MiddlewareConfig
- Update AGENTS.md with plugin system documentation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix imports in plugin/mod.rs and plugin/loader.rs
- Fix string formatting in builtins.rs classify_request
- Format all plugin files with rustfmt
- Remove unused ArcSwap import from loader.rs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add Debug trait to SecurityPlugin
- Add Default trait to SensitivityLevel
- Fix toml::Value handling for plugin config
- Remove Eq requirement from PluginConfig (toml::Value not Eq)
- Simplify body extraction in middleware

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… Eq)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add Google::GenerateContents tuple variant and iter() method for strum::EnumIter
- Create generate_contents.rs endpoint type for Google Gemini
- Remove google from .gitignore (was blocking valid code)
- Remove unused bytes::Bytes import from builtins.rs
- Remove unused mut in security.rs

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix: wire security plugins into runtime
1. Streaming body collection: Add MAX_SECURITY_BODY_SIZE (10MB) limit
   to prevent memory exhaustion. Large responses are truncated.

2. Virtual key trust: Remove direct x-virtual-key header reading.
   Now extracts from request extensions (auth context) only.

3. Provider extraction: Now tries request extensions first, then falls
   back to URL path parsing (with note about unreliability).

4. Config path: Support both global.security and unified_api.security.
   Global takes precedence, unified_api is fallback.

5. LICENSE: Changed from Apache-2.0 to GPL-3.0-or-later in Cargo.toml

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
fix: address security middleware critical issues
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.

3 participants