feat: initial support for route and HTTP method introspection#3594
feat: initial support for route and HTTP method introspection#3594dertin wants to merge 39 commits intoactix:mainfrom
Conversation
…oval and fix test failures
…nto introspection
…nto introspection
…nto introspection
|
Hi, @robjtede Here's a limited-scope approach for listing routes and methods from the Please review and let me know your thoughts! |
… usage - Added `GuardDetail` enum to encapsulate various introspection details of a guard. - Refactored `HttpMethodsExtractor` implementation to use `GuardDetail` instead of `downcast_ref`.
… usage - Added `GuardDetail` enum to encapsulate various introspection details of a guard. - Refactored `HttpMethodsExtractor` implementation to use `GuardDetail` instead of `downcast_ref`.
…nto introspection
… `experimental-introspection` - Refactored introspection logic. - Enhanced route introspection to register HTTP methods and guard names. - Added example for testing the experimental introspection feature.
…e registration and full path tracking
…h multiple App instances
- Introduced a new `experimental-introspection` feature that provides comprehensive reports on configured routes, including paths, methods, guards, and resource metadata. - Added support for reachability hints to identify shadowed or conflicting routes. - Implemented new endpoints for external resources reporting. - Updated existing route registration to include detailed introspection data. - Enhanced guard implementations to provide introspection details.
|
Hi @robjtede I’ve finished the work on this PR. It adds the experimental introspection feature, JSON and plain-text reports, includes examples, unit and integration tests, and the corresponding CHANGELOG entry. If you notice anything missing, please let me know. Could you take a look when you have a moment? If you’d like to make further changes or prefer a different approach for any part of the implementation, I’ll be happy to revise it. Thanks! |
PR Type
Feature
PR Checklist
Overview
Hello, this is my first contribution to the project. This PR introduces a new resource introspection feature for actix-web that allows retrieving all configured route paths along with their associated HTTP methods after the server has started. Currently, it supports only basic
Guardsthat determine HTTP methods. The feature is activated using theexperimental-introspectionfeature flag.I developed this feature because it's extremely useful for auditing services with many route paths that change constantly. I hope it proves valuable for others as well, and I welcome any feedback or suggestions for improvement.
Closes #1462
Closes #2677