aggregator

command
v0.25.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

Enricher Aggregator

This Aggregator ensures that each enriched issue is sent to consumers only once and with all its annotations from all the enrichers that ran on it. If you are using multiple enrichers it is highly recommended you add this aggregation step. On top of aggregating, it can optionally append a signature to the message.

Signing

Signing is achieved using libsodium's golang.org/x/crypto/nacl sign package. The aggregator expects a base64 encoded, 64 byte private key to be provided as a Task parameter. If the key is provided, each Enriched Result will have an annotation named "JSON-Message-Signature". The value of "JSON-Message-Signature" will be the signed message serialised in JSON and base64 encoded.

You can validate the signature by running

decoded, _ := base64.StdEncoding.DecodeString(issue.Annotations["JSON-Message-Signature"])
_, valid := sign.Open(nil, decoded, publicKey)
assert.True(t, valid)

A key set can be generated by running:

public, private, err := sign.GenerateKey(rand.Reader)
signKey = base64.StdEncoding.EncodeToString(private[:])

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL