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"); }
public SsoPostLoginServlet() { maxUserSessions = EngineLocalConfig.getInstance().getInteger("ENGINE_MAX_USER_SESSIONS"); }
private void initServerUrl() throws NotificationServiceException { EngineLocalConfig config = EngineLocalConfig.getInstance(); try { if (isHttpsProtocol) { serverUrl = config.getExternalHttpsUrl(HEALTH_SERVLET_PATH); } else { serverUrl = config.getExternalHttpUrl(HEALTH_SERVLET_PATH); } log.info("Engine health servlet URL is \"{}\".", serverUrl); } catch(MalformedURLException exception) { throw new NotificationServiceException("Can't get engine health servlet URL.", exception); } }
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))); }
private static CloseableHttpClient createClient() throws IOException, GeneralSecurityException { EngineLocalConfig config = EngineLocalConfig.getInstance(); return new HttpClientBuilder() .setSslProtocol(config.getProperty("ENGINE_SSO_SERVICE_SSL_PROTOCOL")) .setPoolSize(config.getInteger("ENGINE_SSO_SERVICE_CLIENT_POOL_SIZE")) .setReadTimeout(0) .setRetryCount(config.getInteger("ENGINE_SSO_SERVICE_CONNECTION_RETRY_COUNT")) .setTrustManagerAlgorithm(TrustManagerFactory.getDefaultAlgorithm()) .setTrustStore(config.getProperty("ENGINE_HTTPS_PKI_TRUST_STORE")) .setTrustStorePassword(config.getProperty("ENGINE_HTTPS_PKI_TRUST_STORE_PASSWORD")) .setTrustStoreType(config.getProperty("ENGINE_HTTPS_PKI_TRUST_STORE_TYPE")) .setValidateAfterInactivity(config.getInteger("ENGINE_SSO_SERVICE_CONNECTION_VALIDATE_AFTER_INACTIVITY")) .setVerifyChain(config.getBoolean("ENGINE_SSO_SERVICE_SSL_VERIFY_CHAIN")) .setVerifyHost(config.getBoolean("ENGINE_SSO_SERVICE_SSL_VERIFY_HOST")) .build(); }
public void engineInitialize() { for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn("The directory '{}' cotaning configuration files does not exist.", Pattern pattern = Pattern.compile(EngineLocalConfig.getInstance() .getProperty(ENGINE_EXTENSIONS_IGNORED)); EngineLocalConfig.getInstance().getBoolean( ENGINE_EXTENSION_ENABLED + normalizeName( extension.getContext().get(
@Override public String getSysprepPath(int osId, Version version) { return EngineLocalConfig.getInstance().expandString(getValueByVersion(idToUnameLookup.get(osId), "sysprepPath", version)); }
private static Map<String, String> getParams(HttpServletRequest req) { Map<String, String> params = null; if (EngineLocalConfig.getInstance().getBoolean("ENGINE_SSO_ENABLE_EXTERNAL_SSO")) { params = new HashMap<>(); Enumeration<String> headerNames = req.getHeaderNames(); while (headerNames.hasMoreElements()) { String headerName = headerNames.nextElement(); params.put(headerName, req.getHeader(headerName)); } } return params; }
public static EngineLocalConfig getInstance() { return getInstance(null); }
public static String signOpenSSHCertificate( String name, String hostname, String principal ) throws IOException { EngineLocalConfig config = EngineLocalConfig.getInstance(); if ( !new OpenSslCAWrapper().signOpenSSHCertificate( new File(new File(config.getUsrDir(), "bin"), "pki-enroll-openssh-cert.sh"), name, hostname, principal ) ) { throw new RuntimeException("OpenSSH certificate enrollment failed"); } return new String(Files.readAllBytes( Paths.get(config.getPKIDir().getPath(), "certs", String.format("%s-cert.pub", name)))); }
EngineLocalConfig config = EngineLocalConfig.getInstance(); try { enableBackgroundCacheUpdate = config.getBoolean(ENABLE_CACHE_UPDATE_KEY, Boolean.FALSE); } catch (IllegalArgumentException e) { log.error("Missing/Invalid key \"{}\", using default value of 'false'", ENABLE_CACHE_UPDATE_KEY, e); //$NON-NLS-1$ UTILIZATION_CACHE_UPDATE_INTERVAL = config.getLong(UTILIZATION_CACHE_UPDATE_INTERVAL_KEY); } catch (IllegalArgumentException e) { log.error("Missing/Invalid key \"{}\", using default value of 300", UTILIZATION_CACHE_UPDATE_INTERVAL_KEY, e); //$NON-NLS-1$ INVENTORY_CACHE_UPDATE_INTERVAL = config.getLong(INVENTORY_CACHE_UPDATE_INTERVAL_KEY); } catch (IllegalArgumentException e) { log.error("Missing/Invalid key \"{}\", using default value of 60", INVENTORY_CACHE_UPDATE_INTERVAL_KEY, e); //$NON-NLS-1$
/** * Returns UI plugin <em>data path</em>, under which UI plugin descriptor (JSON) files are placed. */ public static String resolvePluginDataPath() { return ConfigUtil.resolvePath(EngineLocalConfig.getInstance().getUsrDir().getAbsolutePath(), UI_PLUGIN_DIR); }
private static synchronized void initCaCertificate() { if (caCertificate == null) { caCertificate = new Resource( EngineLocalConfig.getInstance().getPKICACert(), Format.X509_PEM_CA, null); } }
/** * Returns UI plugin <em>config path</em>, under which UI plugin configuration (JSON) files are placed. */ public static String resolvePluginConfigPath() { return ConfigUtil.resolvePath(EngineLocalConfig.getInstance().getEtcDir().getAbsolutePath(), UI_PLUGIN_DIR); }
/** * Returns the absolute path name of the directory that contains the API explorer application. */ public String getExplorerDirectory() { return config.getProperty(EXPLORER_DIRECTORY); } }
private static synchronized void initEngineCertificate() { if (engineCertificate == null) { engineCertificate = new Resource( EngineLocalConfig.getInstance().getPKIEngineCert(), Format.X509_PEM, Config.getValue(ConfigValues.SSHKeyAlias)); } }
localhost = EngineLocalConfig.getInstance().getHost();
EngineLocalConfig config = EngineLocalConfig.getInstance(); if(config.getEngineUpMark().exists()) {
/** * Returns a boolean that indicates if the <i>filter</i> mechanism should be enabled by default for users that * aren't administrators. */ public boolean getFilterByDefault() { return config.getBoolean(FILTER_BY_DEFAULT); }
public int getProxyHttpPort() { return getInteger("ENGINE_PROXY_HTTP_PORT"); }