Skip to content

Commit a13ea81

Browse files
authored
Implemented collection authorization scanning (#3910)
1 parent 0fede82 commit a13ea81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/sources/postman/postman.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,9 @@ func (s *Source) scanCollection(ctx context.Context, chunksChan chan *sources.Ch
321321
})
322322
metadata.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN
323323

324+
// collections don't have URLs in the Postman API, but we can scan the Authorization section without it.
325+
s.scanAuth(ctx, chunksChan, metadata, collection.Auth, URL{})
326+
324327
for _, event := range collection.Events {
325328
s.scanEvent(ctx, chunksChan, metadata, event)
326329
}
@@ -492,7 +495,11 @@ func (s *Source) scanAuth(ctx context.Context, chunksChan chan *sources.Chunk, m
492495
}
493496

494497
if !m.fromLocal {
495-
m.Link += "?tab=auth"
498+
if strings.Contains(m.Type, REQUEST_TYPE) {
499+
m.Link += "?tab=auth"
500+
} else {
501+
m.Link += "?tab=authorization"
502+
}
496503
m.Type += " > authorization"
497504
}
498505

0 commit comments

Comments
 (0)