@@ -80,7 +80,8 @@ async def process_get_algo(request: Request, username, algoname):
80
80
"resource_type" : "algorithm" }
81
81
elif algoname == "echo" :
82
82
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 )
84
85
else :
85
86
return JSONResponse (content = {"error" : "No such algorithm" }, status_code = 404 )
86
87
@@ -102,6 +103,34 @@ async def get_scm_status(username, algoname):
102
103
return {"scm_connection_status" : "active" }
103
104
104
105
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://[email protected] ' }},
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://[email protected] ' }},
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://[email protected] ' }},
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://[email protected] ' }}]}
132
+
133
+
105
134
@regular_app .get ("/v1/algorithms/{algo_id}/errors" )
106
135
async def get_algo_errors (algo_id ):
107
136
return JSONResponse (content = {"error" : {"message" : "not found" }}, status_code = 404 )
0 commit comments