Skip to content

Commit

Permalink
Merge branch 'master' into WINDUPRULE-1018
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipCattanach authored Aug 23, 2023
2 parents bba4e77 + 0438b5a commit 46976d5
Show file tree
Hide file tree
Showing 14 changed files with 360 additions and 214 deletions.
416 changes: 245 additions & 171 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-parent</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>

<name>Windup Rulesets Parent</name>
<packaging>pom</packaging>
Expand All @@ -29,7 +29,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<version.windup>6.3.0-SNAPSHOT</version.windup>
<version.windup>6.4.0-SNAPSHOT</version.windup>
</properties>

<scm>
Expand Down
2 changes: 1 addition & 1 deletion rules-themed/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-parent</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets-themed</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rules-themed/rules-mta/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-themed</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets-mta</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rules-themed/rules-mtr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-themed</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets-mtr</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rules-themed/rules-tackle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-themed</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets-tackle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rules-themed/rules-windup/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-themed</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets-windup</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jboss.windup.rules</groupId>
<artifactId>windup-rulesets-parent</artifactId>
<version>6.3.0-SNAPSHOT</version>
<version>6.4.0-SNAPSHOT</version>
</parent>

<artifactId>windup-rulesets</artifactId>
Expand Down
46 changes: 46 additions & 0 deletions rules/rules-reviewed/eap7/elytron/elytron.windup.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="elytron-eap71"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<metadata>
<description>
This ruleset provides analysis of applications that Picketlink STS and may require
This ruleset provides analysis to migrate to Elytron in JBoss EAP 7.1
</description>
<dependencies>
<addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
<addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
</dependencies>
<sourceTechnology id="eap" versionRange="(,7.1)" />
<targetTechnology id="eap" versionRange="[7.1,)" />
<tag>eap7</tag>
</metadata>
<rules>
<rule id="elytron-eap71-00000">
<when>
<filecontent pattern="&quot;org.jboss.naming.remote.client.InitialContextFactory&quot;"/>
</when>
<perform>
<hint title="Migrate a Naming Client Configuration to Elytron" effort="3" category-id="potential">
<message>
Migrate a client application that performs a remote JNDI lookup using an `org.jboss.naming.remote.client.InitialContext` class, which is backed by an `org.jboss.naming.remote.client.InitialContextFactory` class, to Elytron.
</message>
<link href="https://access.redhat.com/documentation/es-es/red_hat_jboss_enterprise_application_platform/7.2/html/migration_guide/migrating_to_elytron#migrate_naming_client_configuration_to_elytron" title="Migrate a Naming Client Configuration to Elytron"/>
</hint>
</perform>
</rule>
<rule id="elytron-eap71-00010">
<when>
<file filename="jboss-ejb-client.properties"/>
</when>
<perform>
<hint title="Migrate an EJB Client to Elytron" effort="3" category-id="potential">
<message>
Remote EJB client must be configured following one of the two options defined in the link below.
</message>
<link href="https://access.redhat.com/documentation/es-es/red_hat_jboss_enterprise_application_platform/7.2/html/migration_guide/migrating_to_elytron#migrate_security_ejb_client_to_elytron" title="Migrate an EJB Client to Elytron"/>
</hint>
</perform>
</rule>
</rules>
</ruleset>
17 changes: 17 additions & 0 deletions rules/rules-reviewed/eap7/elytron/tests/data/Elytron.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import org.jboss.naming.remote.client.InitialContextFactory;

import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.InitialContextFactory;
import java.util.Hashtable;

public class Elytron {
public static void main(String[] args) {
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
properties.put(Context.PROVIDER_URL,"http-remoting://127.0.0.1:8080");
properties.put(Context.SECURITY_PRINCIPAL, "bob");
properties.put(Context.SECURITY_CREDENTIALS, "secret");
InitialContext context = new InitialContext(properties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=127.0.0.1
remote.connection.default.port = 8080
remote.connection.default.username=bob
remote.connection.default.password=secret
35 changes: 35 additions & 0 deletions rules/rules-reviewed/eap7/elytron/tests/elytron.windup.test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<ruletest xmlns="http://windup.jboss.org/schema/jboss-ruleset"
id="elytron-eap71-test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
<testDataPath>data</testDataPath>
<rulePath>../elytron.windup.xml</rulePath>
<ruleset>
<rules>
<rule id="elytron-eap71-00000-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="Migrate a client application that performs a remote JNDI lookup using an `org.jboss.naming.remote.client.InitialContext` class, which is backed by an `org.jboss.naming.remote.client.InitialContextFactory` class, to Elytron." />
</iterable-filter>
</not>
</when>
<perform>
<fail message="elytron-eap71-00000 rule hint was not found!" />
</perform>
</rule>
<rule id="elytron-eap71-00010-test">
<when>
<not>
<iterable-filter size="1">
<hint-exists message="Remote EJB client must be configured following one of the two options defined in the link below." />
</iterable-filter>
</not>
</when>
<perform>
<fail message="elytron-eap71-00010 rule hint was not found!" />
</perform>
</rule>
</rules>
</ruleset>
</ruletest>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</rule>
<rule id="configuration-management-0200">
<when>
<file filename="application{profile}.{extension}" />
<file filename="application{profile}.properties" />
</when>
<perform>
<classification title="Application properties file detected" category-id="information" effort="0">
Expand All @@ -40,13 +40,10 @@
<where param="profile">
<matches pattern=".*" />
</where>
<where param="extension">
<matches pattern="(properties|yml|yaml)" />
</where>
</rule>
<rule id="configuration-management-0300">
<when>
<filecontent filename="application{profile}.{extension}" pattern="spring.datasource" />
<filecontent filename="application{profile}.properties" pattern="spring.datasource" />
</when>
<perform>
<classification title="Spring datasource properties detected" category-id="information" effort="0">
Expand All @@ -57,13 +54,10 @@
<where param="profile">
<matches pattern=".*" />
</where>
<where param="extension">
<matches pattern="(properties|yml|yaml)" />
</where>
</rule>
<rule id="configuration-management-0400">
<when>
<filecontent filename="application{profile}.{extension}" pattern="logging.level.org.springframework" />
<filecontent filename="application{profile}.properties" pattern="logging.level.org.springframework" />
</when>
<perform>
<classification title="Spring logging properties detected" category-id="information" effort="0">
Expand All @@ -74,9 +68,6 @@
<where param="profile">
<matches pattern=".*" />
</where>
<where param="extension">
<matches pattern="(properties|yml|yaml)" />
</where>
</rule>
<rule id="configuration-management-0500">
<when>
Expand Down

0 comments on commit 46976d5

Please sign in to comment.