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

How to deal with authentication #118

Closed
mzaglia opened this issue Apr 20, 2021 · 5 comments · Fixed by #127
Closed

How to deal with authentication #118

mzaglia opened this issue Apr 20, 2021 · 5 comments · Fixed by #127

Comments

@mzaglia
Copy link

mzaglia commented Apr 20, 2021

How authentication and authorization should be used with spectree?

@kemingy
Copy link
Member

kemingy commented Apr 21, 2021

Currently, spectree will validate the data and generate the OpenAPI document. If the validation failed, it will return 422 with details. It doesn't support special Auth parameters #56 and status code 401 or 403.

If you want to use this library with authentication and authorization, you can define the schema for headers and do the auth by yourself.

I know this is not perfect. Welcome PR.

@alexted
Copy link

alexted commented Apr 23, 2021

The ability to specify whether the endpoints are protected by authorization (particularly per endpoint or/and in general on app level) and if so, to specify what kind of authorization is uses - a very needed feature. Please, add it.
Subscribed to this topic.

@kemingy kemingy linked a pull request May 4, 2021 that will close this issue
@vaosilva
Copy link

The ability to specify whether the endpoints are protected by authorization (particularly per endpoint or/and in general on app level) and if so, to specify what kind of authorization is uses - a very needed feature. Please, add it.
Subscribed to this topic.

Yes. Very true. Subscribed as well.
I started using spectree for a flask API I'm contributing to and only later on I noticed the lack of this.
The pull request that implements these features failed the linting due to 3 lines being too long... 😅

@kemingy
Copy link
Member

kemingy commented May 27, 2021

The pull request that implements these features failed the linting due to 3 lines being too long... 😅

Will merge it to another branch and fix the lint today.

@vaosilva
Copy link

@kemingy Thanks a lot, and congrats for this awesome project!

@kemingy kemingy closed this as completed May 27, 2021
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 a pull request may close this issue.

4 participants