9117: Prevent api_key sharing#9130
Merged
HugoMario merged 6 commits intoswagger-api:masterfrom Feb 10, 2019
Merged
Conversation
d9a7ca3 to
f9b6755
Compare
Contributor
Author
|
@kenjones-cisco |
| if cls._default is None: | ||
| cls._default = type.__call__(cls) | ||
| return copy.copy(cls._default) | ||
| return cls._two_level_copy(cls._default) |
Contributor
There was a problem hiding this comment.
did you try to use copy.deepcopy(cls._default) to see if that would provide the expected behavior?
Contributor
Author
There was a problem hiding this comment.
Yes, sure. Deepcopy fails with TypeError: can't pickle thread.lock objects cause we have reach attributes such as logger file/handler.
Contributor
Author
|
@kenjones-cisco |
Contributor
|
This would definitely be much easier to read and maintain. |
Contributor
Author
|
@wing328 Seems to be ready fo merge. |
Contributor
|
thanks @ruslanlazin @kenjones-cisco , i'll take a time to port these changes to 3.0.0 version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.3.0.0branch for changes related to OpenAPI spec 3.0. Default:master.Description of the PR
These changes prevent sharing
api_key,api_key_prefix,loggerbetween configuration instances.Error was caused by using shallow copy in #6554
Test cases added.
fix #9117