@@ -73,6 +73,7 @@ public TeeController(
7373
7474 /**
7575 * Return which TEE framework this SMS is configured to use.
76+ *
7677 * @return TEE framework this SMS is configured to use.
7778 */
7879 @ GetMapping ("/framework" )
@@ -100,10 +101,16 @@ public ResponseEntity<TeeServicesProperties> getTeeServicesProperties(
100101 }
101102
102103 /**
103- * Called by the core, not the worker
104+ * Generates an enclave challenge for a PoCo task.
105+ * <p>
106+ * This method is called by the scheduler.
107+ *
108+ * @param authorization Authorization to check the query legitimacy
109+ * @param chainTaskId ID of the task the challenge will be produced for
110+ * @return The Ethereum address enclave challenge for the provided
104111 */
105112 @ PostMapping ("/challenges/{chainTaskId}" )
106- public ResponseEntity <String > generateTeeChallenge (@ PathVariable String chainTaskId ) {
113+ public ResponseEntity <String > generateTeeChallenge (@ RequestHeader String authorization , @ PathVariable String chainTaskId ) {
107114 Optional <TeeChallenge > executionChallenge =
108115 teeChallengeService .getOrCreate (chainTaskId , false );
109116 return executionChallenge
@@ -118,10 +125,12 @@ public ResponseEntity<String> generateTeeChallenge(@PathVariable String chainTas
118125 * to the enclave so the latter can talk to the CAS and get
119126 * the needed secrets.
120127 *
121- * @return
122- * 200 OK with the session id if success,
123- * 404 NOT_FOUND if the task is not found,
124- * 500 INTERNAL_SERVER_ERROR otherwise.
128+ * @return result
129+ * <ul>
130+ * <li>200 OK with the session id if success.
131+ * <li>404 NOT_FOUND if the task is not found.
132+ * <li>500 INTERNAL_SERVER_ERROR otherwise.
133+ * </ul>
125134 */
126135 @ PostMapping ("/sessions" )
127136 public ResponseEntity <ApiResponseBody <TeeSessionGenerationResponse , TeeSessionGenerationError >> generateTeeSession (
@@ -170,7 +179,7 @@ public ResponseEntity<ApiResponseBody<TeeSessionGenerationResponse, TeeSessionGe
170179 return ResponseEntity .ok (ApiResponseBody .<TeeSessionGenerationResponse , TeeSessionGenerationError >builder ()
171180 .data (teeSessionGenerationResponse )
172181 .build ());
173- } catch (TeeSessionGenerationException e ) {
182+ } catch (TeeSessionGenerationException e ) {
174183 log .error ("Failed to generate secure session [taskId:{}, workerAddress:{}]" ,
175184 taskId , workerAddress , e );
176185 final ApiResponseBody <TeeSessionGenerationResponse , TeeSessionGenerationError > body =
0 commit comments