File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,23 @@ def username(self):
306306 return None # not authenticated
307307 return self ._user_info ["username" ]
308308
309+ def user_service (self ):
310+ """
311+ Requests information about user from /user/service endpoint if such exists in self.url server.
312+
313+ Returns response from server as JSON dict or None if endpoint is not found
314+ """
315+
316+ try :
317+ response = self .get ("/v1/user/service" )
318+ except ClientError as e :
319+ self .log .debug ("Unable to query for /user/service endpoint" )
320+ return
321+
322+ response = json .loads (response .read ())
323+
324+ return response
325+
309326 def create_project (self , project_name , is_public = False , namespace = None ):
310327 """
311328 Create new project repository in user namespace on Mergin server.
You can’t perform that action at this time.
0 commit comments