@@ -68,8 +68,8 @@ def wrapper(**kwargs):
6868 if "database_host" in request .args :
6969 encoded_jwt = request .headers .get ("Authorization" ).split ()[1 ]
7070 connect_creds = {
71- "host " : request .args ["database_host" ],
72- "user " : jwt .decode (
71+ "databaseAddress " : request .args ["database_host" ],
72+ "username " : jwt .decode (
7373 encoded_jwt ,
7474 crypto_serialization .load_der_public_key (
7575 b64decode (environ .get ("PHARUS_OIDC_PUBLIC_KEY" ).encode ())
@@ -86,8 +86,8 @@ def wrapper(**kwargs):
8686 algorithms = "RS256" ,
8787 )
8888 connection = dj .Connection (
89- host = connect_creds ["host " ],
90- user = connect_creds ["user " ],
89+ host = connect_creds ["databaseAddress " ],
90+ user = connect_creds ["username " ],
9191 password = connect_creds ["password" ],
9292 )
9393 return function (connection , ** kwargs )
@@ -126,7 +126,7 @@ def api_version() -> str:
126126 Content-Type: application/json
127127
128128 {
129- "version": "0.7.0 "
129+ "version": "0.7.1 "
130130 }
131131
132132 :statuscode 200: No error.
@@ -173,8 +173,8 @@ def login() -> dict:
173173 Accept: application/json
174174
175175 {
176- "host ": "tutorial-db.datajoint.io",
177- "user ": "user1",
176+ "databaseAddress ": "tutorial-db.datajoint.io",
177+ "username ": "user1",
178178 "password": "password1"
179179 }
180180
@@ -237,8 +237,8 @@ def login() -> dict:
237237 )
238238 time .sleep (1 )
239239 connect_creds = {
240- "host " : request .args ["database_host" ],
241- "user " : jwt .decode (
240+ "databaseAddress " : request .args ["database_host" ],
241+ "username " : jwt .decode (
242242 auth_info ["jwt" ],
243243 crypto_serialization .load_der_public_key (
244244 b64decode (environ .get ("PHARUS_OIDC_PUBLIC_KEY" ).encode ())
@@ -256,12 +256,12 @@ def login() -> dict:
256256 )
257257 )
258258 connect_creds = request .json
259- if connect_creds .keys () < {"host " , "user " , "password" }:
259+ if connect_creds .keys () < {"databaseAddress " , "username " , "password" }:
260260 return dict (error = "Invalid Request, check headers and/or json body" )
261261 try :
262262 dj .Connection (
263- host = connect_creds ["host " ],
264- user = connect_creds ["user " ],
263+ host = connect_creds ["databaseAddress " ],
264+ user = connect_creds ["username " ],
265265 password = connect_creds ["password" ],
266266 )
267267 except pymysql .err .OperationalError as e :
@@ -276,8 +276,8 @@ def login() -> dict:
276276 password = root_password ,
277277 ).query ("FLUSH PRIVILEGES" )
278278 dj .Connection (
279- host = connect_creds ["host " ],
280- user = connect_creds ["user " ],
279+ host = connect_creds ["databaseAddress " ],
280+ user = connect_creds ["username " ],
281281 password = connect_creds ["password" ],
282282 )
283283 else :
0 commit comments