Compare commits
2 Commits
c066535843
...
e26477e8d1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e26477e8d1 | ||
|
|
738be0aa10 |
Binary file not shown.
@ -9,6 +9,8 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.Proxy;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.security.KeyStore;
|
import java.security.KeyStore;
|
||||||
@ -71,6 +73,8 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
public static ObjectMapper mapper;
|
public static ObjectMapper mapper;
|
||||||
public static ObjectMapper mapperYaml;
|
public static ObjectMapper mapperYaml;
|
||||||
|
|
||||||
|
public static Proxy proxy;
|
||||||
|
|
||||||
public final RegistryClient client;
|
public final RegistryClient client;
|
||||||
|
|
||||||
@ -89,6 +93,9 @@ public abstract class AbstractProcess {
|
|||||||
config = ConfigManager.getInstance().getConfig();
|
config = ConfigManager.getInstance().getConfig();
|
||||||
|
|
||||||
setTrustStoreCredentials();
|
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() {
|
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
|
||||||
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
|
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
|
||||||
@ -338,7 +345,7 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
URL url = new URL(urlStr);
|
URL url = new URL(urlStr);
|
||||||
|
|
||||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy);
|
||||||
con.setRequestMethod("POST");
|
con.setRequestMethod("POST");
|
||||||
con.setDoInput(true);
|
con.setDoInput(true);
|
||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
@ -450,7 +457,7 @@ public abstract class AbstractProcess {
|
|||||||
|
|
||||||
URL url = new URL(urlStr);
|
URL url = new URL(urlStr);
|
||||||
|
|
||||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
HttpsURLConnection con = (HttpsURLConnection) url.openConnection(proxy);
|
||||||
con.setUseCaches(false);
|
con.setUseCaches(false);
|
||||||
con.setDoOutput(true);
|
con.setDoOutput(true);
|
||||||
configureHttpsConnection(con);
|
configureHttpsConnection(con);
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package cz.trask.migration.impl.v32;
|
package cz.trask.migration.impl.v32;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -85,7 +87,7 @@ public class Wso2AppsToApicurio extends AbstractProcess {
|
|||||||
|
|
||||||
HttpResponse exportedZip = makeRequest(
|
HttpResponse exportedZip = makeRequest(
|
||||||
"GET", config.getSource().getAdminApiUrl() + "/export/applications?appName=" + app.getName()
|
"GET", config.getSource().getAdminApiUrl() + "/export/applications?appName=" + app.getName()
|
||||||
+ "&appOwner=" + app.getOwner() + "&withKeys=true",
|
+ "&appOwner=" + URLEncoder.encode(app.getOwner(), Charset.forName("UTF-8")) + "&withKeys=true",
|
||||||
httpHeaders, Collections.emptyMap(), true);
|
httpHeaders, Collections.emptyMap(), true);
|
||||||
|
|
||||||
List<ZipEntryData> zipEntries = ZipUtils.extractFilesFromZip(exportedZip.getResponseBytes());
|
List<ZipEntryData> zipEntries = ZipUtils.extractFilesFromZip(exportedZip.getResponseBytes());
|
||||||
@ -146,7 +148,7 @@ public class Wso2AppsToApicurio extends AbstractProcess {
|
|||||||
ApplicationList listOfApps = null;
|
ApplicationList listOfApps = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String url = adminApiUrl.concat(String.format("/applications"));
|
String url = adminApiUrl.concat(String.format("/applications?limit=9999"));
|
||||||
|
|
||||||
log.debug("Getting Applications with token: '" + tokenResponse.getAccess_token() + "' URL: " + url);
|
log.debug("Getting Applications with token: '" + tokenResponse.getAccess_token() + "' URL: " + url);
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,8 @@ public class ApplicationConfig {
|
|||||||
private int maxThreads;
|
private int maxThreads;
|
||||||
@JsonProperty("store_migrated_artifacts")
|
@JsonProperty("store_migrated_artifacts")
|
||||||
private boolean storeMigratedArtifacts = false;
|
private boolean storeMigratedArtifacts = false;
|
||||||
|
@JsonProperty("proxy")
|
||||||
|
private Proxy proxy;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public static class TrustStore {
|
public static class TrustStore {
|
||||||
@ -66,4 +68,16 @@ public class ApplicationConfig {
|
|||||||
private String wso2ApisDir;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,3 +1,7 @@
|
|||||||
|
proxy:
|
||||||
|
host: proxy.jtfg.com
|
||||||
|
port: 3128
|
||||||
|
|
||||||
source:
|
source:
|
||||||
registration_api_url: https://developerstest.jtfg.com/client-registration/v0.17/register
|
registration_api_url: https://developerstest.jtfg.com/client-registration/v0.17/register
|
||||||
publisher_api_url: https://developerstest.jtfg.com/api/am/publisher
|
publisher_api_url: https://developerstest.jtfg.com/api/am/publisher
|
||||||
@ -8,12 +12,12 @@ source:
|
|||||||
wso2_apis_dir: apis
|
wso2_apis_dir: apis
|
||||||
|
|
||||||
target:
|
target:
|
||||||
registration_api_url: https://localhost:9443/client-registration/v0.17/register
|
registration_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/client-registration/v0.17/register
|
||||||
publisher_api_url: https://localhost:9443/api/am/publisher/v4/apis/import
|
publisher_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/publisher/v4/apis/import
|
||||||
admin_api_url: https://localhost:9443/api/am/admin/v4
|
admin_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/admin/v4
|
||||||
devportal_api_url: https://localhost:9443/api/am/devportal
|
devportal_api_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/api/am/devportal
|
||||||
publisher_token_url: https://localhost:9443/oauth2/token
|
publisher_token_url: https://wso2apiportal-int.apps.oshift-int.jtfg.com/oauth2/token
|
||||||
wso2_user: YWRtaW46YWRtaW4=
|
wso2_user: YWRtaW46Tiw5YzEpeFh0NTNr
|
||||||
|
|
||||||
truststore:
|
truststore:
|
||||||
path: client-truststore.jks
|
path: client-truststore.jks
|
||||||
@ -28,6 +32,6 @@ apicurio:
|
|||||||
default_api_group: api
|
default_api_group: api
|
||||||
overwrite_existing_application: true
|
overwrite_existing_application: true
|
||||||
|
|
||||||
max_threads: 8
|
max_threads: 1
|
||||||
|
|
||||||
store_migrated_artifacts: true
|
store_migrated_artifacts: true
|
||||||
Loading…
x
Reference in New Issue
Block a user