-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
[15.0][MIG] auth_jwt,auth_jwt_demo: pre-migrate to V15 #320
[15.0][MIG] auth_jwt,auth_jwt_demo: pre-migrate to V15 #320
Conversation
Because it allows validating with a list of audiences.
Make it work with pyjwt.
This method is useful for public endpoints that need to work for anonymous user, but can be enhanced when an authenticated user is know. A typical use case is a "add to cart" enpoint that can work for anonymous users, but can be enhanced by binding the cart to a known customer when the authenticated user is known.
@sbidoul @simahawk |
@yankinmax you have to exclude these modules from pre-commit conf |
77d6485
to
0aa9cb3
Compare
0aa9cb3
to
096316d
Compare
Ok, so if I understand this comment correctly, this PR should also mark auth_jwt_demo as installable=False ? |
I suppose yes. If I'm doing something wrong pls correct me. |
@yankinmax fix pre-commit pls |
44e4d62
to
179d372
Compare
auth_jwt/__manifest__.py
Outdated
@@ -5,7 +5,7 @@ | |||
"name": "Auth JWT", | |||
"summary": """ | |||
JWT bearer token authentication.""", | |||
"version": "14.0.1.2.0", | |||
"version": "15.0.1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change the version while it is not migrated
@@ -114,7 +114,7 @@ def _decode(self, token): | |||
header = jwt.get_unverified_header(token) | |||
except Exception as e: | |||
_logger.info("Invalid token: %s", e) | |||
raise UnauthorizedInvalidToken() | |||
raise UnauthorizedInvalidToken() from e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should not be here yet, as you are just setting the modules as installable=False
auth_jwt_demo/__manifest__.py
Outdated
@@ -5,12 +5,13 @@ | |||
"name": "Auth JWT Test", | |||
"summary": """ | |||
Test/demo module for auth_jwt.""", | |||
"version": "14.0.1.2.0", | |||
"version": "15.0.1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't change the version yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was done to avoid pre-commit issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please commit the change to the pre-commit config.
Also, make sure the two commits that set the modules to installable=False are the last in the list and all the other come from git am.
@sbidoul I'll rebase right now.
|
This method is useful for public endpoints that need to work for anonymous user, but can be enhanced when an authenticated user is know. A typical use case is a "add to cart" enpoint that can work for anonymous users, but can be enhanced by binding the cart to a known customer when the authenticated user is known.
179d372
to
35b0e68
Compare
/ocabot merge nobump |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at 3816df3. Thanks a lot for contributing to OCA. ❤️ |
Syncing from upstream OCA/server-auth (13.0)
This PR is needed to port code from V14 to V15.
Modules will be migrated here: