Package org.apache.synapse.securevault.secret

Examples of org.apache.synapse.securevault.secret.SecretInformation


        if (jmxInformation.isAuthenticate()) {

            if (jmxInformation.getRemotePasswordFile() != null) {
                env.put("jmx.remote.x.password.file", jmxInformation.getRemotePasswordFile());
            } else {
                SecretInformation secretInformation = jmxInformation.getSecretInformation();
                // Get the global secret resolver
                //TODO This should be properly implemented if JMX adapter is going to use out side synapse
                PasswordManager pwManager = PasswordManager.getInstance();
                if (pwManager.isInitialized()) {
                    secretInformation.setGlobalSecretResolver(pwManager.getSecretResolver());
                }
                env.put(JMXConnectorServer.AUTHENTICATOR,
                        new JmxSecretAuthenticator(jmxInformation.getSecretInformation()));
            }
View Full Code Here


        // Prefix for getting particular JMX properties
        String prefix = JmxConfigurationConstants.PROP_SYNAPSE_PREFIX_JMX;

        JmxInformation jmxInformation = new JmxInformation();

        SecretInformation secretInformation = SecretInformationFactory.createSecretInformation(
                properties, prefix, null);
        secretInformation.setToken(JmxConfigurationConstants.JMX_PROTECTED_TOKEN);

        jmxInformation.setSecretInformation(secretInformation);

        int jndiPort = MiscellaneousUtil.getProperty(
                properties, prefix + JmxConfigurationConstants.PROP_JNDI_PORT, -1, Integer.class);
        jmxInformation.setJndiPort(jndiPort);

        int rmiPort = MiscellaneousUtil.getProperty(
                properties, prefix + JmxConfigurationConstants.PROP_RMI_PORT, 0, Integer.class);
        jmxInformation.setRmiPort(rmiPort);

        String jmxHostName = MiscellaneousUtil.getProperty(
                properties, prefix + JmxConfigurationConstants.PROP_HOSTNAME, null);
        if (jmxHostName == null || jmxHostName.trim().length() == 0) {
            jmxHostName = defaultHostName;
        }
        jmxInformation.setHostName(jmxHostName);

        // begin of special JMX security options
        Properties managementProperties = readManagementProperties();

        Boolean authenticate;
        String value = getConfigProperty(
                managementProperties, "com.sun.management.jmxremote.authenticate");
        if (value != null) {
            authenticate = Boolean.valueOf(value);
        } else {
            if (secretInformation.getUser() == null) {
                authenticate = Boolean.FALSE;
            } else {
                authenticate = Boolean.TRUE;
            }
        }
View Full Code Here

        // Prefix for getting particular data source's properties
        String prefix = buffer.toString();
        addProperty(properties, prefix + DataSourceConstants.PROP_DS_NAME,
                information.getDatasourceName());

        SecretInformation secretInformation = information.getSecretInformation();
        if (secretInformation != null) {

            String user = secretInformation.getUser();
            if (user != null && !"".equals(user)) {
                addProperty(properties, prefix + SecurityConstants.PROP_USER_NAME,
                        user);
            }

            String password = secretInformation.getAliasSecret();
            if (password != null && !"".equals(password)) {
                addProperty(properties, prefix + SecurityConstants.PROP_PASSWORD,
                        password);
            }
View Full Code Here

        } else {
            keyStoreWrapper = new IdentityKeyStoreWrapper();
            IdentityKeyStoreInformation identityKeyStore =
                    (IdentityKeyStoreInformation) keystoreInformation;

            SecretInformation secretInformation = identityKeyStore.getKeyPasswordProvider();
            if (secretInformation != null) { //TODO validate
                ((IdentityKeyStoreWrapper) keyStoreWrapper).init(identityKeyStore,
                        secretInformation.getResolvedSecret());
            }
        }
        init();
    }
View Full Code Here

        DataSourceInformation dataSourceInformation = new DataSourceInformation();

        dataSourceInformation.setDriver(getValue(pool, DRIVER_Q));
        dataSourceInformation.setUrl(getValue(pool, URL_Q));

        SecretInformation secretInformation = new SecretInformation();
        secretInformation.setUser(getValue(pool, USER_Q));
        secretInformation.setAliasSecret(getValue(pool, PASS_Q));
        dataSourceInformation.setSecretInformation(secretInformation);

        // Save element configuration for later de-serialization
        saveElementConfig(pool, DRIVER_Q, mediator);
        saveElementConfig(pool, URL_Q, mediator);
View Full Code Here

        assertEmpty(keyStore, KEY_STORE);
        information.setLocation(keyStore);
        information.setStoreType(getArgument(cmd, STORE_TYPE, KeyStoreType.JKS.toString()));
        String storePass = getArgument(cmd, STORE_PASS, null);
        assertEmpty(storePass, STORE_PASS);
        SecretInformation secretInformation = new SecretInformation();
        secretInformation.setAliasSecret(storePass);
        information.setKeyStorePasswordProvider(secretInformation);

        return information;
    }
View Full Code Here

        assertEmpty(keyStore, KEY_STORE);
        information.setLocation(keyStore);
        information.setStoreType(getArgument(cmd, STORE_TYPE, KeyStoreType.JKS.toString()));
        String storePass = getArgument(cmd, STORE_PASS, null);
        assertEmpty(storePass, STORE_PASS);
        SecretInformation secretInformation = new SecretInformation();
        secretInformation.setAliasSecret(storePass);
        information.setKeyStorePasswordProvider(secretInformation);

        return information;
    }
View Full Code Here

        if (dataSourceInformation == null) {
            throw new SynapseCommonsException("DataSource information is null", log);
        }

        // Sets the global secret resolver
        SecretInformation secretInformation = dataSourceInformation.getSecretInformation();
        if (secretInformation != null) {
            secretInformation.setGlobalSecretResolver(secretResolver);
        }

        dataSourceInformationMap.put(dataSourceInformation.getAlias(), dataSourceInformation);
        if (assertListerNotNull()) {
            listener.addDataSourceInformation(dataSourceInformation);
View Full Code Here

        String passwordPrompt = MiscellaneousUtil.getProperty(
                properties, prefix + SecurityConstants.PROP_PASSWORD_PROMPT,
                "Password for datasource " + dsName, String.class);

        SecretInformation secretInformation = SecretInformationFactory.createSecretInformation(
                properties, prefix, passwordPrompt);
        secretInformation.setToken(dsName + "." + SecurityConstants.PROP_PASSWORD);
        datasourceInformation.setSecretInformation(secretInformation);

        return datasourceInformation;
    }
View Full Code Here

        if (jmxInformation.isAuthenticate()) {

            if (jmxInformation.getRemotePasswordFile() != null) {
                env.put("jmx.remote.x.password.file", jmxInformation.getRemotePasswordFile());
            } else {
                SecretInformation secretInformation = jmxInformation.getSecretInformation();
                // Get the global secret resolver
                //TODO This should be properly implemented if JMX adapter is going to use out side synapse
                PasswordManager pwManager = PasswordManager.getInstance();
                if (pwManager.isInitialized()) {
                    secretInformation.setGlobalSecretResolver(pwManager.getSecretResolver());
                }
                env.put(JMXConnectorServer.AUTHENTICATOR,
                        new JmxSecretAuthenticator(jmxInformation.getSecretInformation()));
            }
View Full Code Here

TOP

Related Classes of org.apache.synapse.securevault.secret.SecretInformation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.