@@ -269,6 +269,9 @@ func (pm *PluginManager) scan(pluginDir string, requireSigned bool) error {
269
269
}
270
270
}
271
271
272
+ // nolint:gosec
273
+ // We can ignore the gosec G304 warning on this one because `jsonFPath` is based
274
+ // on plugin the folder structure on disk and not user input.
272
275
reader , err := os .Open (jsonFPath )
273
276
if err != nil {
274
277
return err
@@ -332,6 +335,9 @@ func (s *PluginScanner) walker(currentPath string, f os.FileInfo, err error) err
332
335
return nil
333
336
}
334
337
338
+ // nolint:gosec
339
+ // We can ignore the gosec G304 warning on this one because `currentPath` is based
340
+ // on plugin the folder structure on disk and not user input.
335
341
if err := s .loadPlugin (currentPath ); err != nil {
336
342
s .log .Error ("Failed to load plugin" , "error" , err , "pluginPath" , filepath .Dir (currentPath ))
337
343
s .errors = append (s .errors , err )
@@ -471,6 +477,9 @@ func GetPluginMarkdown(pluginId string, name string) ([]byte, error) {
471
477
return nil , PluginNotFoundError {pluginId }
472
478
}
473
479
480
+ // nolint:gosec
481
+ // We can ignore the gosec G304 warning on this one because `plug.PluginDir` is based
482
+ // on plugin the folder structure on disk and not user input.
474
483
path := filepath .Join (plug .PluginDir , fmt .Sprintf ("%s.md" , strings .ToUpper (name )))
475
484
exists , err := fs .Exists (path )
476
485
if err != nil {
@@ -488,6 +497,9 @@ func GetPluginMarkdown(pluginId string, name string) ([]byte, error) {
488
497
return make ([]byte , 0 ), nil
489
498
}
490
499
500
+ // nolint:gosec
501
+ // We can ignore the gosec G304 warning on this one because `plug.PluginDir` is based
502
+ // on plugin the folder structure on disk and not user input.
491
503
data , err := ioutil .ReadFile (path )
492
504
if err != nil {
493
505
return nil , err
0 commit comments