You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using securitySchemes (x-bearerInfoFunc) in openapi for authentication and within the method we would like to access request context in order to access request method and url path to do some authorisation checks.
We were able to access it in connexion 2.x by flask.request.method and flask.request.path.
However, I am unable to access it in connexion 3.0 using from connexion import request and request.context. Facing the below error while trying to access, Working outside of operation context. Make sure your app is wrapped in a ContextMiddleware and you're processing a request while accessing the context.
Only the bearer token gets passed to the securitySchemes method by default. Is there a way to access request variables within the method?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We are in the midst of upgrading connexion 2.x to 3.x and using it within Azure function apps (serverless). Converting FlaskApp to AsyncApp.
We are using securitySchemes (x-bearerInfoFunc) in openapi for authentication and within the method we would like to access request context in order to access request method and url path to do some authorisation checks.
We were able to access it in connexion 2.x by
flask.request.method
andflask.request.path
.However, I am unable to access it in connexion 3.0 using
from connexion import request
andrequest.context
. Facing the below error while trying to access,Working outside of operation context. Make sure your app is wrapped in a ContextMiddleware and you're processing a request while accessing the context.
Only the bearer token gets passed to the securitySchemes method by default. Is there a way to access request variables within the method?
Beta Was this translation helpful? Give feedback.
All reactions