community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🚀 Feature: tech-insights allow to add checks for CheckFactory without providing the factory

Open secustor opened this issue 11 months ago • 5 comments

🔖 Feature description

There should an extension point which provides a addCheck function.

This function would capture all checks and then provide a complete list to a factory whether it is a custom or default one.

🎤 Context

Currently all checks have to be provided via a CheckFactory which is then set via setCheckFactory. The setter tough can only be called once, which means there can only one Module which has to provide all Checks.

FactRetrievers on the other hand can be provided by different Modules, this makes it not easy to isolate logic by concerns. E.g. one module provides facts and checks fitting to the provided facts

✌️ Possible Implementation

Instead of a factory instance setFactCheckerFactory should accept a function (ctx: CheckerFactoryContext) => FactCheckerFactory<CheckType, CheckResultType>.

And then create a new extension point which exposes a addCheck function.

👀 Have you spent some time to check if this feature request has been raised before?

  • [X] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

secustor avatar Feb 28 '24 13:02 secustor