gocsaf / csaf

Tools to download or provide CSAF (Common Security Advisory Framework) documents.
https://csaf.io
41 stars 24 forks source link

feat: Add function to find product identification helpers inspecting the tree #505

Closed juan131 closed 12 months ago

juan131 commented 1 year ago

Description of the change

This PR adds a new exported method to ProductTree type in the csaf package: FindProductIdentificationHelpers. This method iterates over the product tree and find the product identification helpers associated to a given product id.

Benefits

Easier to obtain product identification helpers given a product id.

Possible drawbacks

None

Applicable issues

Additional information

N/A

juan131 commented 1 year ago

cc @tschmidtb51 @mpermar

juan131 commented 1 year ago

Thanks for the advice @tschmidtb51 ! Implemented at https://github.com/csaf-poc/csaf_distribution/pull/505/commits/4338f45b8f5f2d93f700650b40110cd1c8daab89

tschmidtb51 commented 1 year ago

I'm currently on a business trip - so it might take a while for me to review it.

juan131 commented 1 year ago

Friendly reminder to review this PR when you find the slot for it @tschmidtb51 Thanks in advance

tschmidtb51 commented 1 year ago

Thank you for your contribution. We discussed it today.

As it basically puts the implementation of the example in a more generic case, please also adopt the example to use the new library function.

Also @s-l-teichmann had an idea about callbacks that might be helpful in the library. @s-l-teichmann please explain

juan131 commented 1 year ago

Example adapted at https://github.com/csaf-poc/csaf_distribution/pull/505/commits/2e9d4ad03e8dabfb1a556126a1bb1b64ba5a3ce9 @tschmidtb51

juan131 commented 12 months ago

@s-l-teichmann @tschmidtb51 friendly reminder

tschmidtb51 commented 12 months ago

@s-l-teichmann Please have a look

s-l-teichmann commented 12 months ago

I will have a look at this.

s-l-teichmann commented 12 months ago

Looks fine to me. The only thing I don't like is the direct creation on the helpers slice. @juan131 I send https://github.com/juan131/csaf_distribution/pull/1 to your repo. But this is minor.

juan131 commented 12 months ago

Thanks for the feedback @s-l-teichmann ! I applied your suggestions in the PR

juan131 commented 12 months ago

Thanks everyone for you help!