From f504eb348082929d7f926eb2b6396b1e75b87626 Mon Sep 17 00:00:00 2001 From: Renn F Date: Thu, 8 Oct 2026 13:49:29 +0200 Subject: [PATCH 1/2] chore: finish the Guard-Core org migration (docs, metadata, links) --- .github/FUNDING.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 4 +- .github/scripts/bump_version.py | 2 +- AGENTS.md | 18 ++-- CLAUDE.md | 18 ++-- CODE_OF_CONDUCT.md | 2 +- README.md | 79 +++++++-------- SECURITY.md | 6 +- context7.json | 2 +- docs/api/core-architecture.md | 2 +- docs/api/overview.md | 2 +- docs/index.md | 24 ++--- docs/llms.txt | 104 ++++++++++---------- docs/robots.txt | 2 +- docs/tutorial/configuration/telemetry.md | 6 +- docs/tutorial/decorators/overview.md | 2 +- docs/tutorial/examples/example-app.md | 6 +- docs/tutorial/integration.md | 2 +- guard/.agents/skills/fastapi-guard/SKILL.md | 16 +-- mkdocs.yml | 12 +-- pyproject.toml | 10 +- 21 files changed, 161 insertions(+), 160 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 70c9c1f4..63734b60 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,6 +1,6 @@ # These are supported funding model platforms -github: rennf93 +github: Guard-Core # patreon: # Replace with a single Patreon username # open_collective: # Replace with a single Open Collective username # ko_fi: # Replace with a single Ko-fi username diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 122ec66a..55cf918e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,10 +1,10 @@ blank_issues_enabled: false contact_links: - name: FastAPI Guard Documentation - url: https://rennf93.github.io/fastapi-guard/ + url: https://guard-core.github.io/fastapi-guard/ about: Check the documentation for usage information and tutorials - name: Usage Questions - url: https://github.com/rennf93/fastapi-guard/discussions + url: https://github.com/Guard-Core/fastapi-guard/discussions about: Please ask and answer questions in GitHub Discussions - name: Discord url: https://discord.gg/ZW7ZJbjMkK diff --git a/.github/scripts/bump_version.py b/.github/scripts/bump_version.py index 115f9a26..20b6b2d2 100644 --- a/.github/scripts/bump_version.py +++ b/.github/scripts/bump_version.py @@ -189,7 +189,7 @@ def update_index_md(version: str) -> bool: content = path.read_text() pattern = re.compile( - r"(docker pull ghcr\.io/rennf93/fastapi-guard-example:v)" + r"(docker pull ghcr\.io/guard-core/fastapi-guard-example:v)" r"[\d]+\.[\d]+\.[\d]+" ) match = pattern.search(content) diff --git a/AGENTS.md b/AGENTS.md index 799a7482..63795d54 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ FastAPI Guard is a production-ready security library for FastAPI applications th ## Ecosystem Position -As of v5.0.0, fastapi-guard is a **thin adapter** over [guard-core](https://github.com/rennf93/guard-core). All security logic (models, handlers, decorators, detection engine, protocols, utilities) lives in the `guard_core` package. This repo contains only the FastAPI/Starlette integration layer. +As of v5.0.0, fastapi-guard is a **thin adapter** over [guard-core](https://github.com/Guard-Core/guard-core). All security logic (models, handlers, decorators, detection engine, protocols, utilities) lives in the `guard_core` package. This repo contains only the FastAPI/Starlette integration layer. ```text guard-core (engine, PyPI dependency) <- all security logic @@ -56,7 +56,7 @@ from guard import GeoIPHandler, RedisHandlerProtocol ## Boundary Rules -- **This repo MUST NOT** contain security logic (checks, handlers, models, detection patterns). Those belong in [guard-core](https://github.com/rennf93/guard-core). A change that looks like a security fix belongs upstream in guard-core, not here. +- **This repo MUST NOT** contain security logic (checks, handlers, models, detection patterns). Those belong in [guard-core](https://github.com/Guard-Core/guard-core). A change that looks like a security fix belongs upstream in guard-core, not here. - **This repo MUST** wire Starlette/FastAPI native types to guard-core's `GuardRequest`, `GuardResponse`, and `GuardResponseFactory` protocols via `guard/adapters.py`. - **This repo MUST** keep `SecurityMiddleware` as a thin orchestrator that delegates to `SecurityCheckPipeline`; do not fork or reimplement pipeline behavior. - **This repo MUST** re-export new guard-core public surface from `guard/__init__.py` when it becomes part of the adapter's user-facing API. @@ -294,10 +294,10 @@ REDIS_URL=redis://localhost:6379 uv run pytest -k "security_headers" -v ## Related Projects -- **guard-core** - Framework-agnostic security engine (the engine this adapter wraps): -- **flaskapi-guard** - Flask extension adapter (sync mirror): -- **djapi-guard** - Django middleware adapter (sync mirror): -- **tornadoapi-guard** - Tornado handler/middleware adapter: -- **guard-agent** - Telemetry and monitoring agent: -- **guard-core-mcp** - MCP server for config validation and docs search: -- **guard-core-app** - SaaS platform (API, dashboard, playground): +- **guard-core** - Framework-agnostic security engine (the engine this adapter wraps): +- **flaskapi-guard** - Flask extension adapter (sync mirror): +- **djapi-guard** - Django middleware adapter (sync mirror): +- **tornadoapi-guard** - Tornado handler/middleware adapter: +- **guard-agent** - Telemetry and monitoring agent: +- **guard-core-mcp** - MCP server for config validation and docs search: +- **guard-core-app** - SaaS platform (API, dashboard, playground): diff --git a/CLAUDE.md b/CLAUDE.md index 0b3ce956..c069b39a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,7 +19,7 @@ FastAPI Guard is a production-ready security library for FastAPI applications th ## Ecosystem Position -As of v5.0.0, fastapi-guard is a **thin adapter** over [guard-core](https://github.com/rennf93/guard-core). All security logic (models, handlers, decorators, detection engine, protocols, utilities) lives in the `guard_core` package. This repo contains only the FastAPI/Starlette integration layer. +As of v5.0.0, fastapi-guard is a **thin adapter** over [guard-core](https://github.com/Guard-Core/guard-core). All security logic (models, handlers, decorators, detection engine, protocols, utilities) lives in the `guard_core` package. This repo contains only the FastAPI/Starlette integration layer. ``` guard-core (engine, PyPI dependency) <- all security logic @@ -55,7 +55,7 @@ from guard import GeoIPHandler, RedisHandlerProtocol ## Boundary Rules -- **This repo MUST NOT** contain security logic (checks, handlers, models, detection patterns). Those belong in [guard-core](https://github.com/rennf93/guard-core). A change that looks like a security fix belongs upstream in guard-core, not here. +- **This repo MUST NOT** contain security logic (checks, handlers, models, detection patterns). Those belong in [guard-core](https://github.com/Guard-Core/guard-core). A change that looks like a security fix belongs upstream in guard-core, not here. - **This repo MUST** wire Starlette/FastAPI native types to guard-core's `GuardRequest`, `GuardResponse`, and `GuardResponseFactory` protocols via `guard/adapters.py`. - **This repo MUST** keep `SecurityMiddleware` as a thin orchestrator that delegates to `SecurityCheckPipeline`; do not fork or reimplement pipeline behavior. - **This repo MUST** re-export new guard-core public surface from `guard/__init__.py` when it becomes part of the adapter's user-facing API. @@ -293,10 +293,10 @@ REDIS_URL=redis://localhost:6379 uv run pytest -k "security_headers" -v ## Related Projects -- **guard-core** - Framework-agnostic security engine (the engine this adapter wraps): -- **flaskapi-guard** - Flask extension adapter (sync mirror): -- **djapi-guard** - Django middleware adapter (sync mirror): -- **tornadoapi-guard** - Tornado handler/middleware adapter: -- **guard-agent** - Telemetry and monitoring agent: -- **guard-core-mcp** - MCP server for config validation and docs search: -- **guard-core-app** - SaaS platform (API, dashboard, playground): +- **guard-core** - Framework-agnostic security engine (the engine this adapter wraps): +- **flaskapi-guard** - Flask extension adapter (sync mirror): +- **djapi-guard** - Django middleware adapter (sync mirror): +- **tornadoapi-guard** - Tornado handler/middleware adapter: +- **guard-agent** - Telemetry and monitoring agent: +- **guard-core-mcp** - MCP server for config validation and docs search: +- **guard-core-app** - SaaS platform (API, dashboard, playground): diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index a733ba29..4153dad2 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -76,7 +76,7 @@ Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -@rennf93. +contact@guard-core.com. All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/README.md b/README.md index 8e857f59..3f7d6274 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@

- - FastAPI Guard + + FastAPI Guard

PyPI version License: MIT - CI - Release - CodeQL + CI + Release + CodeQL + Docs Downloads

Website · - Docs · + Docs · Playground · Dashboard · Discord @@ -99,11 +100,11 @@ config = SecurityConfig( app.add_middleware(SecurityMiddleware, config=config) ``` -For production, wire `guard.lifespan.guard_lifespan` into `FastAPI(lifespan=...)` so initialization runs at app startup instead of on the first request, see [Eager initialization](https://rennf93.github.io/fastapi-guard/latest/tutorial/first-steps/#eager-initialization-with-fastapi-lifespan). +For production, wire `guard.lifespan.guard_lifespan` into `FastAPI(lifespan=...)` so initialization runs at app startup instead of on the first request, see [Eager initialization](https://guard-core.github.io/fastapi-guard/latest/tutorial/first-steps/#eager-initialization-with-fastapi-lifespan). -A connection with no client address (a Unix domain socket, some serverless ASGI adapters) is rejected with 403 by default (`fail_secure=True`); set `fail_secure=False` to run the pipeline with identity `"unknown"` instead, allowed unless a whitelist or a country allow-list is configured (blacklist, country, and cloud checks cannot match without an address; detection and the shared rate-limit bucket still apply). Add the literal string `"unix"` to `trusted_proxies` to resolve the real client from `X-Forwarded-For` on such a connection, see [Proxy Security](https://rennf93.github.io/fastapi-guard/latest/tutorial/security/proxy-security/#unix-sockets-and-serverless-adapters). +A connection with no client address (a Unix domain socket, some serverless ASGI adapters) is rejected with 403 by default (`fail_secure=True`); set `fail_secure=False` to run the pipeline with identity `"unknown"` instead, allowed unless a whitelist or a country allow-list is configured (blacklist, country, and cloud checks cannot match without an address; detection and the shared rate-limit bucket still apply). Add the literal string `"unix"` to `trusted_proxies` to resolve the real client from `X-Forwarded-For` on such a connection, see [Proxy Security](https://guard-core.github.io/fastapi-guard/latest/tutorial/security/proxy-security/#unix-sockets-and-serverless-adapters). -`SecurityMiddleware` protects HTTP requests only; it never runs for WebSocket connections. Secure a `@app.websocket` route explicitly with `Depends(guard_websocket)`, see [WebSockets](https://rennf93.github.io/fastapi-guard/latest/tutorial/websockets/). +`SecurityMiddleware` protects HTTP requests only; it never runs for WebSocket connections. Secure a `@app.websocket` route explicitly with `Depends(guard_websocket)`, see [WebSockets](https://guard-core.github.io/fastapi-guard/latest/tutorial/websockets/). --- @@ -129,7 +130,7 @@ async def process_payment(): return {"status": "ok"} ``` -`require_auth` and `api_key_auth` require a verifier (per-route `verifier=` or global `SecurityConfig.auth_verifier`); without one the request is rejected with 401. For a presence-only `Authorization` header gate, use `require_authorization_header(scheme="bearer")` instead. See [the authentication tutorial](https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/authentication/) for the full migration. +`require_auth` and `api_key_auth` require a verifier (per-route `verifier=` or global `SecurityConfig.auth_verifier`); without one the request is rejected with 401. For a presence-only `Authorization` header gate, use `require_authorization_header(scheme="bearer")` instead. See [the authentication tutorial](https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/authentication/) for the full migration. **Available decorator categories:** @@ -140,7 +141,7 @@ async def process_payment(): - **Behavioral** --- `usage_monitor`, `return_monitor`, `suspicious_frequency`, `behavior_analysis` - **Advanced** --- `time_window`, `honeypot_detection`, `suspicious_detection` -[Full decorator reference](https://rennf93.github.io/fastapi-guard/latest/api/decorators/) +[Full decorator reference](https://guard-core.github.io/fastapi-guard/latest/api/decorators/) --- @@ -204,30 +205,30 @@ When the agent is disabled or failed to initialize, the property returns `{"enab ## Ecosystem -FastAPI Guard is built on [guard-core](https://github.com/rennf93/guard-core), a framework-agnostic security engine. The same protection is available across Python, TypeScript, and Rust. +FastAPI Guard is built on [guard-core](https://github.com/Guard-Core/guard-core), a framework-agnostic security engine. The same protection is available across Python, TypeScript, and Rust. ### Python | Package | Role | PyPI | |---|---|---| -| [guard-core](https://github.com/rennf93/guard-core) | Framework-agnostic security engine | [![PyPI](https://img.shields.io/pypi/v/guard-core)](https://pypi.org/project/guard-core/) | -| [guard-agent](https://github.com/rennf93/guard-agent) | Telemetry agent | [![PyPI](https://img.shields.io/pypi/v/guard-agent)](https://pypi.org/project/guard-agent/) | -| [fastapi-guard](https://github.com/rennf93/fastapi-guard) | FastAPI / Starlette adapter (this package) | [![PyPI](https://img.shields.io/pypi/v/fastapi-guard)](https://pypi.org/project/fastapi-guard/) | -| [flaskapi-guard](https://github.com/rennf93/flaskapi-guard) | Flask adapter | [![PyPI](https://img.shields.io/pypi/v/flaskapi-guard)](https://pypi.org/project/flaskapi-guard/) | -| [djapi-guard](https://github.com/rennf93/djapi-guard) | Django adapter | [![PyPI](https://img.shields.io/pypi/v/djapi-guard)](https://pypi.org/project/djapi-guard/) | -| [tornadoapi-guard](https://github.com/rennf93/tornadoapi-guard) | Tornado adapter | [![PyPI](https://img.shields.io/pypi/v/tornadoapi-guard)](https://pypi.org/project/tornadoapi-guard/) | +| [guard-core](https://github.com/Guard-Core/guard-core) | Framework-agnostic security engine | [![PyPI](https://img.shields.io/pypi/v/guard-core)](https://pypi.org/project/guard-core/) | +| [guard-agent](https://github.com/Guard-Core/guard-agent) | Telemetry agent | [![PyPI](https://img.shields.io/pypi/v/guard-agent)](https://pypi.org/project/guard-agent/) | +| [fastapi-guard](https://github.com/Guard-Core/fastapi-guard) | FastAPI / Starlette adapter (this package) | [![PyPI](https://img.shields.io/pypi/v/fastapi-guard)](https://pypi.org/project/fastapi-guard/) | +| [flaskapi-guard](https://github.com/Guard-Core/flaskapi-guard) | Flask adapter | [![PyPI](https://img.shields.io/pypi/v/flaskapi-guard)](https://pypi.org/project/flaskapi-guard/) | +| [djapi-guard](https://github.com/Guard-Core/djapi-guard) | Django adapter | [![PyPI](https://img.shields.io/pypi/v/djapi-guard)](https://pypi.org/project/djapi-guard/) | +| [tornadoapi-guard](https://github.com/Guard-Core/tornadoapi-guard) | Tornado adapter | [![PyPI](https://img.shields.io/pypi/v/tornadoapi-guard)](https://pypi.org/project/tornadoapi-guard/) | ### TypeScript / JavaScript -Published under the [`@guardcore`](https://www.npmjs.com/org/guardcore) npm scope. Source in the [guard-core-ts](https://github.com/rennf93/guard-core-ts) monorepo. **Production-ready.** +Published under the [`@guardcore`](https://www.npmjs.com/org/guardcore) npm scope. Source in the [guard-core-ts](https://github.com/Guard-Core/guard-core-ts) monorepo. **Production-ready.** | Package | Role | npm | |---|---|---| -| [@guardcore/core](https://github.com/rennf93/guard-core-ts/tree/master/packages/core) | Core engine | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fcore)](https://www.npmjs.com/package/@guardcore/core) | -| [@guardcore/express](https://github.com/rennf93/guard-core-ts/tree/master/packages/express) | Express adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fexpress)](https://www.npmjs.com/package/@guardcore/express) | -| [@guardcore/nestjs](https://github.com/rennf93/guard-core-ts/tree/master/packages/nestjs) | NestJS adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fnestjs)](https://www.npmjs.com/package/@guardcore/nestjs) | -| [@guardcore/fastify](https://github.com/rennf93/guard-core-ts/tree/master/packages/fastify) | Fastify adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Ffastify)](https://www.npmjs.com/package/@guardcore/fastify) | -| [@guardcore/hono](https://github.com/rennf93/guard-core-ts/tree/master/packages/hono) | Hono adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fhono)](https://www.npmjs.com/package/@guardcore/hono) | +| [@guardcore/core](https://github.com/Guard-Core/guard-core-ts/tree/master/packages/core) | Core engine | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fcore)](https://www.npmjs.com/package/@guardcore/core) | +| [@guardcore/express](https://github.com/Guard-Core/guard-core-ts/tree/master/packages/express) | Express adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fexpress)](https://www.npmjs.com/package/@guardcore/express) | +| [@guardcore/nestjs](https://github.com/Guard-Core/guard-core-ts/tree/master/packages/nestjs) | NestJS adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fnestjs)](https://www.npmjs.com/package/@guardcore/nestjs) | +| [@guardcore/fastify](https://github.com/Guard-Core/guard-core-ts/tree/master/packages/fastify) | Fastify adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Ffastify)](https://www.npmjs.com/package/@guardcore/fastify) | +| [@guardcore/hono](https://github.com/Guard-Core/guard-core-ts/tree/master/packages/hono) | Hono adapter | [![npm](https://img.shields.io/npm/v/%40guardcore%2Fhono)](https://www.npmjs.com/package/@guardcore/hono) | ### Rust @@ -235,17 +236,17 @@ Published on crates.io. **🚧 Placeholder crates: implementation in progress.** | Package | Role | crates.io | |---|---|---| -| [guard-core](https://github.com/rennf93/guard-core-rs) | Core engine | [![crates.io](https://img.shields.io/crates/v/guard-core)](https://crates.io/crates/guard-core) | -| [actix-guard-rs](https://github.com/rennf93/actix-guard-rs) | Actix adapter | [![crates.io](https://img.shields.io/crates/v/actix-guard-rs)](https://crates.io/crates/actix-guard-rs) | -| [axum-guard-rs](https://github.com/rennf93/axum-guard-rs) | Axum adapter | [![crates.io](https://img.shields.io/crates/v/axum-guard-rs)](https://crates.io/crates/axum-guard-rs) | -| [rocket-guard-rs](https://github.com/rennf93/rocket-guard-rs) | Rocket adapter | [![crates.io](https://img.shields.io/crates/v/rocket-guard-rs)](https://crates.io/crates/rocket-guard-rs) | -| [tower-guard-rs](https://github.com/rennf93/tower-guard-rs) | Tower adapter | [![crates.io](https://img.shields.io/crates/v/tower-guard-rs)](https://crates.io/crates/tower-guard-rs) | +| [guard-core](https://github.com/Guard-Core/guard-core-rs) | Core engine | [![crates.io](https://img.shields.io/crates/v/guard-core)](https://crates.io/crates/guard-core) | +| [actix-guard-rs](https://github.com/Guard-Core/actix-guard-rs) | Actix adapter | [![crates.io](https://img.shields.io/crates/v/actix-guard-rs)](https://crates.io/crates/actix-guard-rs) | +| [axum-guard-rs](https://github.com/Guard-Core/axum-guard-rs) | Axum adapter | [![crates.io](https://img.shields.io/crates/v/axum-guard-rs)](https://crates.io/crates/axum-guard-rs) | +| [rocket-guard-rs](https://github.com/Guard-Core/rocket-guard-rs) | Rocket adapter | [![crates.io](https://img.shields.io/crates/v/rocket-guard-rs)](https://crates.io/crates/rocket-guard-rs) | +| [tower-guard-rs](https://github.com/Guard-Core/tower-guard-rs) | Tower adapter | [![crates.io](https://img.shields.io/crates/v/tower-guard-rs)](https://crates.io/crates/tower-guard-rs) | ### AI Coding Agents | Package | Role | PyPI | |---|---|---| -| [guard-core-mcp](https://github.com/rennf93/guard-core-mcp) | MCP server: config validation, docs search, detection sandbox | [![PyPI](https://img.shields.io/pypi/v/guard-core-mcp)](https://pypi.org/project/guard-core-mcp/) | +| [guard-core-mcp](https://github.com/Guard-Core/guard-core-mcp) | MCP server: config validation, docs search, detection sandbox | [![PyPI](https://img.shields.io/pypi/v/guard-core-mcp)](https://pypi.org/project/guard-core-mcp/) | An MCP server that answers questions about FastAPI Guard from the version **installed in your project**, rather than from a model's memory of it. It validates a config against the real `SecurityConfig` model (catching silently-ignored typos like `redis_failopen`), looks up any field's type, default and description, searches the bundled docs, and runs a payload through the real detection engine to show whether it would be blocked and by which pattern. @@ -260,13 +261,13 @@ Install it into the same environment as FastAPI Guard; it introspects what is ac ## Documentation -- [Installation](https://rennf93.github.io/fastapi-guard/latest/installation/) -- [First Steps](https://rennf93.github.io/fastapi-guard/latest/tutorial/first-steps/) -- [Configuration Reference](https://rennf93.github.io/fastapi-guard/latest/tutorial/configuration/security-config/) -- [Decorator Reference](https://rennf93.github.io/fastapi-guard/latest/api/decorators/) -- [API Reference](https://rennf93.github.io/fastapi-guard/latest/api/overview/) -- [Example App](https://rennf93.github.io/fastapi-guard/latest/tutorial/examples/example-app/) -- [Redis Integration](https://rennf93.github.io/fastapi-guard/latest/tutorial/redis-integration/caching/) +- [Installation](https://guard-core.github.io/fastapi-guard/latest/installation/) +- [First Steps](https://guard-core.github.io/fastapi-guard/latest/tutorial/first-steps/) +- [Configuration Reference](https://guard-core.github.io/fastapi-guard/latest/tutorial/configuration/security-config/) +- [Decorator Reference](https://guard-core.github.io/fastapi-guard/latest/api/decorators/) +- [API Reference](https://guard-core.github.io/fastapi-guard/latest/api/overview/) +- [Example App](https://guard-core.github.io/fastapi-guard/latest/tutorial/examples/example-app/) +- [Redis Integration](https://guard-core.github.io/fastapi-guard/latest/tutorial/redis-integration/caching/) --- @@ -274,7 +275,7 @@ Install it into the same environment as FastAPI Guard; it introspects what is ac Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. -New security features (checks, detection patterns, handlers) should be contributed to [guard-core](https://github.com/rennf93/guard-core). This repo covers the FastAPI/Starlette adapter layer. +New security features (checks, detection patterns, handlers) should be contributed to [guard-core](https://github.com/Guard-Core/guard-core). This repo covers the FastAPI/Starlette adapter layer. --- @@ -286,4 +287,4 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file ## Author -[Renzo Franceschini](https://github.com/rennf93) +[Renzo Franceschini](https://github.com/Guard-Core) diff --git a/SECURITY.md b/SECURITY.md index fcde0bd6..72dec29b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,12 +16,12 @@ We take the security of FastAPI Guard seriously. If you believe you've found a s 1. **Do not disclose the vulnerability publicly** until it has been addressed by the maintainers. 2. **Report the vulnerability through GitHub's security advisory feature**: - - Go to the [Security tab](https://github.com/rennf93/fastapi-guard/security/advisories) of the FastAPI Guard repository + - Go to the [Security tab](https://github.com/Guard-Core/fastapi-guard/security/advisories) of the FastAPI Guard repository - Click on "New draft security advisory" - Fill in the details of the vulnerability - Submit the advisory - Alternatively, you can report vulnerabilities through [GitHub's private vulnerability reporting feature](https://github.com/rennf93/fastapi-guard/security/advisories/new). + Alternatively, you can report vulnerabilities through [GitHub's private vulnerability reporting feature](https://github.com/Guard-Core/fastapi-guard/security/advisories/new). 3. Include the following information in your report: - A description of the vulnerability and its potential impact @@ -83,7 +83,7 @@ FastAPI Guard provides several security features to protect your FastAPI applica - Country-based Access Control - Cloud Provider IP Blocking -For detailed information on configuring these features, refer to the [documentation](https://rennf93.github.io/fastapi-guard). +For detailed information on configuring these features, refer to the [documentation](https://guard-core.github.io/fastapi-guard). ## Threat Model diff --git a/context7.json b/context7.json index 835577f6..0f9f6f2d 100644 --- a/context7.json +++ b/context7.json @@ -1,4 +1,4 @@ { - "url": "https://context7.com/rennf93/fastapi-guard", + "url": "https://context7.com/Guard-Core/fastapi-guard", "public_key": "pk_Oa6yPCPtMpHNca5y8otCc" } diff --git a/docs/api/core-architecture.md b/docs/api/core-architecture.md index c88c7e05..7e453cfe 100644 --- a/docs/api/core-architecture.md +++ b/docs/api/core-architecture.md @@ -10,7 +10,7 @@ Core Architecture (Internal) ============================= !!! warning "Internal Implementation Details" - As of v5.0.0, all core modules live in the [guard-core](https://github.com/rennf93/guard-core) package (`guard_core/core/`). They should NOT be imported directly in user code. Always use the public API via `from guard import ...` or `from guard.middleware import SecurityMiddleware`. + As of v5.0.0, all core modules live in the [guard-core](https://github.com/Guard-Core/guard-core) package (`guard_core/core/`). They should NOT be imported directly in user code. Always use the public API via `from guard import ...` or `from guard.middleware import SecurityMiddleware`. This documentation is provided for contributors and advanced users who want to understand the internal architecture. diff --git a/docs/api/overview.md b/docs/api/overview.md index da46db5c..55876536 100644 --- a/docs/api/overview.md +++ b/docs/api/overview.md @@ -9,7 +9,7 @@ API Reference Overview ====================== !!! info "Architecture Update (v5.0.0)" - As of v5.0.0, FastAPI Guard is a thin adapter over [guard-core](https://github.com/rennf93/guard-core). All core security modules now live in the `guard_core` package. The public API remains unchanged — use `from guard import ...` for all imports. See [Core Architecture](core-architecture.md) for details. + As of v5.0.0, FastAPI Guard is a thin adapter over [guard-core](https://github.com/Guard-Core/guard-core). All core security modules now live in the `guard_core` package. The public API remains unchanged — use `from guard import ...` for all imports. See [Core Architecture](core-architecture.md) for details. ___ diff --git a/docs/index.md b/docs/index.md index a5ae8e12..f22206d2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,13 +11,13 @@ FastAPI Guard ![FastAPI Guard Logo](assets/fastapi_guard_legend.svg) [![PyPI version](https://badge.fury.io/py/fastapi-guard.svg?cache=none&icon=si%3Apython&icon_color=%23008cb4)](https://badge.fury.io/py/fastapi-guard) -[![Release](https://github.com/rennf93/fastapi-guard/actions/workflows/release.yml/badge.svg)](https://github.com/rennf93/fastapi-guard/actions/workflows/release.yml) +[![Release](https://github.com/Guard-Core/fastapi-guard/actions/workflows/release.yml/badge.svg)](https://github.com/Guard-Core/fastapi-guard/actions/workflows/release.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![CI](https://github.com/rennf93/fastapi-guard/actions/workflows/ci.yml/badge.svg)](https://github.com/rennf93/fastapi-guard/actions/workflows/ci.yml) -[![CodeQL](https://github.com/rennf93/fastapi-guard/actions/workflows/code-ql.yml/badge.svg)](https://github.com/rennf93/fastapi-guard/actions/workflows/code-ql.yml) +[![CI](https://github.com/Guard-Core/fastapi-guard/actions/workflows/ci.yml/badge.svg)](https://github.com/Guard-Core/fastapi-guard/actions/workflows/ci.yml) +[![CodeQL](https://github.com/Guard-Core/fastapi-guard/actions/workflows/code-ql.yml/badge.svg)](https://github.com/Guard-Core/fastapi-guard/actions/workflows/code-ql.yml) -[![pages-build-deployment](https://github.com/rennf93/fastapi-guard/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/rennf93/fastapi-guard/actions/workflows/pages/pages-build-deployment) -[![Docs Update](https://github.com/rennf93/fastapi-guard/actions/workflows/docs.yml/badge.svg)](https://github.com/rennf93/fastapi-guard/actions/workflows/docs.yml) +[![pages-build-deployment](https://github.com/Guard-Core/fastapi-guard/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/Guard-Core/fastapi-guard/actions/workflows/pages/pages-build-deployment) +[![Docs Update](https://github.com/Guard-Core/fastapi-guard/actions/workflows/docs.yml/badge.svg)](https://github.com/Guard-Core/fastapi-guard/actions/workflows/docs.yml) [![Downloads](https://pepy.tech/badge/fastapi-guard)](https://pepy.tech/project/fastapi-guard) `fastapi-guard` is a comprehensive security library for FastAPI applications, providing middleware to control IPs, log requests, and detect penetration attempts. It integrates seamlessly with FastAPI to offer robust protection against various security threats, ensuring your application remains secure and reliable. @@ -50,7 +50,7 @@ ___ Example App ----------- -Inside [examples](https://github.com/rennf93/fastapi-guard/tree/master/examples), you can find a simple example app that demonstrates how to use FastAPI Guard. +Inside [examples](https://github.com/Guard-Core/fastapi-guard/tree/master/examples), you can find a simple example app that demonstrates how to use FastAPI Guard. ___ @@ -68,14 +68,14 @@ ___ Docker Container ---------------- -You can also download the example app as a Docker container from [GitHub Container Registry](https://github.com/orgs/rennf93/packages/container/fastapi-guard-example). +You can also download the example app as a Docker container from [GitHub Container Registry](https://github.com/orgs/Guard-Core/packages/container/fastapi-guard-example). ```bash # Pull the latest version -docker pull ghcr.io/rennf93/fastapi-guard-example:latest +docker pull ghcr.io/guard-core/fastapi-guard-example:latest # Or pull a specific version (matches library releases) -docker pull ghcr.io/rennf93/fastapi-guard-example:v8.0.2 +docker pull ghcr.io/guard-core/fastapi-guard-example:v8.0.2 ``` ___ @@ -90,7 +90,7 @@ The easiest way to run the example app is with Docker Compose, which automatical ```bash # Clone the repository -git clone https://github.com/rennf93/fastapi-guard.git +git clone https://github.com/Guard-Core/fastapi-guard.git cd fastapi-guard/examples # Start the app with Redis @@ -106,14 +106,14 @@ Alternatively, you can run just the container: ```bash # Run with default settings -docker run -host 0.0.0.0 -p 8000:8000 ghcr.io/rennf93/fastapi-guard-example:latest +docker run -host 0.0.0.0 -p 8000:8000 ghcr.io/guard-core/fastapi-guard-example:latest # Run with custom Redis connection docker run -host 0.0.0.0 -p 8000:8000 \ -e REDIS_URL=redis://your-redis-host:your-redis-port \ -e REDIS_PREFIX=your-redis-prefix \ -e IPINFO_TOKEN=your-ipinfo-token \ - ghcr.io/rennf93/fastapi-guard-example:latest + ghcr.io/guard-core/fastapi-guard-example:latest ``` The example app includes endpoints to test various security features of FastAPI Guard. Access the Swagger documentation at after running the container. diff --git a/docs/llms.txt b/docs/llms.txt index 9c39a2ac..4efcd67f 100644 --- a/docs/llms.txt +++ b/docs/llms.txt @@ -1,6 +1,6 @@ # FastAPI Guard Documentation - LLMs.txt # For LLM Crawlers and AI Assistants -# Documentation Site: https://rennf93.github.io/fastapi-guard +# Documentation Site: https://guard-core.github.io/fastapi-guard ## Overview FastAPI Guard is a comprehensive security middleware for FastAPI applications, providing enterprise-grade protection with minimal configuration. This documentation site provides complete technical guides, API references, tutorials, and examples. @@ -8,105 +8,105 @@ FastAPI Guard is a comprehensive security middleware for FastAPI applications, p ## Documentation Structure ### Getting Started -- **Home**: https://rennf93.github.io/fastapi-guard/latest/ -- **Installation**: https://rennf93.github.io/fastapi-guard/latest/installation/ -- **First Steps**: https://rennf93.github.io/fastapi-guard/latest/tutorial/first-steps/ +- **Home**: https://guard-core.github.io/fastapi-guard/latest/ +- **Installation**: https://guard-core.github.io/fastapi-guard/latest/installation/ +- **First Steps**: https://guard-core.github.io/fastapi-guard/latest/tutorial/first-steps/ ### Core Features Documentation #### IP Management - **IP Banning**: Automatic and manual IP banning with threshold-based blocking - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/ip-management/banning/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/ip-management/banning/ - **Geolocation**: Country-based access control using IP geolocation - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/ip-management/geolocation/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/ip-management/geolocation/ - **Cloud Providers**: Block requests from AWS, GCP, Azure IP ranges - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/ip-management/cloud-providers/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/ip-management/cloud-providers/ - **Rate Limiting**: Global, per-endpoint, and geographic limits on a sliding-window-log algorithm - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/ip-management/rate-limiter/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/ip-management/rate-limiter/ #### Security Decorators - **Overview**: Route-level security with Python decorators - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/overview/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/overview/ - **Access Control**: IP whitelisting, blacklisting, country restrictions - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/access-control/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/access-control/ - **Authentication**: Bearer, Basic, API Key header validation - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/authentication/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/authentication/ - **Rate Limiting Decorators**: Per-route rate limits - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/rate-limiting/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/rate-limiting/ - **Behavioral Analysis**: Usage monitoring, return value monitoring - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/behavioral/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/behavioral/ - **Content Filtering**: Request/response content validation - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/content-filtering/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/content-filtering/ - **Advanced Decorators**: Combined security features - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/decorators/advanced/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/decorators/advanced/ #### Security Features - **Penetration Detection**: SQL injection, XSS, command injection detection - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/penetration-detection/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/penetration-detection/ - **Detection Engine**: Advanced pattern matching and threat detection - - Overview: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/detection-engine/overview/ - - Architecture: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/detection-engine/architecture/ - - Components: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/detection-engine/components/ - - Configuration: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/detection-engine/configuration/ - - Performance: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/detection-engine/performance-tuning/ + - Overview: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/detection-engine/overview/ + - Architecture: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/detection-engine/architecture/ + - Components: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/detection-engine/components/ + - Configuration: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/detection-engine/configuration/ + - Performance: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/detection-engine/performance-tuning/ - **Proxy Security**: Trusted proxy handling, X-Forwarded-For validation - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/proxy-security/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/proxy-security/ - **Custom Patterns**: Define custom attack patterns - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/custom-patterns/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/custom-patterns/ - **Security Monitoring**: Event tracking and analytics - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/security/monitoring/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/security/monitoring/ #### Configuration - **Security Config**: Complete configuration reference - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/configuration/security-config/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/configuration/security-config/ - **CORS**: Cross-Origin Resource Sharing setup - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/configuration/cors/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/configuration/cors/ - **Logging**: Security event logging configuration - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/configuration/logging/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/configuration/logging/ #### Redis Integration - **Distributed State**: Redis for multi-instance deployments - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/redis-integration/caching/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/redis-integration/caching/ #### Advanced Topics - **Advanced Customizations**: Custom request checks, response modifiers - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/advanced-customizations/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/advanced-customizations/ - **Example Application**: Complete working example - - Docs: https://rennf93.github.io/fastapi-guard/latest/tutorial/examples/example-app/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/tutorial/examples/example-app/ ### API Reference Complete API documentation for all classes and functions: -- **Overview**: https://rennf93.github.io/fastapi-guard/latest/api/overview/ +- **Overview**: https://guard-core.github.io/fastapi-guard/latest/api/overview/ - **SecurityMiddleware**: Main middleware class - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/security-middleware/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/security-middleware/ - **Core Architecture**: Internal architecture and design - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/core-architecture/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/core-architecture/ - **SecurityDecorators**: All decorator functions - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/decorators/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/decorators/ - **BehaviorManager**: Behavioral analysis manager - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/behavior-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/behavior-manager/ - **RedisManager**: Redis state management - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/redis-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/redis-manager/ - **IPBanManager**: IP banning logic - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/ipban-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/ipban-manager/ - **IPInfoManager**: IP geolocation - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/ipinfo-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/ipinfo-manager/ - **RateLimitManager**: Rate limiting algorithms - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/ratelimit-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/ratelimit-manager/ - **SusPatternsManager**: Suspicious pattern detection - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/sus-patterns/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/sus-patterns/ - **CloudManager**: Cloud provider IP management - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/cloud-manager/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/cloud-manager/ - **SecurityHeadersManager**: HTTP security headers - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/security-headers/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/security-headers/ - **Utilities**: Helper functions and utilities - - Docs: https://rennf93.github.io/fastapi-guard/latest/api/utilities/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/api/utilities/ ### Release Notes - **Changelog**: All version history and updates - - Docs: https://rennf93.github.io/fastapi-guard/latest/release-notes/ + - Docs: https://guard-core.github.io/fastapi-guard/latest/release-notes/ ## Key Features Explained @@ -255,15 +255,15 @@ No published fixed-number benchmarks; overhead depends heavily on which checks y ### Official Sites - **Main Website**: https://guard-core.com - **Playground**: https://playground.guard-core.com (Interactive demos) -- **Documentation**: https://rennf93.github.io/fastapi-guard/latest/ -- **GitHub**: https://github.com/rennf93/fastapi-guard +- **Documentation**: https://guard-core.github.io/fastapi-guard/latest/ +- **GitHub**: https://github.com/Guard-Core/fastapi-guard - **PyPI**: https://pypi.org/project/fastapi-guard/ ### Community -- **Issues**: https://github.com/rennf93/fastapi-guard/issues -- **Discussions**: https://github.com/rennf93/fastapi-guard/discussions -- **Contributing**: https://github.com/rennf93/fastapi-guard/blob/master/CONTRIBUTING.md -- **Security Policy**: https://github.com/rennf93/fastapi-guard/security/policy +- **Issues**: https://github.com/Guard-Core/fastapi-guard/issues +- **Discussions**: https://github.com/Guard-Core/fastapi-guard/discussions +- **Contributing**: https://github.com/Guard-Core/fastapi-guard/blob/master/CONTRIBUTING.md +- **Security Policy**: https://github.com/Guard-Core/fastapi-guard/security/policy ### FastAPI Resources - **FastAPI Docs**: https://fastapi.tiangolo.com @@ -295,7 +295,7 @@ API reference auto-generated from Python docstrings using mkdocstrings. - **GitHub Issues**: Bug reports and feature requests - **GitHub Discussions**: Questions and community support - **Security Issues**: Report via GitHub Security Advisories -- **Author**: Renzo Franceschini (rennf93) +- **Author**: Renzo Franceschini (Guard-Core) ## License MIT License - Free for commercial and personal use. @@ -306,4 +306,4 @@ This documentation covers all versions of FastAPI Guard. Use the version selecto Default version: latest (stable) Provider: Mike (MkDocs versioning) -Versions JSON: https://rennf93.github.io/fastapi-guard/versions.json +Versions JSON: https://guard-core.github.io/fastapi-guard/versions.json diff --git a/docs/robots.txt b/docs/robots.txt index db406d97..1c5bf664 100644 --- a/docs/robots.txt +++ b/docs/robots.txt @@ -1,3 +1,3 @@ User-agent: * Allow: / -Sitemap: https://rennf93.github.io/fastapi-guard/sitemap.xml \ No newline at end of file +Sitemap: https://guard-core.github.io/fastapi-guard/sitemap.xml \ No newline at end of file diff --git a/docs/tutorial/configuration/telemetry.md b/docs/tutorial/configuration/telemetry.md index 8b565a09..f0f1c313 100644 --- a/docs/tutorial/configuration/telemetry.md +++ b/docs/tutorial/configuration/telemetry.md @@ -7,7 +7,7 @@ description: OpenTelemetry, Logfire, and event/metric/log muting for FastAPI Gua # Telemetry -FastAPI Guard emits security events and request metrics through a composable telemetry pipeline provided by [guard-core](https://github.com/rennf93/guard-core). Events can be muted, metrics can be muted, individual security-check logs can be muted, and exports to OpenTelemetry and Logfire are opt-in. +FastAPI Guard emits security events and request metrics through a composable telemetry pipeline provided by [guard-core](https://github.com/Guard-Core/guard-core). Events can be muted, metrics can be muted, individual security-check logs can be muted, and exports to OpenTelemetry and Logfire are opt-in. The middleware installs and tears down the telemetry pipeline automatically — you only set fields on `SecurityConfig`. @@ -189,7 +189,7 @@ When `enable_enrichment=True`, every event and every metric routed through the m | `guard.behavior.correlation_key` | `str` (16-char hex) | SHA-256 prefix of `ip \| service \| floor(now/300)` — stable within a 5-minute window | events only | | `guard.behavior.recent_event_count` | `int` | Total events observed from the IP across all endpoints in the last 5 minutes | events only | -All fields are nullable; absence = unavailable context. Every exporter (guard-agent, OTel, Logfire) sees the same enriched payload. See the [guard-core telemetry reference](https://github.com/rennf93/guard-core/blob/master/docs/architecture/telemetry.md) for the full behavior spec. +All fields are nullable; absence = unavailable context. Every exporter (guard-agent, OTel, Logfire) sees the same enriched payload. See the [guard-core telemetry reference](https://github.com/Guard-Core/guard-core/blob/master/docs/architecture/telemetry.md) for the full behavior spec. ## Incoming `traceparent` @@ -218,4 +218,4 @@ The error message lists the valid values. Common typos: `"suspicious"` instead o ## Reference -The full field schema and pipeline behaviour is maintained in the [guard-core telemetry reference](https://github.com/rennf93/guard-core/blob/master/docs/architecture/telemetry.md). +The full field schema and pipeline behaviour is maintained in the [guard-core telemetry reference](https://github.com/Guard-Core/guard-core/blob/master/docs/architecture/telemetry.md). diff --git a/docs/tutorial/decorators/overview.md b/docs/tutorial/decorators/overview.md index 0ae8f454..7c00e4d3 100644 --- a/docs/tutorial/decorators/overview.md +++ b/docs/tutorial/decorators/overview.md @@ -248,7 +248,7 @@ app.include_router(admin, prefix="/v1") # /v1/admin/billing/invoices There is no nesting limit. Routers included into routers, sub-applications mounted into sub-applications, and any mix of the two all resolve, and the decorator on `invoices` is enforced at whatever depth it ends up. !!! warning "Versions before 7.3.1" - Route resolution stopped after eight levels of mounts, and never descended past one level of `include_router()`. Decorators on routes below those limits silently did nothing — including `require_auth`, which meant an endpoint served unauthenticated. See [GHSA-f2vm-w8gq-h378](https://github.com/rennf93/fastapi-guard/security/advisories/GHSA-f2vm-w8gq-h378). If you compose your app from nested routers or mounts, upgrade. + Route resolution stopped after eight levels of mounts, and never descended past one level of `include_router()`. Decorators on routes below those limits silently did nothing — including `require_auth`, which meant an endpoint served unauthenticated. See [GHSA-f2vm-w8gq-h378](https://github.com/Guard-Core/fastapi-guard/security/advisories/GHSA-f2vm-w8gq-h378). If you compose your app from nested routers or mounts, upgrade. A request that reaches a mounted application guard-core does not route for — `StaticFiles`, a WSGI app, any opaque ASGI app — has no endpoint to decorate, so per-route checks do not apply to it and global `SecurityConfig` settings govern instead. diff --git a/docs/tutorial/examples/example-app.md b/docs/tutorial/examples/example-app.md index 871ba422..4a43f0f3 100644 --- a/docs/tutorial/examples/example-app.md +++ b/docs/tutorial/examples/example-app.md @@ -8,7 +8,7 @@ keywords: fastapi-guard example, example application, security middleware demo, Example Application =================== -The repository ships two runnable example apps under [`examples/`](https://github.com/rennf93/fastapi-guard/tree/master/examples): `simple_app`, a single-file app that exercises every security feature, and `advanced_app`, a production-shaped deployment (nginx, gunicorn, modular routers) built on the same configuration. Both wire `fastapi-guard` correctly, including eager initialization via `make_lifespan`, so their startup logs show the real `guard-core` pipeline output. +The repository ships two runnable example apps under [`examples/`](https://github.com/Guard-Core/fastapi-guard/tree/master/examples): `simple_app`, a single-file app that exercises every security feature, and `advanced_app`, a production-shaped deployment (nginx, gunicorn, modular routers) built on the same configuration. Both wire `fastapi-guard` correctly, including eager initialization via `make_lifespan`, so their startup logs show the real `guard-core` pipeline output. ___ @@ -32,7 +32,7 @@ ___ simple_app ---------- -[`examples/simple_app/main.py`](https://github.com/rennf93/fastapi-guard/blob/master/examples/simple_app/main.py) is a single file that configures `SecurityConfig`, wires `SecurityMiddleware`, wires the readiness route (`guard.status.add_status_route`), and defines every route group behind a `SecurityDecorator`: +[`examples/simple_app/main.py`](https://github.com/Guard-Core/fastapi-guard/blob/master/examples/simple_app/main.py) is a single file that configures `SecurityConfig`, wires `SecurityMiddleware`, wires the readiness route (`guard.status.add_status_route`), and defines every route group behind a `SecurityDecorator`: ```python from guard import SecurityConfig, SecurityDecorator, SecurityMiddleware @@ -96,7 +96,7 @@ ___ advanced_app ------------ -[`examples/advanced_app/`](https://github.com/rennf93/fastapi-guard/tree/master/examples/advanced_app) is the same security surface split into modular routers behind nginx and gunicorn, meant to model a production layout. See its own [README](https://github.com/rennf93/fastapi-guard/blob/master/examples/advanced_app/README.md) for the full architecture diagram and endpoint list. +[`examples/advanced_app/`](https://github.com/Guard-Core/fastapi-guard/tree/master/examples/advanced_app) is the same security surface split into modular routers behind nginx and gunicorn, meant to model a production layout. See its own [README](https://github.com/Guard-Core/fastapi-guard/blob/master/examples/advanced_app/README.md) for the full architecture diagram and endpoint list. ```bash cd examples/advanced_app diff --git a/docs/tutorial/integration.md b/docs/tutorial/integration.md index ade1482c..5f0031dc 100644 --- a/docs/tutorial/integration.md +++ b/docs/tutorial/integration.md @@ -258,7 +258,7 @@ Configuration reference — agent fields on `SecurityConfig` | `agent_api_key` | `str \| None` | `None` | Required when `enable_agent=True`. | | `agent_project_id` | `str \| None` | `None` | The `proj_*` ID from the dashboard. Required for dashboard attribution. | | `agent_endpoint` | `str` | `https://api.guard-core.com` | Override only for self-hosted Guard Core deploys. | -| `agent_buffer_size` | `int` | `100` | In-memory event buffer cap. The SaaS caps request bodies at 256 KiB, and a flush serializes the whole buffer into one POST, so keep this at the default (or lower for verbose events) instead of raising it toward thousands; prefer a shorter `agent_flush_interval` for lower latency. See [the agent integration reference](https://github.com/rennf93/fastapi-guard/blob/master/guard/.agents/skills/fastapi-guard/references/agent-integration.md) for the split-or-drop behavior if a batch does 413. | +| `agent_buffer_size` | `int` | `100` | In-memory event buffer cap. The SaaS caps request bodies at 256 KiB, and a flush serializes the whole buffer into one POST, so keep this at the default (or lower for verbose events) instead of raising it toward thousands; prefer a shorter `agent_flush_interval` for lower latency. See [the agent integration reference](https://github.com/Guard-Core/fastapi-guard/blob/master/guard/.agents/skills/fastapi-guard/references/agent-integration.md) for the split-or-drop behavior if a batch does 413. | | `agent_flush_interval` | `int` | `30` | Seconds between automatic buffer flushes. `2` is a reasonable production setting. | | `agent_enable_events` | `bool` | `True` | Ship security events. | | `agent_enable_metrics` | `bool` | `True` | Ship request metrics. | diff --git a/guard/.agents/skills/fastapi-guard/SKILL.md b/guard/.agents/skills/fastapi-guard/SKILL.md index 94ec3da1..d88486f0 100644 --- a/guard/.agents/skills/fastapi-guard/SKILL.md +++ b/guard/.agents/skills/fastapi-guard/SKILL.md @@ -202,17 +202,17 @@ The buffer/flush defaults (100 events, 30s) are safe. Do not raise `agent_buffer ## Tooling -* Docs: +* Docs: * Playground: * Dashboard: * Use `uv` for package management and Ruff for linting when applicable. ## Related Projects -* [guard-core](https://github.com/rennf93/guard-core): framework-agnostic security engine this adapter wraps. -* [flaskapi-guard](https://github.com/rennf93/flaskapi-guard): Flask extension adapter (sync mirror). -* [djapi-guard](https://github.com/rennf93/djapi-guard): Django middleware adapter (sync mirror). -* [tornadoapi-guard](https://github.com/rennf93/tornadoapi-guard): Tornado handler/middleware adapter. -* [guard-agent](https://github.com/rennf93/guard-agent): telemetry client used by `enable_agent=True`. -* [guard-core-mcp](https://github.com/rennf93/guard-core-mcp): MCP server for config validation and docs search. -* [guard-core-app](https://github.com/rennf93/guard-core-app): SaaS platform the agent reports to. +* [guard-core](https://github.com/Guard-Core/guard-core): framework-agnostic security engine this adapter wraps. +* [flaskapi-guard](https://github.com/Guard-Core/flaskapi-guard): Flask extension adapter (sync mirror). +* [djapi-guard](https://github.com/Guard-Core/djapi-guard): Django middleware adapter (sync mirror). +* [tornadoapi-guard](https://github.com/Guard-Core/tornadoapi-guard): Tornado handler/middleware adapter. +* [guard-agent](https://github.com/Guard-Core/guard-agent): telemetry client used by `enable_agent=True`. +* [guard-core-mcp](https://github.com/Guard-Core/guard-core-mcp): MCP server for config validation and docs search. +* [guard-core-app](https://github.com/Guard-Core/guard-core-app): SaaS platform the agent reports to. diff --git a/mkdocs.yml b/mkdocs.yml index 40cecc5e..ce1384c5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,8 +1,8 @@ site_name: FastAPI Guard site_description: Security middleware for FastAPI applications -site_url: https://rennf93.github.io/fastapi-guard/latest/ -repo_name: rennf93/fastapi-guard -repo_url: https://github.com/rennf93/fastapi-guard +site_url: https://guard-core.github.io/fastapi-guard/latest/ +repo_name: Guard-Core/fastapi-guard +repo_url: https://github.com/Guard-Core/fastapi-guard edit_uri: edit/master/docs/ theme: @@ -135,7 +135,7 @@ plugins: extra: social: - icon: fontawesome/brands/github - link: https://github.com/rennf93/fastapi-guard + link: https://github.com/Guard-Core/fastapi-guard - icon: fontawesome/brands/python link: https://pypi.org/project/fastapi-guard/ @@ -151,7 +151,7 @@ extra: - property: og:description content: Comprehensive security library for FastAPI applications providing IP control, request logging, and penetration detection - property: og:image - content: https://rennf93.github.io/fastapi-guard/latest/assets/fastapi_guard_legend.svg + content: https://guard-core.github.io/fastapi-guard/latest/assets/fastapi_guard_legend.svg - name: keywords content: fastapi, security, middleware, python, ip control, rate limiting, penetration detection @@ -163,7 +163,7 @@ extra: author: name: Renzo Franceschini - url: https://github.com/rennf93 + url: https://github.com/Guard-Core copyright: FastAPI Guard by diff --git a/pyproject.toml b/pyproject.toml index b58dd844..7b65bc16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "fastapi_guard" version = "8.0.2" description = "Production-ready security middleware for FastAPI — IP filtering, rate limiting, penetration detection, and 20+ per-route security decorators." authors = [ - {name = "Renzo Franceschini", email = "rennf93@users.noreply.github.com"} + {name = "Renzo Franceschini", email = "rennf93@guard-core.com"} ] readme = "README.md" license = "MIT" @@ -44,10 +44,10 @@ dependencies = [ [project.urls] Homepage = "https://guard-core.com" -Documentation = "https://rennf93.github.io/fastapi-guard/latest/" -Repository = "https://github.com/rennf93/fastapi-guard" -Changelog = "https://github.com/rennf93/fastapi-guard/blob/master/CHANGELOG.md" -"Bug Tracker" = "https://github.com/rennf93/fastapi-guard/issues" +Documentation = "https://guard-core.github.io/fastapi-guard/latest/" +Repository = "https://github.com/Guard-Core/fastapi-guard" +Changelog = "https://github.com/Guard-Core/fastapi-guard/blob/master/CHANGELOG.md" +"Bug Tracker" = "https://github.com/Guard-Core/fastapi-guard/issues" "Cloud Dashboard" = "https://app.guard-core.com" "Live Playground" = "https://playground.guard-core.com" From 89a770541adba8b7f368fc3c855f04c3933b6be8 Mon Sep 17 00:00:00 2001 From: Renn F Date: Thu, 8 Oct 2026 13:51:16 +0200 Subject: [PATCH 2/2] fix(docs): double dash on the docker run host flag --- docs/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index f22206d2..77f2136b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -106,10 +106,10 @@ Alternatively, you can run just the container: ```bash # Run with default settings -docker run -host 0.0.0.0 -p 8000:8000 ghcr.io/guard-core/fastapi-guard-example:latest +docker run --host 0.0.0.0 -p 8000:8000 ghcr.io/guard-core/fastapi-guard-example:latest # Run with custom Redis connection -docker run -host 0.0.0.0 -p 8000:8000 \ +docker run --host 0.0.0.0 -p 8000:8000 \ -e REDIS_URL=redis://your-redis-host:your-redis-port \ -e REDIS_PREFIX=your-redis-prefix \ -e IPINFO_TOKEN=your-ipinfo-token \