|
1 | 1 | /* |
2 | | - * Copyright 2022 IEXEC BLOCKCHAIN TECH |
| 2 | + * Copyright 2022-2024 IEXEC BLOCKCHAIN TECH |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
17 | 17 | package com.iexec.resultproxy.api; |
18 | 18 |
|
19 | 19 | import com.iexec.common.result.ResultModel; |
| 20 | +import com.iexec.commons.poco.chain.WorkerpoolAuthorization; |
20 | 21 | import com.iexec.commons.poco.eip712.entity.EIP712Challenge; |
21 | 22 | import feign.Headers; |
22 | 23 | import feign.Param; |
23 | 24 | import feign.RequestLine; |
24 | | -import feign.Response; |
25 | 25 |
|
26 | 26 | /** |
27 | 27 | * Interface allowing to instantiate a Feign client targeting Result Proxy REST endpoints. |
28 | 28 | * <p> |
29 | 29 | * To create the client, see the related builder. |
| 30 | + * |
30 | 31 | * @see ResultProxyClientBuilder |
31 | 32 | */ |
32 | 33 | public interface ResultProxyClient { |
33 | 34 |
|
| 35 | + /** |
| 36 | + * @deprecated Will be replaced with new flow and removed in v10 |
| 37 | + */ |
| 38 | + @Deprecated(forRemoval = true) |
34 | 39 | @RequestLine("GET /results/challenge?chainId={chainId}") |
35 | 40 | EIP712Challenge getChallenge(@Param("chainId") int chainId); |
36 | 41 |
|
| 42 | + /** |
| 43 | + * @deprecated Will be replaced with new flow and removed in v10 |
| 44 | + */ |
| 45 | + @Deprecated(forRemoval = true) |
37 | 46 | @RequestLine("POST /results/login?chainId={chainId}") |
38 | 47 | String login(@Param("chainId") int chainId, String token); |
39 | 48 |
|
40 | | - @RequestLine("POST /") |
| 49 | + @RequestLine("POST /v1/results/token") |
| 50 | + @Headers("Authorization: {authorization}") |
| 51 | + String getJwt(@Param("authorization") String authorization, WorkerpoolAuthorization workerpoolAuthorization); |
| 52 | + |
| 53 | + @RequestLine("POST /v1/results") |
41 | 54 | @Headers("Authorization: {authorization}") |
42 | 55 | String addResult( |
43 | 56 | @Param("authorization") String authorization, |
44 | 57 | ResultModel model |
45 | 58 | ); |
46 | 59 |
|
47 | | - @RequestLine("HEAD /results/{chainTaskId}") |
| 60 | + @RequestLine("HEAD /v1/results/{chainTaskId}") |
48 | 61 | @Headers("Authorization: {authorization}") |
49 | 62 | String isResultUploaded( |
50 | 63 | @Param("authorization") String authorization, |
51 | 64 | @Param("chainTaskId") String chainTaskId |
52 | 65 | ); |
53 | 66 |
|
54 | | - @RequestLine("GET /results/{chainTaskId}?chainId={chainId}") |
55 | | - @Headers({"Accept: application/zip", "Authorization: {authorization}"}) |
56 | | - Response getResult( |
57 | | - @Param("chainTaskId") String chainTaskId, |
58 | | - @Param("authorization") String token, |
59 | | - @Param("chainId") int chainId |
60 | | - ); |
61 | | - |
62 | | - @RequestLine("GET /results/{chainTaskId}/ipfshash") |
| 67 | + @RequestLine("GET /v1/results/{chainTaskId}/ipfshash") |
63 | 68 | String getIpfsHashForTask(@Param("chainTaskId") String chainTaskId); |
64 | 69 |
|
65 | 70 | } |
0 commit comments