Search in sources :

Example 1 with MessageSecurityConfig

use of com.sun.appserv.management.config.MessageSecurityConfig in project Payara by payara.

the class MessageSecurityConfigTest method testCreateRemove.

/**
 *     Note: this can't be tested except by making a new one, and the names are predefined, so
 *     if it already exists, it must be deleted first.
 */
public void testCreateRemove() {
    final SecurityServiceConfig ss = getDefaultSecurityServiceConfig(getDomainRoot());
    final Map<String, MessageSecurityConfig> messageSecurityConfigs = ss.getMessageSecurityConfigMap();
    MessageSecurityConfig msc = messageSecurityConfigs.get(AUTH_TYPE);
    if (msc != null) {
        ss.removeMessageSecurityConfig(AUTH_TYPE);
        msc = null;
    }
    msc = create(getDomainRoot(), AUTH_TYPE);
    ss.removeMessageSecurityConfig(AUTH_TYPE);
}
Also used : SecurityServiceConfig(com.sun.appserv.management.config.SecurityServiceConfig) MessageSecurityConfig(com.sun.appserv.management.config.MessageSecurityConfig)

Example 2 with MessageSecurityConfig

use of com.sun.appserv.management.config.MessageSecurityConfig in project Payara by payara.

the class MessageSecurityConfigTest method create.

private static MessageSecurityConfig create(final DomainRoot domainRoot, final String authLayer) {
    final SecurityServiceConfig ss = getDefaultSecurityServiceConfig(domainRoot);
    final Map<String, String> optional = new HashMap<String, String>();
    final MessageSecurityConfig msc = ss.createMessageSecurityConfig(authLayer, "ClientProvider", ProviderConfig.PROVIDER_TYPE_CLIENT, "com.sun.xml.wss.provider.ClientSecurityAuthModul", optional);
    msc.createProviderConfig("ServerProvider", ProviderConfig.PROVIDER_TYPE_SERVER, "com.sun.xml.wss.provider.ServerSecurityAuthModule", optional);
    msc.createProviderConfig("DummyProvider1", ProviderConfig.PROVIDER_TYPE_SERVER, "AMX.TEST.DummySecurityAuthModule", optional);
    msc.createProviderConfig("DummyProvider2", ProviderConfig.PROVIDER_TYPE_SERVER, "AMX.TEST.DummySecurityAuthModule", optional);
    msc.removeProviderConfig("DummyProvider1");
    msc.removeProviderConfig("DummyProvider2");
    return msc;
}
Also used : HashMap(java.util.HashMap) SecurityServiceConfig(com.sun.appserv.management.config.SecurityServiceConfig) MessageSecurityConfig(com.sun.appserv.management.config.MessageSecurityConfig)

Aggregations

MessageSecurityConfig (com.sun.appserv.management.config.MessageSecurityConfig)2 SecurityServiceConfig (com.sun.appserv.management.config.SecurityServiceConfig)2 HashMap (java.util.HashMap)1