Skip to content

Commit f49e456

Browse files
authored
Merge pull request #103 from diggsweden/fix/delete-wua-endpoint-v2
Fix/delete wua endpoint v2
2 parents b6b303c + 046f92c commit f49e456

File tree

14 files changed

+36
-600
lines changed

14 files changed

+36
-600
lines changed

src/main/java/se/digg/wallet/gateway/application/controller/WuaController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import se.digg.wallet.gateway.domain.service.wua.WuaService;
2222

2323
@RestController
24-
@RequestMapping("/wua/v3")
24+
@RequestMapping({"/wua", "/wua/v3"})
2525
@Validated
2626
public class WuaController {
2727
private final Logger logger = LoggerFactory.getLogger(WuaController.class);

src/main/java/se/digg/wallet/gateway/application/controller/old/WuaControllerV1.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/se/digg/wallet/gateway/application/controller/old/WuaControllerV2.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/main/java/se/digg/wallet/gateway/application/model/wua/CreateWuaDto.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/se/digg/wallet/gateway/domain/service/wua/WuaMapper.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
import org.springframework.stereotype.Component;
88
import se.digg.wallet.gateway.application.config.WalletRuntimeException;
9-
import se.digg.wallet.gateway.application.model.wua.CreateWuaDto;
109
import se.digg.wallet.gateway.infrastructure.account.model.WalletAccountAccountDto;
1110
import se.digg.wallet.gateway.infrastructure.walletprovider.model.WalletProviderCreateWuaDto;
12-
import se.digg.wallet.gateway.infrastructure.walletprovider.model.WalletProviderCreateWuaDtoV1;
1311
import tools.jackson.core.JacksonException;
1412
import tools.jackson.databind.ObjectMapper;
1513

@@ -32,15 +30,4 @@ public WalletProviderCreateWuaDto toWalletProviderCreateWuaDto(WalletAccountAcco
3230
}
3331
return new WalletProviderCreateWuaDto(jwkString, nonce);
3432
}
35-
36-
@Deprecated(since = "0.3.1", forRemoval = true)
37-
public WalletProviderCreateWuaDtoV1 toWalletProviderCreateWuaDto(CreateWuaDto createWuaDto) {
38-
String jwkString;
39-
try {
40-
jwkString = objectMapper.writeValueAsString(createWuaDto.jwk());
41-
} catch (JacksonException e) {
42-
throw new WalletRuntimeException(e);
43-
}
44-
return new WalletProviderCreateWuaDtoV1(createWuaDto.walletId().toString(), jwkString);
45-
}
4633
}

src/main/java/se/digg/wallet/gateway/domain/service/wua/WuaService.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.slf4j.Logger;
99
import org.slf4j.LoggerFactory;
1010
import org.springframework.stereotype.Service;
11-
import se.digg.wallet.gateway.application.model.wua.CreateWuaDto;
1211
import se.digg.wallet.gateway.application.model.wua.WuaDto;
1312
import se.digg.wallet.gateway.infrastructure.account.client.WalletAccountClient;
1413
import se.digg.wallet.gateway.infrastructure.walletprovider.client.WalletProviderClient;
@@ -41,16 +40,4 @@ public WuaDto createWua(String accountId, String nonce) {
4140
}
4241
return new WuaDto(result);
4342
}
44-
45-
@Deprecated(since = "0.3.1", forRemoval = true)
46-
public WuaDto createWua(CreateWuaDto createWuaDto) {
47-
48-
var mapped = wuaMapper.toWalletProviderCreateWuaDto(createWuaDto);
49-
var result = walletProviderClient.createWua(mapped);
50-
if (logger.isDebugEnabled()) {
51-
logger.debug("Mapped request {} to new wua dto {}",
52-
createWuaDto.walletId(), result.substring(0, 10));
53-
}
54-
return new WuaDto(result);
55-
}
5643
}

src/main/java/se/digg/wallet/gateway/infrastructure/walletprovider/client/WalletProviderClient.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,19 @@
99
import org.springframework.web.client.RestClient;
1010
import se.digg.wallet.gateway.application.config.ApplicationConfig;
1111
import se.digg.wallet.gateway.infrastructure.walletprovider.model.WalletProviderCreateWuaDto;
12-
import se.digg.wallet.gateway.infrastructure.walletprovider.model.WalletProviderCreateWuaDtoV1;
1312

1413
@Component
1514
public class WalletProviderClient {
1615

1716
private final RestClient restClient;
1817
private final String walletProviderUrl;
1918
private final String wuaPath;
20-
private final String wuaUrlV1;
2119
private final String wuaUrlV2;
2220

2321
public WalletProviderClient(RestClient restClient, ApplicationConfig applicationConfig) {
2422
this.restClient = restClient.mutate().build();
2523
this.walletProviderUrl = applicationConfig.walletprovider().baseurl();
2624
this.wuaPath = applicationConfig.walletprovider().wuaPath();
27-
this.wuaUrlV1 = walletProviderUrl + wuaPath;
2825
this.wuaUrlV2 = walletProviderUrl + wuaPath + "/v2";
2926
}
3027

@@ -37,15 +34,4 @@ public String createWua(WalletProviderCreateWuaDto createWuaDto) {
3734
.retrieve()
3835
.body(String.class);
3936
}
40-
41-
@Deprecated(since = "0.3.1", forRemoval = true)
42-
public String createWua(WalletProviderCreateWuaDtoV1 createWuaDto) {
43-
return restClient
44-
.post()
45-
.uri(wuaUrlV1)
46-
.body(createWuaDto)
47-
.contentType(MediaType.APPLICATION_JSON)
48-
.retrieve()
49-
.body(String.class);
50-
}
5137
}

0 commit comments

Comments
 (0)