-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support intercept specified command handler #2587
support intercept specified command handler #2587
Conversation
Any suggestions on this PR? @cdfive @brotherlu-xcq @alibaba/sentinel-committer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icodening Nice work. but I think we need more discussion about your design. when one handler has more than one interceptors, I think we need execute all the interceptors if no one fail. and could you provide a flow chart to help us to know your idea?
this is a simple flow chart |
...-transport-common/src/main/java/com/alibaba/csp/sentinel/command/CommandHandlerProvider.java
Outdated
Show resolved
Hide resolved
...-transport-common/src/main/java/com/alibaba/csp/sentinel/command/CommandHandlerProvider.java
Outdated
Show resolved
Hide resolved
...-transport-common/src/main/java/com/alibaba/csp/sentinel/command/CommandHandlerProvider.java
Outdated
Show resolved
Hide resolved
...ommon/src/main/java/com/alibaba/csp/sentinel/command/handler/InterceptingCommandHandler.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for contributing and look forward to more! |
* support intercept specified command handler * add unit test and demo
Describe what this PR does / why we need it
support intercept specified command handler
example, users can extend support for authentication, suitable for "Zero Trust" network architecture
Does this pull request fix one issue?
Fixes #2578
Describe how you did it
wrap command handlers when based on conditions
Describe how to verify it
implement 'com.alibaba.csp.sentinel.command.CommandHandlerInterceptor' interface, and add file 'com.alibaba.csp.sentinel.command.CommandHandlerInterceptor' in META-INF/services dir
Special notes for reviews
example: