-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add allow-list functionality to securitychecker_enlightn #1161
base: v2.x
Are you sure you want to change the base?
Conversation
peterjaap
commented
Nov 19, 2024
Q | A |
---|---|
Branch | v2.x |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Documented? | yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice addition, thanks!
Can you make sure to add a test-case for this new allow_list argument? Otherwise we won't be able to merge this.
@veewee I've added a test case and used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. It's curently not working as expected.
I've added some additional pointers in code.
@@ -50,6 +52,7 @@ public function run(ContextInterface $context): TaskResultInterface | |||
$arguments = $this->processBuilder->createArgumentsForCommand('security-checker'); | |||
$arguments->add('security:check'); | |||
$arguments->addOptionalArgument('%s', $config['lockfile']); | |||
$arguments->addArgumentArrayWithSeparatedValue('--allow-list', $config['allow_list'] ?? []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow_list is not nullable since it has a default of []
[ | ||
'security:check', | ||
'./composer.lock', | ||
'--allow-list=allow_advisory_1,allow_advisory_2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not how addArgumentArrayWithSeparatedValue works.
If you want this output, you could use something like:
addOptionalCommaSeparatedArgument('--allow-list=%s', $config['allow_list']);
@@ -19,6 +19,10 @@ grumphp: | |||
securitychecker_enlightn: | |||
lockfile: ./composer.lock | |||
run_always: false | |||
allow_list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configuraiton option should be explained in more details underneath.
@@ -24,10 +24,12 @@ public static function getConfigurableOptions(): ConfigOptionsResolver | |||
$resolver->setDefaults([ | |||
'lockfile' => './composer.lock', | |||
'run_always' => false, | |||
'allow_list' => [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method provideConfigurableOptions
in the test should be altered to cover this newly added default.
@peterjaap nice addition. This is something i could use as well. Thanks for adding it. When will you have time to look at the changes needed? |