You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code for sending to targets should not expect that the payload is a policy report. instead it should treat it as an arbitrary object and interact with it through a generic interface. this would allow the later expansion of the tool to support sending things other than policy reports.
Ideally, the code can depend on something like type Payload interface. and any data that we want to send with the reporter can implement this interface. The description of this interface is still to be discussed. Some of the starting methods can be
typePayloadinterface {
Timestamp() time.Time// returns the time this payload was created inBody() map[string]interface{} // returns the payload in json format
}
Some targets already transform the result into a json serializable struct (s3, webhook, gcs, kinesis, elasticsearch), while others (slack, telegram, loki) do destination specific transformations that may not be very straightforward to make generic.
The code for sending to targets should not expect that the payload is a policy report. instead it should treat it as an arbitrary object and interact with it through a generic interface. this would allow the later expansion of the tool to support sending things other than policy reports.
Ideally, the code can depend on something like
type Payload interface
. and any data that we want to send with the reporter can implement this interface. The description of this interface is still to be discussed. Some of the starting methods can beSome targets already transform the result into a json serializable struct (s3, webhook, gcs, kinesis, elasticsearch), while others (slack, telegram, loki) do destination specific transformations that may not be very straightforward to make generic.
cc: @fjogeleit @JimBugwadia
The text was updated successfully, but these errors were encountered: