-
Notifications
You must be signed in to change notification settings - Fork 26
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
pass auth_config through to ContentFetcherTask #222
base: main
Are you sure you want to change the base?
Conversation
makes it possible to pass API headers to pystac_client
Hi @hrodmn, thanks so much for your contribution. It would have been nice to have support for all available QGIS authentication methods, but it is great to see you have at least covered one of them. |
@Samweli I modified the run_tests.sh script a little bit and ran the tests on all of the versions that run in this package's CI: #!/usr/bin/env bash
QGIS_IMAGE=qgis/qgis
QGIS_IMAGE_V_3_16=release-3_16
QGIS_IMAGE_V_3_20=release-3_20
QGIS_IMAGE_V_3_22=release-3_22
QGIS_IMAGE_V_3_24=release-3_24
QGIS_IMAGE_V_3_26=final-3_26_0
QGIS_VERSION_TAGS=($QGIS_IMAGE_V_3_16 $QGIS_IMAGE_V_3_20 $QGIS_IMAGE_V_3_22 $QGIS_IMAGE_V_3_24 $QGIS_IMAGE_V_3_26)
export IMAGE=$QGIS_IMAGE
export WITH_PYTHON_PEP=false
export ON_TRAVIS=false
export MUTE_LOGS=true
for TAG in "${QGIS_VERSION_TAGS[@]}"
do
echo "Running tests for QGIS $TAG"
export QGIS_VERSION_TAG=$TAG
docker compose up -d
sleep 10
docker compose exec -T qgis-testing-environment sh -c "pip3 install flask"
docker compose exec -T qgis-testing-environment qgis_testrunner.sh test_suite.test_package
docker compose down
done The tests pass for all of the versions except 3.22, but this may be expected because apparently that image was pushed from a failed build! See qgis/QGIS#50729 for details. Here is the test output:
|
Sounds good, @Samweli. I want to add a unit test case with a mock server that requires authentication. I am trying to work out a solution there but need to get up to speed on flask. Based on this post it looks like it shouldn't be too hard to mock up a header-based authentication scheme: https://blog.ruanbekker.com/blog/2018/06/01/add-a-authentication-header-to-your-python-flask-app/ |
Hello, is there any plan on when this will be merged to a new release of the plugin? Thanks. |
This makes it possible to pass API headers from a
QgsAuthMethodConfig
topystac_client.Client.open
. To do this right we would definitely want a more thorough treatment of alternative authentication options but I just want to put it out here for others to look at.This resolves #206 and starts us on the path towards #207 .