zlint icon indicating copy to clipboard operation
zlint copied to clipboard

Allow filtering ResultSet by Status threshold

Open cpu opened this issue 5 years ago • 0 comments

Originally requested by @cardonator in https://github.com/zmap/zlint/pull/372#issuecomment-580441107 I had hoped to land a feature for this with #372 but ran out of time and don't want to block the RC tag.

Filtering lint results to only include those with a status above a configured threshold is a common requirement for downstream users of zlint, e.g. the cfssl integration supports this operation: https://github.com/cloudflare/cfssl/blob/644917271238216c94866f021e2b24ce54555848/signer/local/local.go#L183-L185

Rather than duplicate equivalent code in consumers I think it makes sense for ZLint to provide the feature. Personally I think it makes the most sense to implement this as a method on the ResultSet type (vs as another arg to zlint.LintCertificateEx) since it's a property of results and not lints being run.

I had fiddled with a bit of code to do that in a discarded refactor branch: https://github.com/cpu/zlint/commit/22d711099ea5e4aaedde72450d0ae9e321ff0cf6 It would need to be rebased on master, and have tests written but might be a useful starting point to resolve this issue.

cpu avatar Feb 11 '20 19:02 cpu