Skip to content

Commit

Permalink
add jetty-ee8-jaas
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Lamy <oliver.lamy@gmail.com>
  • Loading branch information
olamy committed May 30, 2022
1 parent a6ad015 commit 0290987
Show file tree
Hide file tree
Showing 7 changed files with 292 additions and 3 deletions.
Expand Up @@ -7,7 +7,7 @@ Enables JAAS for deployed web applications.
server

[lib]
lib/jetty-jaas-${jetty.version}.jar
lib/jetty-ee10-jaas-${jetty.version}.jar

[xml]
etc/jetty-jaas.xml
Expand Down
214 changes: 214 additions & 0 deletions jetty-ee8/jetty-ee8-jaas/pom.xml
@@ -0,0 +1,214 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8</artifactId>
<version>12.0.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>jetty-ee8-jaas</artifactId>
<name>EE9 :: Jetty :: JAAS</name>
<description>Jetty JAAS support</description>

<properties>
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name>
<apacheds.version>2.0.0.AM26</apacheds.version>
<apache.directory.api.version>2.1.0</apache.directory.api.version>
<spotbugs.onlyAnalyze>org.eclipse.jetty.jaas.*</spotbugs.onlyAnalyze>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-ee8-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-jaas/src/main/resources</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-ee8-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-jaas/src/test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-modify-sources-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-ee8-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>modify-sources-ee9-to-ee8</goal>
</goals>
<configuration>
<sourceProjectLocation>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-jaas/src/main/java</sourceProjectLocation>
<outputDirectory>${project.build.sourceDirectory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>generate-ee8-test-sources</id>
<phase>generate-test-sources</phase>
<goals>
<goal>modify-sources-ee9-to-ee8</goal>
</goals>
<configuration>
<testSources>true</testSources>
<sourceProjectLocation>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-jaas/src/test/java</sourceProjectLocation>
<outputDirectory>${project.build.testSourceDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- always include the sources to be able to prepare the eclipse-jetty-SDK feature
with a snapshot. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<failIfNoTests>false</failIfNoTests>
<argLine>--add-opens java.base/sun.security.x509=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-security</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-test-helper</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-test-framework</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<!-- exclude additional LDIF schema files to avoid conflicts through
multiple copies -->
<exclusion>
<groupId>org.apache.directory.shared</groupId>
<artifactId>shared-ldap-schema</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-ldap-schema-data</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-integ</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
<exclusions>
<!-- exclude additional LDIF schema files to avoid conflicts through
multiple copies -->
<exclusion>
<groupId>org.apache.directory.shared</groupId>
<artifactId>shared-ldap-schema</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-ldap-schema-data</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core-integ</artifactId>
<version>${apacheds.version}</version>
<scope>test</scope>
<exclusions>
<!-- exclude additional LDIF schema files to avoid conflicts through
multiple copies -->
<exclusion>
<groupId>org.apache.directory.shared</groupId>
<artifactId>shared-ldap-schema</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-ldap-schema-data</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-ldap-schema-data</artifactId>
<version>${apache.directory.api.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-ldap-model</artifactId>
<version>${apache.directory.api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-util</artifactId>
<version>${apache.directory.api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.directory.api</groupId>
<artifactId>api-asn1-api</artifactId>
<version>${apache.directory.api.version}</version>
</dependency>
<!-- because directory server do not have yet junit5 extensions -->
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

</dependencies>


</project>
21 changes: 21 additions & 0 deletions jetty-ee8/jetty-ee8-jaas/src/main/config/etc/jetty-jaas.xml
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://www.eclipse.org/jetty/configure_10_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">

<!-- ======================================================== -->
<!-- java.security.auth.login.config System property -->
<!-- This is usually a runtime parameter to the jvm, but -->
<!-- it is placed here for convenience. -->
<!-- ======================================================== -->
<Call class="java.lang.System" name="setProperty">
<Arg>java.security.auth.login.config</Arg>
<Arg>
<Call name="resolvePath" class="org.eclipse.jetty.xml.XmlConfiguration">
<Arg><Property name="jetty.base"/></Arg>
<Arg><Property name="jetty.jaas.login.conf" default="etc/login.conf" /></Arg>
</Call>
</Arg>
</Call>

</Configure>
18 changes: 18 additions & 0 deletions jetty-ee8/jetty-ee8-jaas/src/main/config/modules/jaas.mod
@@ -0,0 +1,18 @@
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html

[description]
Enables JAAS for deployed web applications.

[depend]
server

[lib]
lib/jetty-ee8-jaas-${jetty.version}.jar

[xml]
etc/jetty-jaas.xml

[ini-template]
## The file location (relative to $jetty.base) for the
## JAAS "java.security.auth.login.config" system property
# jetty.jaas.login.conf=etc/login.conf
37 changes: 36 additions & 1 deletion jetty-ee8/jetty-ee8-nested/pom.xml
Expand Up @@ -27,10 +27,45 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-ee8-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-nested/src/main/resources</directory>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-ee8-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${maven.multiModuleProjectDirectory}/jetty-ee9/jetty-ee9-nested/src/test/resources</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-modify-sources-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>generate-ee8-sources</id>
Expand Down
1 change: 1 addition & 0 deletions jetty-ee8/pom.xml
Expand Up @@ -26,6 +26,7 @@
<module>jetty-ee8-servlet</module>
<module>jetty-ee8-servlets</module>
<module>jetty-ee8-webapp</module>
<module>jetty-ee8-jaas</module>
</modules>

<build>
Expand Down
2 changes: 1 addition & 1 deletion jetty-ee9/jetty-ee9-jaas/src/main/config/modules/jaas.mod
Expand Up @@ -7,7 +7,7 @@ Enables JAAS for deployed web applications.
server

[lib]
lib/jetty-jaas-${jetty.version}.jar
lib/jetty-ee9-jaas-${jetty.version}.jar

[xml]
etc/jetty-jaas.xml
Expand Down

0 comments on commit 0290987

Please sign in to comment.