pyeve / eve-swagger

Swagger extension for Eve-powered RESTful APIs
http://python-eve.org
Other
154 stars 43 forks source link

Fix OAuth2 #89

Closed rmlopes closed 5 years ago

rmlopes commented 5 years ago

Fix OAuth2. As per the example BearerAuth extends BasicAuth, as such rather than using app.auth class type, we first check for sentinel config vars than proceed with the remaining auth types. HTTPS scheme must be used with OAuth2 as such I also re-added _get_scheme which was removed in the last merges.

rmlopes commented 5 years ago

Thanks @DavidZisky, I was postponing black because it is only available for Python 3.6+ and I am running debian that is shipped with 3.5 and it is a bit delayed, even in the backports, but I have surrendered :). The build still fails, but the tests run clean on my system with 3.7.

nicolaiarocci commented 5 years ago

rebased and merged. thanks.

JoveYu commented 5 years ago

the generator don't know what is the real server url, maybe you deploy nginx with ssl cert before eve

you can use SWAGGER_HOST to set real url if you use https, instead of change default scheme

nicolaiarocci commented 5 years ago

feel free to submit a PR

JoveYu commented 5 years ago

i don't hava a project use oauth2, maybe @rmlopes can help to fix this