Skip to content

Commit bffd61b

Browse files
authored
Merge pull request #21 from materials-data-facility/mdfcc-dev
Support Toolbox native-login
2 parents 2df7857 + b791ea5 commit bffd61b

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ before_install:
1515
- openssl aes-256-cbc -K $encrypted_99dd1c7c40fb_key -iv $encrypted_99dd1c7c40fb_iv
1616
-in travis.tar.enc -out travis.tar -d
1717
- tar xvf travis.tar
18-
- mkdir -p ~/.mdf/credentials/
19-
- mv MDF_Connect_Client_tokens.json ~/.mdf/credentials/MDF_Connect_Client_tokens.json
18+
- mv .globus-native-apps.cfg ~/.globus-native-apps.cfg
2019
after_success:
2120
- coveralls
2221
notifications:

mdf_connect_client/mdfcc.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
class MDFConnectClient:
2727
"""The MDF Connect Client is the Python client to easily submit datasets to MDF Connect."""
2828
__app_name = "MDF_Connect_Client"
29-
__login_services = ["connect"]
29+
__client_id = "fcb9bf5a-4492-4e25-970f-510b69abc964"
30+
__login_services = ["mdf_connect"]
3031
__allowed_authorizers = [
3132
globus_sdk.RefreshTokenAuthorizer,
3233
globus_sdk.ClientCredentialsAuthorizer,
@@ -76,9 +77,9 @@ def __init__(self, test=False, service_instance=None, authorizer=None):
7677
if any([isinstance(authorizer, allowed) for allowed in self.__allowed_authorizers]):
7778
self.__authorizer = authorizer
7879
else:
79-
self.__authorizer = mdf_toolbox.login({"app_name": self.__app_name,
80-
"services": self.__login_services
81-
}).get("connect")
80+
self.__authorizer = mdf_toolbox.login(services=self.__login_services,
81+
client_id=self.__client_id,
82+
app_name=self.__app_name).get("mdf_connect")
8283
if not self.__authorizer:
8384
raise ValueError("Unable to authenticate")
8485

@@ -88,7 +89,7 @@ def logout(self):
8889
"""
8990
self.reset_submission()
9091
self.__authorizer = None
91-
mdf_toolbox.logout()
92+
mdf_toolbox.logout(client_id=self.__client_id, app_name=self.__app_name)
9293
return "Logged out. You must create a new MDF Connect Client to log back in."
9394

9495
# ***********************************************

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
setup(
44
name='mdf_connect_client',
5-
version='0.3.4',
5+
version='0.3.5',
66
packages=['mdf_connect_client'],
77
description='Materials Data Facility Connect Client',
88
long_description=("The MDF Connect Client is the Python client to easily submit"
99
" datasets to MDF Connect."),
1010
install_requires=[
11-
"mdf-toolbox>=0.2.6",
11+
"mdf-toolbox>=0.5.0",
1212
"nameparser>=1.0.4",
1313
"requests>=2.18.4"
1414
],

travis.tar.enc

-10 KB
Binary file not shown.

0 commit comments

Comments
 (0)