-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Summary
If a SALClient has previously connected to server (i.e. during initialization), connecting to a new server is not possible if the original server required authentication.
Steps to reproduce
If host requires authentication:
sc = SALClient(host)
sc.host = new_host
What is the current bug behavior?
SALClient prompts for username and password (irrespective of whether new_host requires authentication.
What is the expected correct behavior?
No prompt, SALClient should simply connect to new host.
Possible fixes
This occurs because after a host has been set during initialization, SALClient.auth_required has a value determined by this host. When SALClient.host is called a GET request is made (to the new host), and before it is sent SALClient requests credentials because it thinks it has to authenticate (which is true of GET requests made to the original host but not the new one). This can be fixed by simply setting auth_required = False when host is set. If this is done, auth_required can be removed from __init__.