DDtKey / protect-endpoints

Authorization extension for popular web-frameworks to protect your endpoints
Apache License 2.0
205 stars 14 forks source link

Add to poem's Openapi specification via SecurityScheme #114

Open skrcka opened 1 day ago

skrcka commented 1 day ago

I have managed to implement JWT middleware based on existing example and it works but there is no mention of it in the generated openapi specification. Is it possible to add it?

There is existing solution in raw poem-openapi that seems to include it: https://docs.rs/poem-openapi/latest/poem_openapi/derive.SecurityScheme.html

DDtKey commented 1 day ago

Hi @skrcka 👋

You should manually add a security scheme, because this crate is auth-type agnostic (in other words, it only depends on your code whether it is a JWT or not) See this example in another issue.

Please, correct me if I got you wrong.