Building ID on certnode

This commit is contained in:
Christopher Talib 2020-02-04 10:58:56 +01:00
parent 380e51229b
commit efde1a4a54
2 changed files with 5 additions and 4 deletions

View file

@ -16,10 +16,10 @@ func main() {
// The false flag specifies that we want heartbeat messages.
stream, errStream := certstream.CertStreamEventStream(false)
fmt.Println("Starting to get data from CertStream...")
Conn, err := broker.SetUpKafkaConnecter()
if err != nil {
panic(err)
}
// Conn, err := broker.SetUpKafkaConnecter()
// if err != nil {
// panic(err)
// }
// stop channel
stopChan := make(chan os.Signal)

View file

@ -26,6 +26,7 @@ func BuildNode(flag string, dataType string, data string) *Node {
// BuildCertNode builds a custom node based on CertStream.
func BuildCertNode(rawNode *CertStreamWrapper) *CertNode {
return &CertNode{
ID: "certstream--" + uuid.New().String(),
Fingerprint: rawNode.Data.Data.LeafCert.Fingerprint,
NotBefore: time.Unix(int64(rawNode.Data.Data.LeafCert.NotBefore), 0).Format(time.RFC3339),
NotAfter: time.Unix(int64(rawNode.Data.Data.LeafCert.NotAfter), 0).Format(time.RFC3339),