/** * Returns the absolute path name of the directory that contains the API explorer application. */ public String getExplorerDirectory() { return config.getProperty(EXPLORER_DIRECTORY); } }
public String getPKIEngineStoreType() { return getProperty("ENGINE_PKI_ENGINE_STORE_TYPE"); }
public String getPKIEngineStorePassword() { return getProperty("ENGINE_PKI_ENGINE_STORE_PASSWORD"); }
/** * Returns the default version of the API, the one that should be used when the caller doesn't explicitly request * a specific version. */ public String getDefaultVersion() { return config.getProperty(DEFAULT_VERSION); }
public String getPKITrustStoreType() { return getProperty("ENGINE_PKI_TRUST_STORE_TYPE"); }
public String getPKIEngineStoreAlias() { return getProperty("ENGINE_PKI_ENGINE_STORE_ALIAS"); }
public String getEngineURI(){ return getProperty("ENGINE_URI"); }
public String getExternalProvidersTrustStorePassword() { return getProperty("ENGINE_EXTERNAL_PROVIDERS_TRUST_STORE_PASSWORD"); }
public String getPKITrustStorePath() { return getProperty("ENGINE_PKI_TRUST_STORE"); }
public String getHttpsPKITrustStorePath() { return getProperty("ENGINE_HTTPS_PKI_TRUST_STORE"); }
public String getHost() { return getProperty("ENGINE_FQDN"); }
public String getExternalProvidersTrustStoreType() { return getProperty("ENGINE_EXTERNAL_PROVIDERS_TRUST_STORE_TYPE"); }
public String getPKITrustStorePassword() { return getProperty("ENGINE_PKI_TRUST_STORE_PASSWORD"); }
public String getSsoStoreEku() { return getProperty("ENGINE_SSO_ENGINE_STORE_EKU"); }
private Set<String> getVersions(String key) { String value = config.getProperty(key); if (value == null || value.isEmpty()) { return Collections.emptySet(); } String[] chunks = value.split("\\s*,\\s*"); Set<String> versions = new HashSet<>(); Collections.addAll(versions, chunks); return versions; }
private static void setClientIdSecretBasicAuthHeader(HttpUriRequest request) { EngineLocalConfig config = EngineLocalConfig.getInstance(); byte[] encodedBytes = Base64.encodeBase64(String.format("%s:%s", config.getProperty("ENGINE_SSO_CLIENT_ID"), config.getProperty("ENGINE_SSO_CLIENT_SECRET")).getBytes()); request.setHeader(FiltersHelper.Constants.HEADER_AUTHORIZATION, String.format("Basic %s", new String(encodedBytes))); }
public static String getEngineUrl(HttpServletRequest request) { return String.format("%s://%s:%s%s", request.getScheme(), FiltersHelper.getRedirectUriServerName(request.getServerName()), request.getServerPort(), EngineLocalConfig.getInstance().getProperty("ENGINE_URI")); }
private static HttpGet createGet(String path) throws Exception { EngineLocalConfig config = EngineLocalConfig.getInstance(); String base = config.getProperty("ENGINE_SSO_SERVICE_URL"); HttpGet request = new HttpGet(); request.setURI(new URI(base + path)); request.setHeader("Accept", "application/json"); return request; }
private static HttpPost createPost(String path) throws Exception { EngineLocalConfig config = EngineLocalConfig.getInstance(); String base = config.getProperty("ENGINE_SSO_SERVICE_URL"); HttpPost request = new HttpPost(); request.setURI(new URI(base + path)); request.setHeader("Accept", "application/json"); request.setHeader("Content-Language", "en-US"); return request; }
public static String getEngineSsoUrl(HttpServletRequest request) { if (EngineLocalConfig.getInstance().getBoolean("ENGINE_SSO_INSTALLED_ON_ENGINE_HOST")) { return String.format("%s://%s:%s%s", request.getScheme(), FiltersHelper.getRedirectUriServerName(request.getServerName()), request.getServerPort(), EngineLocalConfig.getInstance().getProperty("ENGINE_SSO_SERVICE_URI")); } return EngineLocalConfig.getInstance().getProperty("ENGINE_SSO_AUTH_URL"); }