Skip to content
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

Merged
merged 3 commits into from
Feb 12, 2025
Merged

Conversation

casey-tran
Copy link
Contributor

@casey-tran casey-tran commented Feb 12, 2025

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:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@casey-tran casey-tran marked this pull request as ready for review February 12, 2025 00:20
@casey-tran casey-tran requested review from a team as code owners February 12, 2025 00:20
@casey-tran casey-tran requested a review from joeleonjr February 12, 2025 00:20
s.scanData(ctx, chunksChan, s.formatAndInjectKeywords(s.buildSubstitueSet(m, data)), m)
m.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN
default:
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

Copy link
Collaborator

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?

Copy link
Collaborator

@rosecodym rosecodym left a 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.

s.scanData(ctx, chunksChan, s.formatAndInjectKeywords(s.buildSubstitueSet(m, data)), m)
m.LocationType = source_metadatapb.PostmanLocationType_UNKNOWN_POSTMAN
default:
break
Copy link
Collaborator

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?

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":
Copy link
Collaborator

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?

Copy link
Contributor

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.

@casey-tran casey-tran merged commit 881c2f9 into main Feb 12, 2025
13 checks passed
@casey-tran casey-tran deleted the adding-back-postman-body-scanning branch February 12, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants