-
Notifications
You must be signed in to change notification settings - Fork 2k
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
postman import auth (from headers and/or auth object) #4375
Conversation
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.
@sergiyladnych thank you for this PR! 🎉
Tested out locally, seems to be working ok ✅
-Body type was set to JSON in all cases
-Auth was set for the examples of Bearer
, AWS
, Basic
, Digest
and Oauth 1
instead of showing up empty
-URLs are no long empty, and properly filled in
-And query parameters seemed to import ok 👍
Example screenshot, left includes this PR changes, right is latest stable version:
There's some things we might need to look out for, but I would wait for review from one of my dev colleagues:
- @sergiyladnych I would suggest you clean up a bit the fixture json files, for example, removing the requests that not used:
-
I noticed that in some cases there are missing fields. We are in the end limited by these kinds of edge case postman exports where postman does not include the
$.item[].request.auth
field. -
@wdawson at one point it might be worth to deep-dive in one of our upcoming cycles in reviewing all sorts of imports/exports of postman and others deeply, I'm looking through some and find that many miss certain (optional) fields that might be of interest for us to check, example for oauth v1:
e52b13c
to
495a58e
Compare
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.
howdy @sergiyladnych! @gatzjames and @filfreire and I looked at this today and decided we want to start moving forward with writing unit tests for these cases. @gatzjames also had an idea for how we can sideline having to maintain the regexes at all - hopefully you'll see more on that soon. I rebased and pushed (hopefully that's ok, if not let me know).
We're going to be looking into this soon, apologies on blocking the merge right away, but rest assured this is high on our radar.
@dimitropoulos Hello, |
hey @sergiyladnych. so basically if you want to write more tests of the sort that were added in the last commit please feel free (it'll really speed things up), but if not, then members from the insomnia team are going to write them before we merge this PR. from a functionality standpoint, too, @gatzjames had some ideas, so we may use the tests as a way to verify that switching from the current approach with regexes is compatible with his ideas for a different solution. |
3f3e719
to
3eaf1c1
Compare
after quite a lot of work on this PR, it's time to draw a line somewhere. what's here now provides significant value compared to what we had before and is now very thoroughly tested. The only bit that remains is the url parsing of parameters cd5ae6c which we will need to handle separately. We did try and dig into it but it's a bit of a rabbithole of complexity, as it turns out, whereas the auth translation stuff is more straightforward. The reasons mostly have to do with parsing the URL vs the provided parameters and how to parse the URL to remove or add the parameters (since Insomnia and Postman have different behaviors in this respect). |
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.
LGTM
Closes #4214:
One test input-output is added. It checks all implemented scenario.
changelog(Improvements): Adds ability to import postman authorization (from headers as well)