-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
Token information Context params missing #1780
Comments
Thanks @Subin-Qreative. Seems like this is a mistake in the documentation. The Is there a reason you want to access these parameters? |
no particular reason, i was trying to wrap my head around / understand how the "user" parameter was exposed and came to find the following. |
Ok, then I will update the documentation to match the current behavior. Thanks for reporting! Let me know if something is still unclear so we can document it better. |
Description
Documentation shows these would be available
{
"api_base_path": ... # The base path of the matched API
"operation_id": ... # The operation id of matched operation
"user": ... # User information from authentication
"token_info": ... # Token information from authentication
}
Expected behaviour
def get_secret(user, token_info, context_) -> str:
print(context_)
return """
You are user_id {user} and the secret is 'wbevuec'.
Decoded token claims: {token_info}.
""".format(
user=user, token_info=token_info
)
print should real all of the context:
{'api_base_path': '/api/auth/{user_id}', 'operation_id': 'app.generate_token', 'user': '12', 'token_info': {'iss': 'com.zalando.connexion', 'iat': 1698962243, 'exp': 1698962843, 'sub': '12'}}
Actual behaviour
{'user': '12', 'token_info': {'iss': 'com.zalando.connexion', 'iat': 1698962243, 'exp': 1698962843, 'sub': '12'}}
Steps to reproduce
Followed instructions as per :
https://connexion.readthedocs.io/en/stable/request.html#context
using
https://github.com/spec-first/connexion/tree/main/examples/jwt
Additional info:
Output of the commands:
python --version
Python 3.10.12pip show connexion | grep "^Version\:"
Version: 3.0.0The text was updated successfully, but these errors were encountered: