implementation of custom Exporter/Tracker
RegisterTracker to allow for custom trackers to be implemented beyond Jira/Github/Gitlab
RegisterExporter to allow for custom exporters to be implemented beyond Sarif/Disk
@@ -98,6 +98,10 @@ type Client struct {
// New creates a new nuclei issue tracker reporting client
func New(options *Options, db string) (*Client, error) {
+ if options == nil {
+ return nil, errors.New("no options passed")
+ }
+
if options.AllowList != nil {
options.AllowList.Compile()
}
@@ -141,6 +145,7 @@ func New(options *Options, db string) (*Client, error) {
}
client.exporters = append(client.exporters, exporter)
}
+
storage, err := dedupe.New(db)
if err != nil {
return nil, err
@@ -149,6 +154,16 @@ func New(options *Options, db string) (*Client, error) {
return client, nil
}
+// RegisterTracker registers a custom tracker to the reporter
+func (c *Client) RegisterTracker(tracker Tracker) {
+ c.trackers = append(c.trackers, tracker)
+}
+
+// RegisterExporter registers a custom exporter to the reporter
+func (c *Client) RegisterExporter(exporter Exporter) {
+ c.exporters = append(c.exporters, exporter)
+}
+
// Close closes the issue tracker reporting client
func (c *Client) Close() {
c.dedupe.Close()
