-
Notifications
You must be signed in to change notification settings - Fork 101
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
fix: bearer-ignore-flag not loaded for scan #1222
Conversation
For completeness, we'd probably want to add this flag to bearer actions too (as we have done for |
maybe move |
f4adb13
to
f075374
Compare
e4061b1
to
47d6053
Compare
47d6053
to
bbf42dc
Compare
@@ -263,13 +263,14 @@ $ bearer ignore migrate`, | |||
if err != nil { | |||
return fmt.Errorf("flag error: %s", err) | |||
} | |||
|
|||
configFilePath := viper.GetString(flag.ConfigFileFlag.ConfigName) |
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.
Curious here: is the following equivalent?
configFilePath := viper.GetString(flag.ConfigFileFlag.ConfigName) | |
configFilePath := viper.GetString(options.GeneralOptions.ConfigFile) |
We use flag.ConfigFileFlag.ConfigName
in the commands/scan.go but perhaps this is for performance or other reasons. Any light to be shed @didroe or @cfabianski? 🙏
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.
In this case it's equivalent (without the viper.GetString
). But in the scan command, we support reading the options from the config file. So we have to read it's location before building the options.
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.
Ahh, thanks for the explanation. So, if we wanted to support reading options from the config file in this case too, we should leave it as the following?
configFilePath := viper.GetString(flag.ConfigFileFlag.ConfigName)
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.
Yeah. Basically we'd need to do this before calling <FLAGS>.ToOptions
. And therefore you'd need to grab the filename manually first.
Description
We weren't including ignore flags during scan, so bearer.ignore was not being loaded.
Also ensure we look to the right place if scan target is a path
Checklist