-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[Python] Respect access_token passed into openapi_client.Configuration call #15725
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
[Python] Respect access_token passed into openapi_client.Configuration call #15725
Conversation
Don't overwrite the provided access_token property during configuration call in python client when the spec has bearer token security schema
|
How about writing a test? There is no verification that your feature is working. |
|
I've spent a couple hours digging around and am not sure where/how to add a test properly. Can you provide an example Pull Request with a test I could use as a pattern? |
|
Sure thing, please add a test in here: |
| """ | ||
| self.access_token = access_token | ||
| """Access token | ||
| """ |
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.
for oauth authentication scheme, we still need access_token. what about removing line 203-205 instead?
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.
Please PM me via Slack so that I can help you with the test.
|
Help me understand the thinking behind the current code. Line 142 sets Seems like configuration.mustache should generate code that sets |
|
I've merged #15802 instead. Please pull the latest master to give it a try. Happy to reopen this one if needed. Thanks again for the PR. |
|
I'll try it out and see what happens. |
Don't overwrite the provided access_token property during configuration call in python client when the spec has a bearer token security schema.
Ran into this issue with the SpaceTraders.io OpenAPI Spec available here
I think this is the correct solution to #13315.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(6.3.0) (minor release - breaking changes with fallbacks),7.0.x(breaking changes without fallbacks)Pinging @spacether @krjakbrjak for attention to this python client change.