Skip to content
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

FDSN client: bug in Client.set_credentials() (not using queryauth endpoint) #2146

Merged
merged 3 commits into from May 16, 2018

Conversation

@megies
Copy link
Member

commented May 14, 2018

There is a bug in FDSN client (current maintenance_1.1.x) when providing credentials via Client.set_credentials() (as opposed to providing credentials during Client.__init__()). Reported on the mailing list: https://lists.swapbytes.de/archives/obspy-users/2018-May/002749.html

+TESTS:clients.fdsn

Works:

from obspy.clients.fdsn import Client

client = Client(base_url="IRIS", user="nobody@iris.edu",
                password="anonymous")
print(client._build_url("dataselect", "query", {'net': "BW"}))
http://service.iris.edu/fdsnws/dataselect/1/queryauth?net=BW

Also works:

from obspy.clients.fdsn import Client

client = Client(base_url="IRIS", user="dummy")
client.set_credentials(user="nobody@iris.edu", password="anonymous")
print(client._build_url("dataselect", "query", {'net': "BW"}))
http://service.iris.edu/fdsnws/dataselect/1/queryauth?net=BW

Does not work:

from obspy.clients.fdsn import Client

client = Client(base_url="IRIS")
client.set_credentials(user="nobody@iris.edu", password="anonymous")
print(client._build_url("dataselect", "query", {'net': "BW"}))
http://service.iris.edu/fdsnws/dataselect/1/query?net=BW
@megies megies added this to the 1.1.1 milestone May 14, 2018
@megies

This comment has been minimized.

Copy link
Member Author

commented May 15, 2018

Simple one-line fix. Should be ready to merge after CI.

megies added 3 commits May 14, 2018
(wasn't setting Client.user which is deciding if "query" or "queryauth"
WS endpoint is used)
@megies megies force-pushed the fdsn_credentials_bug branch from 1dff21f to b886d73 May 16, 2018
@megies megies merged commit 7bf7b81 into maintenance_1.1.x May 16, 2018
6 checks passed
6 checks passed
ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 90%)
Details
codecov/project 88.47% (+1.53%) compared to d0f6ad5
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
docker-testbot Docker tests succeeded
Details
@megies megies deleted the fdsn_credentials_bug branch May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.