diff --git a/internal/datastreams/pathway.go b/internal/datastreams/pathway.go index 5ff05de272..e986ecb990 100644 --- a/internal/datastreams/pathway.go +++ b/internal/datastreams/pathway.go @@ -17,6 +17,17 @@ import ( var hashableEdgeTags = map[string]struct{}{"event_type": {}, "exchange": {}, "group": {}, "topic": {}, "type": {}, "direction": {}} +func isValidArn(arn string) bool { + separators := strings.Count(arn, ":") + if separators < 5 { + return false + } + if strings.HasPrefix(arn, "arn:") { + return true + } + return false +} + func isWellFormedEdgeTag(t string) bool { if i := strings.IndexByte(t, ':'); i != -1 { if j := strings.LastIndexByte(t, ':'); j == i { @@ -24,6 +35,9 @@ func isWellFormedEdgeTag(t string) bool { return true } } + if t[:i] == "topic" && isValidArn(t) { + return true + } } return false }