https://kotlinlang.org logo
#ktor
Title
# ktor
i

Ivan

12/21/2020, 11:25 AM
Hi everybody, There is a way to understand if a route is under auth from his parent tree?
e

e5l

12/21/2020, 11:28 AM
Hey, you can check
call.sessions
if there is one session you need
i

Ivan

12/21/2020, 11:33 AM
Hi @e5l, I need to understand if a route is under auth before the call. The main scope is to generate an openapi.json with secure flag or not on the application startup.
🤔 1
I started from implementation of the ktor-swagger library https://github.com/nielsfalk/ktor-swagger This library manages security specifications globally. I would like to integrate it with the specific definition for each individual route. https://swagger.io/docs/specification/authentication/ This library uses a wrapper built around ktor locations and builds the swagger / openapi tree at runtime. What I was asking is if there is the possibility to intercept if a Route is declared under authenticate (...) or not to pass this information to the library structure.
h

HankG

12/21/2020, 2:31 PM
Have you looked at the other OpenGraph API library instead (mentioned at bottom)? https://github.com/papsign/Ktor-OpenAPI-Generator
3 Views