use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.
the class IpTagMigrationStep method execute.
@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
element.setNamespace(IP_FILTER_NAMESPACE);
final List<Content> content = detachContent(element.getContent());
if (content.size() > 0) {
element.setAttribute(new Attribute(PolicyMigrationStep.VALUE_ATTR_NAME, (content.get(0)).getValue()));
}
}
use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.
the class ProxyRequestHeadersProcessorMigrationStep method execute.
@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
new ProxyPomContributionMigrationStep(true).execute(getApplicationModel().getPomModel().get(), migrationReport);
addConfigElement(element, migrationReport);
element.setName(REQUEST_HEADERS);
element.setNamespace(PROXY_NAMESPACE);
element.removeAttribute(CLASS);
element.setAttribute(new Attribute(CONFIG_REF, PROXY_CONFIG));
element.setAttribute(new Attribute(TARGET, PROXY_REQUEST_HEADERS));
}
use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.
the class ProxyResponseHeadersProcessorMigrationStep method execute.
@Override
public void execute(Element element, MigrationReport migrationReport) throws RuntimeException {
new ProxyPomContributionMigrationStep(true).execute(getApplicationModel().getPomModel().get(), migrationReport);
addConfigElement(element, migrationReport);
element.setName(RESPONSE_HEADERS);
element.setNamespace(PROXY_NAMESPACE);
element.removeAttribute(CLASS);
element.setAttribute(new Attribute(CONFIG_REF, PROXY_CONFIG));
element.setAttribute(new Attribute(TARGET, PROXY_RESPONSE_HEADERS));
}
use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.
the class AbstractIpFilterMigrationStep method migrateBlacklistWhitelistElement.
protected void migrateBlacklistWhitelistElement(Element element, final String configRefAttrValue) {
element.setNamespace(IP_FILTER_NAMESPACE);
element.setAttribute(new Attribute(CONFIG_REF_ATTR_NAME, configRefAttrValue));
setIpAddressAttribute(element);
setConfigNameAttribute(element, configRefAttrValue);
moveBlacklistWhitelistContent(element);
}
use of com.mindbright.security.x509.Attribute in project mule-migration-assistant by mulesoft.
the class OAuth2ProviderCreateClient method execute.
@Override
public void execute(Element element, MigrationReport report) throws RuntimeException {
final Element cfg = getApplicationModel().getNode("/*/*[namespace-uri() = '" + OAUTH2_PROVIDER_NAMESPACE_URI + "' and local-name() = 'config']");
element.setAttribute("config-ref", cfg.getAttributeValue("name"));
migrateExpression(element.getAttribute("clientId"), getExpressionMigrator());
migrateExpression(element.getAttribute("secret"), getExpressionMigrator());
migrateExpression(element.getAttribute("type"), getExpressionMigrator());
migrateExpression(element.getAttribute("principal"), getExpressionMigrator());
final Element redirectUris = element.getChild("redirect-uris", OAUTH2_PROVIDER_NAMESPACE);
if (redirectUris != null) {
final Attribute redirectUrisRef = redirectUris.getAttribute("ref");
migrateExpression(redirectUrisRef, getExpressionMigrator());
redirectUrisRef.detach();
element.setAttribute(redirectUrisRef.setName("redirectUris"));
redirectUris.detach();
}
final Element authorizedGrantTypes = element.getChild("authorized-grant-types", OAUTH2_PROVIDER_NAMESPACE);
if (authorizedGrantTypes != null) {
final Attribute authorizedGrantTypesRef = authorizedGrantTypes.getAttribute("ref");
migrateExpression(authorizedGrantTypesRef, getExpressionMigrator());
authorizedGrantTypesRef.detach();
element.setAttribute(authorizedGrantTypesRef.setName("authorizedGrantTypes"));
authorizedGrantTypes.detach();
}
final Element scopes = element.getChild("scopes", OAUTH2_PROVIDER_NAMESPACE);
if (scopes != null) {
final Attribute scopesRef = scopes.getAttribute("ref");
migrateExpression(scopesRef, getExpressionMigrator());
scopesRef.detach();
element.setAttribute(scopesRef.setName("scopes"));
scopes.detach();
}
}
Aggregations