-
Notifications
You must be signed in to change notification settings - Fork 5
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
Flask-JWT-Extended >= 4.0 breaks server #19
Comments
Hi Johannes, Thank you for reporting this. I've added a temporary fix in 4c53504 |
Fix in release: https://pypi.org/project/dtool-lookup-server/0.17.1/ Please let me know if you run into any problems. I'll look into upgrading to the latest version of the flask-jwt-extended API over the next couple of weeks. |
This seems to work, but it collides with |
I think I have made the dtool-lookup-server code compatible with jwt-extended 4. Please have a look at: |
I get the following error. It goes away if I downgrade
|
Hi Lars, |
I just double checked. It is installing JWT-Extended 4.2 and I am using
|
Sorry, I am seeing now that it is reporting 0.17.1 of the lookup server. Not sure what's going on. Will double check. |
I just double checked, it is reporting 0.17.1 because the version information is hard-coded but is actually installing the latest. So this problem persists on my configuration. |
I think this may be to do with the behaviour of pip. You already have 0.17.1 installed so it does nothing. I'll make a new release once I have fixed: #20 |
Okay, sounds good |
The latest release should be flask-jwt-extended 4.0 compatible: https://pypi.org/project/dtool-lookup-server/0.17.2/ |
The problem persists on with 0.17.2. Let me try to debug this on my end. |
The tests work on a fresh 0.17.2 lookup server installation (following session has a mongo server running and starts in a clean venv within the current git repository root), python -m venv ~/venv/20210518-test-python-3.8
source ~/venv/20210518-test-python-3.8/bin/activate
pip install dtool-lookup-server
pip install pytest-cov
pip freeze | tee after_pytest_cov_install.txt
pytest # OK but fail again after installing any plugin (even if just running the plugin tests), pip install dtool-lookup-server-direct-mongo-plugin
pip freeze | tee after_direct_mongo_plugin_intall.txt
pytest # fails as with 0.17.0 thus we will have to apply Tjelvar's server side modifications to each plugin as well. Environment at
and no other modification to the environment is introduced by the plugin installation, $ diff after_pytest_cov_install.txt after_direct_mongo_plugin_intall.txt
13a14
> dtool-lookup-server-direct-mongo-plugin==0.1.3 |
@tjelvar-olsson looking at all the changes you have applied, will replacements like @@ -22,7 +22,7 @@ bp = Blueprint("base_uri", __name__, url_prefix="/admin/base_uri")
@bp.route("/register", methods=["POST"])
-@jwt_required
+@jwt_required()
def register():
"""Register a base URI. at all blueprint routes within the plugins resolve those |
To answer that question myself: yes, livMatS/dserver-direct-mongo-plugin@f7ff5d4 |
@jotelha - this would also affect the graph plugin correct? Can you update both and make new releases? |
Okay I can confirm that things now work properly with Flask-JWT-Extended>=4.0. Thanks @tjelvar-olsson @jotelha |
I have fixed the plugin: https://pypi.org/project/dtool-lookup-server-annotation-filter-plugin/0.2.1/ |
Closing this issue now |
When revisiting a testing workflow that worked half a year ago and stopped working recently (livMatS/dserver-dependency-graph-plugin@7f16849), I realized that Flask-JWT-Extended >= 4.0 introduces many breaking changes (https://flask-jwt-extended.readthedocs.io/en/stable/v4_upgrade_guide/) and leads to most of the server's tests to fail with
(more details at livMatS/dserver-dependency-graph-plugin#2 (comment))
To avoid looking into the issue in detail, a
Flask-JWT-Extended<4.0
in the requirements should solve this for now.Best, Johannes
The text was updated successfully, but these errors were encountered: