Ostorlab / oxo

OXO is a security scanning orchestrator for the modern age.
https://oxo.ostorlab.co
Apache License 2.0
510 stars 52 forks source link

question: custom message protos #750

Open laurentsimon opened 1 month ago

laurentsimon commented 1 month ago

This issue is a question, not a feature request.

IIUC, messages must be one of the protos defined in https://github.com/Ostorlab/oxo/blob/main/src/ostorlab/agent/message/proto/v3.

So to customize the protos, I may use the control proto and define my own format in the message field?

I'm not sure that's the intended way, and I'd like some feedback whether there's a cleaner way to achieve what I'm asking.

Thanks!

3asm commented 1 month ago

You can do that, you can also use the emit_raw method that accepts a byte and formats the message in whatever serialization format you want.

The API accepts a selector, message, and optional message_id.

The selector will ensure the message is routed to the agents listening to the target selector.

For the listening agent, instead of implementing the process method, you should implement the process_message.