Skip to content

Commit 09fc99f

Browse files
committed
Merge remote-tracking branch 'origin/develop' into v3.1.0-rc-dev
2 parents 71a4e8a + 8f1d75d commit 09fc99f

File tree

4 files changed

+106
-93
lines changed

4 files changed

+106
-93
lines changed

Pipfile.lock

Lines changed: 86 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/getting_started/credentials.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ Use :code:`.synapseConfig`
6464

6565
For writing code using the Synapse Python client that is easy to share with others, please do not include your credentials in the code. Instead, please use `.synapseConfig` file to manage your credentials.
6666

67-
When installing the Synapse Python client, the `.synapseConfig` is added to your home directory. Open the `.synapseConfig` file and find the following section::
67+
When installing the Synapse Python client, the :code:`.synapseConfig` is added to your home directory.
68+
69+
You may also create the :code:`~/.synapseConfig` file by utilizing the command line client command and following the interactive prompts::
70+
71+
synapse config
72+
73+
74+
The following describes how to add your credentials to the :code:`.synapseConfig` file without the use of the :code:`synapse config` command.
75+
76+
Open the :code:`.synapseConfig` file and find the following section::
6877

6978
#[authentication]
7079
#username = <username>
@@ -92,3 +101,4 @@ For more information, see:
92101
- :py:class:`synapseclient.Synapse`
93102
- :py:func:`synapseclient.Synapse.login`
94103
- :py:func:`synapseclient.Synapse.logout`
104+
- `synapse config <../articles/cli.html#config>`__

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ python_requires = >=3.8
5757
install_requires =
5858
# "requests>=2.22.0,<2.30.0; python_version<'3.10'",
5959
requests>=2.22.0,<3.0
60-
urllib3<2
60+
urllib3>=1.26.18,<2
6161
# "urllib3>=2; python_version>='3.10'",
6262
keyring>=15,<23.5
6363
keyrings.alt==3.1; sys_platform == "linux"

synapseclient/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,18 +1792,23 @@ def _authenticate_login(syn, user, secret, **login_kwargs):
17921792

17931793
login_attempts = (
17941794
# a username is required when attempting a password login
1795-
("password", lambda user, secret: user is not None and secret is not None),
1795+
(
1796+
"password",
1797+
lambda user, secret: user is not None and user != "" and secret is not None,
1798+
),
17961799
# auth token login can be attempted without a username.
17971800
# although tokens are technically encoded, the client treats them as opaque so we don't do an encoding check
17981801
# on the secret itself
17991802
("authToken", lambda user, secret: secret is not None),
18001803
# username is required for an api key and secret is base 64 encoded
18011804
(
18021805
"apiKey",
1803-
lambda user, secret: user is not None and utils.is_base64_encoded(secret),
1806+
lambda user, secret: user is not None
1807+
and user != ""
1808+
and utils.is_base64_encoded(secret),
18041809
),
18051810
# an inputless login (i.e. derived from config or cache)
1806-
(None, lambda user, secret: user is None and secret is None),
1811+
(None, lambda user, secret: (user is None or user == "") and secret is None),
18071812
)
18081813

18091814
first_auth_ex = None

0 commit comments

Comments
 (0)