Releases: georgekhananaev/fastapi-docshield
Releases · georgekhananaev/fastapi-docshield
v0.2.1
Version 0.2.1 (2025-08-17)
- Fixed: Blank page issue after authentication for some users
- Improved handling of custom URL parameters by storing them as instance variables
- Simplified
_setup_routes()method for better maintainability - Applied fix from PR #2 for more robust URL parameter handling
- Fixed: Route removal logic now correctly removes all default documentation routes
- Properly removes
/docs,/redoc, and/openapi.jsonendpoints - Prevents 500 errors when accessing old endpoints
- Properly removes
- Improved: Example files and documentation
- Fixed
custom_styling.pyto work with uvicorn by adding default app variable - Standardized credentials across all custom styling examples
- Added
python-multipartto dev dependencies for form data handling - Added clear run instructions in example files
- Fixed
Full Changelog: v0.2.0...v0.2.1
v0.2.0
- Added: Custom CSS and JavaScript injection support
- New
custom_cssparameter to inject custom styles into documentation pages - New
custom_jsparameter to inject custom JavaScript for enhanced functionality - Complete customization examples for dark theme, minimal theme, corporate branding, and analytics
- Support for both Swagger UI and ReDoc customization
- New
- Added: Automatic CDN fallback to local files for better reliability
- Documentation now automatically falls back to bundled static files if CDN is unavailable
- New
prefer_localoption to always serve from local files - New
use_cdn_fallbackoption to control fallback behavior - Bundled Swagger UI and ReDoc static files for offline capability
- Fixed: Static file URL bug that caused blank documentation pages
- Previously, when no custom CDN URLs were provided, the package would pass
Nonevalues to FastAPI's documentation functions - This resulted in HTML with
href="None"andsrc="None", causing white/blank pages - Now properly handles default CDN URLs when custom URLs are not specified
- Previously, when no custom CDN URLs were provided, the package would pass
Full Changelog: v0.1.0...v0.2.0
v0.1.0
FastAPI DocShield v0.1.0 - Initial Release
A lightweight FastAPI middleware that protects your API documentation endpoints with authentication.
Features
- Simple integration with FastAPI applications
- Protects Swagger UI, ReDoc, and OpenAPI JSON/YAML endpoints
- Customizable authentication methods
- Minimal performance impact
- Fully tested with Python 3.7-3.13
Usage
from fastapi import FastAPI
from fastapi_docshield import DocShield
app = FastAPI()
DocShield(app, username="admin", password="secure_password")
This is the first stable release of FastAPI DocShield.