Skip to content

Release/hardening#11

Merged
rennf93 merged 5 commits into
masterfrom
release/hardening
Apr 27, 2026
Merged

Release/hardening#11
rennf93 merged 5 commits into
masterfrom
release/hardening

Conversation

@rennf93
Copy link
Copy Markdown
Owner

@rennf93 rennf93 commented Apr 27, 2026

No description provided.

rennf93 added 5 commits April 27, 2026 08:53
Companion to guard-core 2.2.0 and guard-agent 2.3.0. Pipeline-first CORS in the FlaskAPIGuard extension via guard_core.sync.handlers.cors_handler.

- _before_request now runs the security pipeline for every method including OPTIONS preflight. Preflights were previously short- circuited inside the extension before the pipeline ran; banned IPs could preflight freely.

- Preflight handling moved BEFORE the passthrough / bypass check so cross-origin preflights to excluded paths (e.g. /health) still receive a valid CORS response. Passthrough and bypass return paths now also inject CORS headers via _attach_cors_to_blocked.

- _after_request injects CORS headers via the shared guard_core.sync.handlers.cors_handler.CorsHandler module.

- Removed every [[tool.mypy.overrides]] suppression block (ignore_missing_imports = true / follow_imports = 'skip' / disallow_untyped_decorators = false). Replaced with proper stubs (django-stubs) and inline-typed packages.

- Removed every # type: ignore from edited files.

- Stripped [tool.uv.sources] guard-core local-path block from committed pyproject.toml.

- Added guard-agent to dev dependencies (was missing -- only mentioned in deptry's per_rule_ignores). Tests exercising agent integration via enable_agent=True now have an explicit declared dev dep.

- Test infrastructure: added two regression tests proving cross-origin preflight + GET to excluded paths both work correctly with CORS.

Full suite: 216 passed, 100% line + 100% branch coverage. Quality suite (mypy / ruff / vulture / bandit / radon / xenon / deptry) clean. 0 added suppressions. See CHANGELOG.md.

BREAKING CHANGE: CORS is configured purely via SecurityConfig.cors_* fields and activates automatically inside the FlaskAPIGuard extension. There is no separate configure_cors entry point. OPTIONS preflight requests are now subject to the full security pipeline.
@rennf93 rennf93 self-assigned this Apr 27, 2026
@github-actions github-actions Bot added the area: extension Touches flaskapi_guard/extension.py (Flask extension hook) label Apr 27, 2026
@rennf93 rennf93 merged commit bd8a04c into master Apr 27, 2026
8 of 10 checks passed
@rennf93 rennf93 deleted the release/hardening branch April 27, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: extension Touches flaskapi_guard/extension.py (Flask extension hook)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant