sonatype-nexus-community / nancy

A tool to check for vulnerabilities in your Golang dependencies, powered by Sonatype OSS Index
Apache License 2.0
564 stars 74 forks source link

Get and Set Config for OSS Index, IQ Server #108

Closed DarthHater closed 4 years ago

DarthHater commented 4 years ago

Last week much to my chagrin I discovered a few things:

This pull request makes the following changes:

Couple lil fly by improvements:

cc @bhamail / @DarthHater / @zendern / @fitzoh

DarthHater commented 4 years ago

@zendern let er rip. I had NEVER tested something that took stdin input before, fun learning experiment doing so. Tests pass, and confirm that something is written to disk. I can think of one nice thing to do which is to not use /tmp like I am and use ioutils.TempFile, figured I'd see if you had any other ideas there though!

DarthHater commented 4 years ago

I believe I covered all the bases now. Parse tests now set ConfigLocation to a nonsensical place so they won't test loading config from file. Previously if you'd set your config locally you'd get failing tests from it loading.

As well, I changed the logger to truncate the file by default now, which is effectively poor person log rotation. This was not specific to this task, but was easy and I figured I'd do it to make my own testing a bit easier.

I've tested the config for OSS Index and IQ Server myself locally, and everything checks out!