@@ -80,7 +80,8 @@ async def process_get_algo(request: Request, username, algoname):
8080 "resource_type" : "algorithm" }
8181 elif algoname == "echo" :
8282 return JSONResponse (content = {"error" : {"id" : "1cfb98c5-532e-4cbf-9192-fdd45b86969c" , "code" : 2001 ,
83- "message" : "Caller is not authorized to perform the operation" }}, status_code = 403 )
83+ "message" : "Caller is not authorized to perform the operation" }},
84+ status_code = 403 )
8485 else :
8586 return JSONResponse (content = {"error" : "No such algorithm" }, status_code = 404 )
8687
@@ -102,6 +103,34 @@ async def get_scm_status(username, algoname):
102103 return {"scm_connection_status" : "active" }
103104
104105
106+ @regular_app .get ("/v1/scms" )
107+ async def get_scms ():
108+ return {'results' : [{'default' : True , 'enabled' : True , 'id' : 'internal' , 'name' : '' , 'provider' : 'internal' },
109+ {'default' : False , 'enabled' : True , 'id' : 'github' , 'name' : 'https://github.com' ,
110+ 'provider' : 'github' , 'scm' : {'client_id' : '0ff25ba21ec67dbed6e2' },
111+ 'oauth' : {'client_id' : '0ff25ba21ec67dbed6e2' },
112+ 'urls' : {'web' : 'https://github.com' , 'api' : 'https://api.github.com' ,
113+ 'ssh' : 'ssh://git@github.com' }},
114+ {'default' : False , 'enabled' : True , 'id' : 'aadebe70-007f-48ff-ba38-49007c6e0377' ,
115+ 'name' : 'https://gitlab.com' , 'provider' : 'gitlab' ,
116+ 'scm' : {'client_id' : 'ca459576279bd99ed480236a267cc969f8322caad292fa5147cc7fdf7b530a7e' },
117+ 'oauth' : {'client_id' : 'ca459576279bd99ed480236a267cc969f8322caad292fa5147cc7fdf7b530a7e' },
118+ 'urls' : {'web' : 'https://gitlab.com' , 'api' : 'https://gitlab.com' ,
119+ 'ssh' : 'ssh://git@gitlab.com' }},
120+ {'default' : False , 'enabled' : True , 'id' : '24ad1496-5a1d-43e2-9d96-42fce8e5484f' ,
121+ 'name' : 'IQIVA Public GitLab' , 'provider' : 'gitlab' ,
122+ 'scm' : {'client_id' : '3341c989f9d28043d2597388aa4f43ce60a74830b981c4b7d79becf641959376' },
123+ 'oauth' : {'client_id' : '3341c989f9d28043d2597388aa4f43ce60a74830b981c4b7d79becf641959376' },
124+ 'urls' : {'web' : 'https://gitlab.com' , 'api' : 'https://gitlab.com' ,
125+ 'ssh' : 'ssh://git@gitlab.com' }},
126+ {'default' : False , 'enabled' : False , 'id' : '83cd96ae-b1f4-4bd9-b9ca-6f7f25c37708' ,
127+ 'name' : 'GitlabTest' , 'provider' : 'gitlab' ,
128+ 'scm' : {'client_id' : '5e257d6e168d579d439b7d38cdfa647e16573ae1dace6d93a30c5c60b4e5dd32' },
129+ 'oauth' : {'client_id' : '5e257d6e168d579d439b7d38cdfa647e16573ae1dace6d93a30c5c60b4e5dd32' },
130+ 'urls' : {'web' : 'https://gitlab.com' , 'api' : 'https://gitlab.com' ,
131+ 'ssh' : 'ssh://git@gitlab.com' }}]}
132+
133+
105134@regular_app .get ("/v1/algorithms/{algo_id}/errors" )
106135async def get_algo_errors (algo_id ):
107136 return JSONResponse (content = {"error" : {"message" : "not found" }}, status_code = 404 )
0 commit comments