-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reinstated Postman body scanning #3904
Conversation
pkg/sources/postman/postman.go
Outdated
s.scanData(ctx, chunksChan, s.formatAndInjectKeywords(s.buildSubstitueSet(m, data)), m) | ||
m.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN | ||
default: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it was in the original code that was removed, but it also seems unnecessary there. @casey-tran can we take this out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this because it's just what was originally taken out, but it looks like there are some opportunities for tuning it up while you're here, if you feel it's worth it.
pkg/sources/postman/postman.go
Outdated
s.scanData(ctx, chunksChan, s.formatAndInjectKeywords(s.buildSubstitueSet(m, data)), m) | ||
m.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN | ||
default: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it was in the original code that was removed, but it also seems unnecessary there. @casey-tran can we take this out?
pkg/sources/postman/postman.go
Outdated
m.LocationType = source_metadatapb.PostmanLocationType_REQUEST_BODY_URL_ENCODED | ||
s.scanVariableData(ctx, chunksChan, m, vars) | ||
m.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN | ||
case "raw", "graphql": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why these cases are collapsed into one instead of being split out like formdata
and urlencoded
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That probably originated with me and definitely doesn't make sense. I think they should split out.
Description:
Gave Postman sources the ability to scan request bodies again. Gave the function a more specific name to differentiate from scanning response bodies.
Reinstating the code removed here.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?