Skip to content

Refactor middleware#3

Merged
ScriptSmith merged 1 commit intomainfrom
middleware-refactor
Mar 3, 2026
Merged

Refactor middleware#3
ScriptSmith merged 1 commit intomainfrom
middleware-refactor

Conversation

@ScriptSmith
Copy link
Owner

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Mar 3, 2026

Greptile Summary

Reorganized middleware module structure by creating two subdirectories: layers/ for actual Axum middleware and util/ for internal helper functions.

Key changes:

  • Moved 6 middleware layers into src/middleware/layers/: admin, api (renamed from combined), authz, rate_limit, request_id, security_headers
  • Moved 3 internal utilities into src/middleware/util/: budget, scope, usage
  • Updated all import paths throughout the affected files to reflect new structure
  • Maintained all public exports from middleware/mod.rs, ensuring no breaking changes for consumers
  • Improved naming: combined.rsapi.rs for better semantic clarity

Review findings:

  • All import path updates are correct and consistent
  • Module visibility (pub(crate)) is appropriately maintained
  • No logic changes, purely structural refactoring
  • Public API surface remains unchanged

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • This is a pure refactoring that only reorganizes file structure and updates import paths. No logic changes were made, all public exports are maintained, and all import path updates are correct and consistent. The refactoring improves code organization without introducing any behavioral changes or breaking the public API.
  • No files require special attention

Important Files Changed

Filename Overview
src/middleware/layers/api.rs Renamed from combined.rs to api.rs, updated imports to reference new util module structure
src/middleware/layers/mod.rs New module file that exports all middleware layers (admin, api, authz, rate_limit, request_id, security_headers)
src/middleware/mod.rs Updated module structure to organize middleware into layers and util subdirectories, maintained all public exports
src/middleware/util/mod.rs New module file that exports utility helpers (budget, scope, usage)

Last reviewed commit: b6b9411

@ScriptSmith ScriptSmith merged commit d92daca into main Mar 3, 2026
19 checks passed
@ScriptSmith ScriptSmith deleted the middleware-refactor branch March 3, 2026 12:10
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.

1 participant