From 6a0e4ee3eb747c9366c5e944cb8084f0bdb69f5a Mon Sep 17 00:00:00 2001 From: vijaycel Date: Thu, 14 Jul 2022 17:04:58 +0530 Subject: [PATCH] Add author and created at for sbom Signed-off-by: vijaycel --- lib/bom_builder.rb | 4 +++- lib/bom_component.rb | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/bom_builder.rb b/lib/bom_builder.rb index 388614e..2b58bc3 100644 --- a/lib/bom_builder.rb +++ b/lib/bom_builder.rb @@ -21,6 +21,7 @@ # Copyright (c) OWASP Foundation. All Rights Reserved. # # frozen_string_literal: true + require 'bundler' require 'fileutils' require 'json' @@ -172,7 +173,8 @@ def self.specs_list end end - object.author = gem['authors'] + object.authors = gem['authors'] + object.created_at = gem['created_at'] object.description = gem['summary'] object.hash = gem['sha'] @gems.push(object) diff --git a/lib/bom_component.rb b/lib/bom_component.rb index c2af8fe..d9c6182 100644 --- a/lib/bom_component.rb +++ b/lib/bom_component.rb @@ -9,6 +9,8 @@ def initialize(gem) @description = gem['description'] @hash = gem['hash'] @purl = gem['purl'] + @authors = gem['authors'] + @created_at = gem['created_at'] @gem = gem end @@ -18,6 +20,8 @@ def hash_val "name": @name, "version": @version, "description": @description, + "authors": @authors, + "created_at": @created_at, "purl": @purl, "hashes": [ "alg": HASH_ALG,