Skip to content

Commit

Permalink
Make "Local Machine" dataLoader name more sensible
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Nov 26, 2024
1 parent 7920968 commit f3fd3ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions modules/integrations/localmachine/analyze/loader.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package analyze

import (
"os"
"runtime"
"strings"
"sync"

"github.com/lkarlslund/adalanche/modules/engine"
"github.com/lkarlslund/adalanche/modules/integrations/localmachine"
"github.com/lkarlslund/adalanche/modules/ui"
"github.com/mailru/easyjson"
"io/ioutil"
"runtime"
"strings"
"sync"
)

const loadername = "Local Machine JSON file"
const Loadername = "Local Machine"

var (
loader = engine.AddLoader(func() engine.Loader { return &LocalMachineLoader{} })
Expand All @@ -30,7 +31,7 @@ type LocalMachineLoader struct {
}

func (ld *LocalMachineLoader) Name() string {
return loadername
return Loadername
}
func (ld *LocalMachineLoader) Init() error {
ld.ao = engine.NewLoaderObjects(ld)
Expand All @@ -40,7 +41,7 @@ func (ld *LocalMachineLoader) Init() error {
ld.done.Add(1)
go func() {
for queueItem := range ld.infostoadd {
raw, err := ioutil.ReadFile(queueItem.path)
raw, err := os.ReadFile(queueItem.path)
if err != nil {
ui.Warn().Msgf("Problem reading data from JSON file %v: %v", queueItem, err)
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func init() {

loader.AddProcessor(func(ao *engine.Objects) {
var warns int
ln := engine.NewAttributeValueString(loadername)
ln := engine.NewAttributeValueString(Loadername)
ao.Iterate(func(o *engine.Object) bool {
if o.HasAttrValue(engine.DataLoader, ln) {
if o.HasAttr(activedirectory.ObjectSid) {
Expand Down

0 comments on commit f3fd3ff

Please sign in to comment.