Enable automatic plugin registration in middleware#930
Enable automatic plugin registration in middleware#930
Conversation
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
traeok
left a comment
There was a problem hiding this comment.
Thanks Timothy, changes look good but I have a couple requests around separation of concerns
|
Can you share a little more about what this does exactly? I'm not clear what automatic registration means |
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Currently for commands that are added to core The automatic registration is something unique to plug-ins since we don't have a way for them to directly register commands with the middleware. it allows plug-in APIs to be called via the middleware, but doesn't provide schema validation. I think long-term it'd be ideal to refactor our middleware command registration, to eliminate tech debt:
Created #937 to track these as future enhancements 😋 |
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
| void register_commands_with_server(CommandDispatcher &dispatcher) | ||
| { | ||
| const std::set<parser::command_ptr> &server_commands = pm.get_server_commands(); | ||
| const auto &server_commands = core::get_plugin_manager()->get_server_commands(); |
There was a problem hiding this comment.
(nit) since core::get_plugin_manager returns a pointer, security scanning tools could flag it as possible use of an invalid pointer. That said, its always valid when this function is called, so I'm not requesting changes - but a sanity check for nullptr would avoid any false positive detections.
|


What It Does
Also fixes #929
How to Test
Run
zowex serverand execute an RPC plug-in command:{"id":1,"jsonrpc":"2.0","method":"sample.hello","params":{"name":"doggo"}}Review Checklist
I certify that I have:
Additional Comments