Skip to content

Commit

Permalink
fix to the vizualization implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
caffix committed Sep 14, 2024
1 parent 764cc33 commit 66910fa
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions viz/viz.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/owasp-amass/open-asset-model/contact"
"github.com/owasp-amass/open-asset-model/domain"
oamreg "github.com/owasp-amass/open-asset-model/registration"
"github.com/owasp-amass/open-asset-model/source"
)

// Edge represents an Amass graph edge in the viz package.
Expand Down Expand Up @@ -190,17 +191,22 @@ func VizData(domains []string, since time.Time, db *assetdb.AssetDB) ([]Node, []
}

func newNode(idx int, a *types.Asset) *Node {
key := a.Asset.Key()
if a == nil || a.Asset == nil {
return nil
}
asset := a.Asset

key := asset.Key()
if key == "" {
return nil
}

atype := string(a.Asset.AssetType())
atype := string(asset.AssetType())
if atype == string(oam.Source) {
return nil
}

switch v := a.Asset.(type) {
switch v := asset.(type) {
case *oamreg.AutnumRecord:
key = v.Handle + " - " + key
case *contact.ContactRecord:
Expand All @@ -210,7 +216,7 @@ func newNode(idx int, a *types.Asset) *Node {
key = strings.Join(parts, " ")
case *oamreg.DomainRecord:
key = "WHOIS: " + key
default:
case *source.Source:
return nil
}
title := atype + ": " + key
Expand Down

0 comments on commit 66910fa

Please sign in to comment.