@@ -140,6 +140,31 @@ async def post(self):
140
140
except Exception as e :# pragma: no cover
141
141
response_obj = build_beacon_error_response (self , ErrorClass .error_code , 'prova' , ErrorClass .error_response )
142
142
return web .Response (text = json_util .dumps (response_obj ), status = ErrorClass .error_code , content_type = 'application/json' )
143
+
144
+ class WellKnown (EndpointView ):
145
+ @log_with_args (level )
146
+ async def info (self , request ):
147
+ try :
148
+ response_obj = {"resource" : "http://beaconprod:5050/api/" ,
149
+ "authorization_servers" : ["http://idp:8080/auth/realms/Beacon/" ],
150
+ "client_id" : "beacon" }
151
+ return web .Response (text = json_util .dumps (response_obj ), status = 200 , content_type = 'application/json' )
152
+ except Exception :# pragma: no cover
153
+ raise
154
+
155
+ async def get (self ):
156
+ try :
157
+ return await self .info (self .request )
158
+ except Exception as e :# pragma: no cover
159
+ response_obj = build_beacon_error_response (self , ErrorClass .error_code , 'prova' , ErrorClass .error_response )
160
+ return web .Response (text = json_util .dumps (response_obj ), status = ErrorClass .error_code , content_type = 'application/json' )
161
+
162
+ async def post (self ):
163
+ try :
164
+ return await self .info (self .request )
165
+ except Exception as e :# pragma: no cover
166
+ response_obj = build_beacon_error_response (self , ErrorClass .error_code , 'prova' , ErrorClass .error_response )
167
+ return web .Response (text = json_util .dumps (response_obj ), status = ErrorClass .error_code , content_type = 'application/json' )
143
168
144
169
class Collection (EndpointView ):
145
170
@log_with_args (level )
@@ -305,6 +330,7 @@ async def create_api():# pragma: no cover
305
330
306
331
app .add_routes ([web .post ('/api' , Info )])
307
332
app .add_routes ([web .post ('/api/info' , Info )])
333
+ app .add_routes ([web .post ('/api/.well-known/oauth-protected-resource' , WellKnown )])
308
334
app .add_routes ([web .post ('/api/entry_types' , EntryTypes )])
309
335
app .add_routes ([web .post ('/api/service-info' , ServiceInfo )])
310
336
app .add_routes ([web .post ('/api/configuration' , Configuration )])
@@ -348,6 +374,7 @@ async def create_api():# pragma: no cover
348
374
app .add_routes ([web .post ('/api/runs/{id}/g_variants' , Resultset )])
349
375
app .add_routes ([web .get ('/api' , Info )])
350
376
app .add_routes ([web .get ('/api/info' , Info )])
377
+ app .add_routes ([web .get ('/api/.well-known/oauth-protected-resource' , WellKnown )])
351
378
app .add_routes ([web .get ('/api/entry_types' , EntryTypes )])
352
379
app .add_routes ([web .get ('/api/service-info' , ServiceInfo )])
353
380
app .add_routes ([web .get ('/api/configuration' , Configuration )])
0 commit comments