From e26477e8d1175368da37179eef7edc73face1b35 Mon Sep 17 00:00:00 2001 From: rdavidek Date: Tue, 17 Feb 2026 11:12:19 +0100 Subject: [PATCH] JaT fixes --- client-truststore.jks | Bin 9047 -> 15246 bytes .../cz/trask/migration/AbstractProcess.java | 11 +++++++++-- .../migration/model/ApplicationConfig.java | 14 ++++++++++++++ src/main/resources/apicurio-migrator.yaml | 16 ++++++++++------ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/client-truststore.jks b/client-truststore.jks index f2e5e42570326a1de6a01ff3402ca26af054e525..4f109d7cbabc0be1e5c9ab9edf9b3df413d04c25 100644 GIT binary patch delta 3468 zcma);c|4R`AHbj4h_N+e#=b{(&kVArP+?@rSfa9IUovAF29;?hSBVm1sVps|LJ>li zq?9DtQqgECTZzb0+|WDf-g57I@B4ZGcs}RzJI{H}`8?-*f8XDEzU?FpwLGyr0RRA$ z`yju!cC03pW}v)k2vwd!B2ndi{VCMofM8!AYA`9>Cz2XOq6AZ8)BpgI6S}522SDu9 z)(4FM0C5XsB5s0Acf>}hxS5>-Jhco?c!sgA2zuOPciF{7ttKL|c(kte zK)|WbdP#1Yn!SX$Cz$2{nTb!)R|PQysMJlNbb8&g`e4VWl8(eD^|Wfi4+_V^MeC6 z5}+ZFZ*T+%<2In&N{13$9K;?LZTH+nMi^UVr3_URN<6mcABs$|0U3iUBjn(WmmuQ> z$ml)K=swTrNMJk;^YbAa>*(lM+HWM_ot5$63Ju)Gay5hIe=?|wQ`6**wDfQ^cLl)> z8*nTW@sm~{ql;$^_x}+HUI+xvXa*TgAmjF*T_7}pabxu||F#N?EOL_mS6pFC2m~lE zLhBwt;;e@-Hrk=&@GQIe_Qi1_UL#KVd#~kM+VV@)BI`2DG?}U#xf7|>sFsn`eXNZo zxtHu?n&V+_3{-Y0ql&>#{CVQG0{(W3^N*$Geev&wl`==cfV;*EdpKikL4FDaN7da* zrnfR$Sdv<;o<8RFTHw^xsj=-TlNq0FaxC&bD+5zObr#mw5&71Q_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cz/trask/migration/AbstractProcess.java index 6719d38..464c4bb 100644 --- a/src/main/java/cz/trask/migration/AbstractProcess.java +++ b/src/main/java/cz/trask/migration/AbstractProcess.java @@ -9,6 +9,8 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.Proxy; import java.net.URL; import java.net.URLEncoder; import java.security.KeyStore; @@ -71,6 +73,8 @@ public abstract class AbstractProcess { public static ObjectMapper mapper; public static ObjectMapper mapperYaml; + + public static Proxy proxy; public final RegistryClient client; @@ -89,6 +93,9 @@ public abstract class AbstractProcess { config = ConfigManager.getInstance().getConfig(); setTrustStoreCredentials(); + + if (config.getProxy() != null && config.getProxy().getHost() != null && !config.getProxy().getHost().isEmpty()) + proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(config.getProxy().getHost(), config.getProxy().getPort())); javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() { public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) { @@ -338,7 +345,7 @@ public abstract class AbstractProcess { URL url = new URL(urlStr); - HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); + HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy); con.setRequestMethod("POST"); con.setDoInput(true); con.setDoOutput(true); @@ -450,7 +457,7 @@ public abstract class AbstractProcess { URL url = new URL(urlStr); - HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); + HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy); con.setUseCaches(false); con.setDoOutput(true); configureHttpsConnection(con); diff --git a/src/main/java/cz/trask/migration/model/ApplicationConfig.java b/src/main/java/cz/trask/migration/model/ApplicationConfig.java index 7ca8a6f..3449623 100644 --- a/src/main/java/cz/trask/migration/model/ApplicationConfig.java +++ b/src/main/java/cz/trask/migration/model/ApplicationConfig.java @@ -21,6 +21,8 @@ public class ApplicationConfig { private int maxThreads; @JsonProperty("store_migrated_artifacts") private boolean storeMigratedArtifacts = false; + @JsonProperty("proxy") + private Proxy proxy; @Data public static class TrustStore { @@ -66,4 +68,16 @@ public class ApplicationConfig { private String wso2ApisDir; } + + @Data + public static class Proxy { + @JsonProperty("host") + private String host; + @JsonProperty("port") + private int port; + @JsonProperty("username") + private String username; + @JsonProperty("password") + private String password; + } } \ No newline at end of file diff --git a/src/main/resources/apicurio-migrator.yaml b/src/main/resources/apicurio-migrator.yaml index ef66525..0983aec 100644 --- a/src/main/resources/apicurio-migrator.yaml +++ b/src/main/resources/apicurio-migrator.yaml @@ -1,3 +1,7 @@ +proxy: + host: proxy.jtfg.com + port: 3128 + source: registration_api_url: https://developerstest.jtfg.com/client-registration/v0.17/register publisher_api_url: https://developerstest.jtfg.com/api/am/publisher @@ -8,12 +12,12 @@ source: wso2_apis_dir: apis target: - registration_api_url: https://localhost:9443/client-registration/v0.17/register - publisher_api_url: https://localhost:9443/api/am/publisher/v4/apis/import - admin_api_url: https://localhost:9443/api/am/admin/v4 - devportal_api_url: https://localhost:9443/api/am/devportal - publisher_token_url: https://localhost:9443/oauth2/token - wso2_user: YWRtaW46YWRtaW4= + registration_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/client-registration/v0.17/register + publisher_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/publisher/v4/apis/import + admin_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/admin/v4 + devportal_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/devportal + publisher_token_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/oauth2/token + wso2_user: YWRtaW46Tiw5YzEpeFh0NTNr truststore: path: client-truststore.jks