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

Add the alwaysInheritAuthentication option #451

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AndrewGuenther
Copy link

This option forces all requests to inherit auth from the top of the
collection. This is really useful when all requests should be using the
same authentication. If authentication is called out on each request in
the Postman app, they will not inherit the options set on the
collection, like the token, and must all be set manually. By allowing
all requests to simply inherit from the collection, the token can be set
once at the top of the collection and all requests will use it
automatically.

Fixes #271

This option forces all requests to inherit auth from the top of the
collection. This is really useful when all requests should be using the
same authentication. If authentication is called out on each request in
the Postman app, they will not inherit the options set on the
collection, like the token, and must all be set manually. By allowing
all requests to simply inherit from the collection, the token can be set
once at the top of the collection and all requests will use it
automatically.

Fixes postmanlabs#271
@AndrewGuenther
Copy link
Author

@VShingala would appreciate some eyes on this

@AndrewGuenther
Copy link
Author

@SahilChoudhary22 can I get a review on this?

@PhMatt
Copy link

PhMatt commented Aug 9, 2022

@SahilChoudhary22 can I get a review on this?
I would very much appreciate this feature. Hopefully it can be reviewed/approved soon!

@SahilChoudhary22
Copy link
Contributor

@AndrewGuenther Sure, planning to review this before releasing the next version 👍

@LevinFaber
Copy link

Hey @SahilChoudhary22 , any update on this?

@jsbrain
Copy link

jsbrain commented Mar 18, 2023

Would be really great to have this!

@@ -2321,7 +2321,12 @@ module.exports = {
}

// handling authentication here (for http type only)
authHelper = this.getAuthHelper(openapi, operation.security);
if (options.alwaysInheritAuthentication) {
authHelper = this.getAuthHelper(openapi, openapi.security);
Copy link
Contributor

Choose a reason for hiding this comment

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

@AndrewGuenther wanted some clarity on why we're setting the value of authHelper here

@SahilChoudhary22
Copy link
Contributor

@AndrewGuenther Thanks for your contributions to the module. After reviewing the pull request, I noticed an area where I could use some additional clarity. I've left a comment on that line.

That being said, since the PR is now outdated and now the openapi-to-postman has 2 versions of converter within it, we will need to make some additional changes to add the support for alwaysInheritAuthentication to convertV2, along with the respective test cases. I will be raising another pull request shortly, where I'll be cherry-picking the changes from this PR and the added support for v2. 🙇 Stay tuned!

@tmccnnll
Copy link

Hey @SahilChoudhary22, thanks for reviewing this PR. You mentioned that you would be raising another pull request that would supersede this one. Has there been any progress on that front?

@SahilChoudhary22
Copy link
Contributor

Hi @tmccnnll ,
I've raised the PR here - #728
The new option should be available with the next release of the module ie. 4.14.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set the default Authorization Type to 'Inherit from Parent'
6 participants