IOTS-292: Adding new filter configs

4.x.x
amalhub 8 years ago
parent 0bd298e6d7
commit 7e90fde461

@ -84,7 +84,7 @@ public class AuthenticationHandler implements Handler {
String accessToken = getAccessToken();
URI certVerifyUrl = new URI(AuthConstants.HTTPS + "://" + CoreUtils.getHost() + ":" + CoreUtils
.getHttpsPort() + "/api/certificate-mgt/v1.0/admin/certificates/verify/ios");
.getHttpsPort() + CoreUtils.getIosVerifyEndpoint());
Map<String, String> certVerifyHeaders = new HashMap<>();
certVerifyHeaders.put("Authorization", "Bearer " + accessToken);
certVerifyHeaders.put("Content-Type", "application/json");
@ -103,7 +103,7 @@ public class AuthenticationHandler implements Handler {
CoreUtils.debugLog(log, "Verify subject DN: ", subjectDN);
String accessToken = getAccessToken();
URI certVerifyUrl = new URI(AuthConstants.HTTPS + "://" + CoreUtils.getHost() + ":" + CoreUtils
.getHttpsPort() + "/api/certificate-mgt/v1.0/admin/certificates/verify/android");
.getHttpsPort() + CoreUtils.getAndroidVerifyEndpoint());
Map<String, String> certVerifyHeaders = new HashMap<>();
certVerifyHeaders.put("Authorization", "Bearer " + accessToken);
certVerifyHeaders.put("Content-Type", "application/json");
@ -123,7 +123,7 @@ public class AuthenticationHandler implements Handler {
String accessToken = getAccessToken();
URI certVerifyUrl = new URI(AuthConstants.HTTPS + "://" + CoreUtils.getHost() + ":" + CoreUtils
.getHttpsPort() + "/api/certificate-mgt/v1.0/admin/certificates/verify/ios");
.getHttpsPort() + CoreUtils.getAndroidVerifyEndpoint());
Map<String, String> certVerifyHeaders = new HashMap<>();
certVerifyHeaders.put("Authorization", "Bearer " + accessToken);
certVerifyHeaders.put("Content-Type", "application/json");

@ -28,6 +28,8 @@ public class AuthConstants {
public static final String HTTPS_PORT = "httpsPort";
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String IOS_VERIFY_ENDPOINT = "ios-verify-endpoint";
public static final String ANDROID_VERIFY_ENDPOINT = "android-verify-endpoint";
public static final String MDM_SIGNATURE = "mdm-signature";
public static final String PROXY_MUTUAL_AUTH_HEADER = "proxy-mutual-auth-header";
public static final String ENCODED_PEM = "encoded-pem";

@ -37,6 +37,8 @@ public class CoreUtils {
private static int httpsPort = 9443;
private static String username = "admin";
private static String password = "admin";
private static String iosVerifyEndpoint = "/api/certificate-mgt/v1.0/admin/certificates/verify/ios";
private static String androidVerifyEndpoint = "/api/certificate-mgt/v1.0/admin/certificates/verify/android";
/**
* Reading configurations from api-filter-config.xml file
@ -88,6 +90,12 @@ public class CoreUtils {
} else if (AuthConstants.PASSWORD.equals(beanName)) {
String value = beanProp.getAttributeValue(new QName(null, "value"));
password = value;
} else if (AuthConstants.IOS_VERIFY_ENDPOINT.equals(beanName)) {
String value = beanProp.getAttributeValue(new QName(null, "value"));
iosVerifyEndpoint = value;
} else if (AuthConstants.ANDROID_VERIFY_ENDPOINT.equals(beanName)) {
String value = beanProp.getAttributeValue(new QName(null, "value"));
androidVerifyEndpoint = value;
}
}
}
@ -137,4 +145,12 @@ public class CoreUtils {
public static String getPassword() {
return password;
}
public static String getIosVerifyEndpoint() {
return iosVerifyEndpoint;
}
public static String getAndroidVerifyEndpoint() {
return androidVerifyEndpoint;
}
}

@ -18,5 +18,7 @@
<property name="httpsPort" value="9443"/>
<property name="username" value="admin"/>
<property name="password" value="admin"/>
<property name="ios-verify-endpoint" value="/api/certificate-mgt/v1.0/admin/certificates/verify/ios"/>
<property name="android-verify-endpoint" value="/api/certificate-mgt/v1.0/admin/certificates/verify/android"/>
</bean>
</beans>
Loading…
Cancel
Save