5 Commits

Author SHA1 Message Date
12c1ff879b removed obsolete settings 2023-12-10 22:23:50 +01:00
db42afb4da Merge branch 'develop' into feature/jakrtaee10 2023-12-10 22:22:57 +01:00
954444bdfc updated dependencies 2023-12-10 22:21:52 +01:00
fc81092752 prepare release 2023-12-10 22:03:12 +01:00
613a74ca92 update dependencies 2023-11-02 23:06:05 +01:00
14 changed files with 256 additions and 246 deletions

View File

@ -1,3 +1,4 @@
<!--
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
@ -13,8 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.muehlencord.shared</groupId>
@ -24,7 +24,7 @@ limitations under the License.
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<name>shared-configuration</name>
@ -36,7 +36,7 @@ limitations under the License.
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

View File

@ -26,7 +26,7 @@ limitations under the License.
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<name>shared-db</name>
@ -61,7 +61,7 @@ limitations under the License.
<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

View File

@ -15,12 +15,13 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<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/xsd/maven-4.0.0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<groupId>de.muehlencord.shared</groupId>

View File

@ -25,15 +25,16 @@ limitations under the License.
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>http://maven.apache.org</url>
<version>2.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
@ -48,8 +49,8 @@ limitations under the License.
</dependency>
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<artifactId>javax.mail</artifactId>
<groupId>com.sun.mail</groupId>
</dependency>
<dependency>
<artifactId>ews-java-api</artifactId>
@ -62,10 +63,16 @@ limitations under the License.
<scope>compile</scope>
</dependency>
<dependency>
<artifactId>jaxws-api</artifactId>
<groupId>javax.xml.ws</groupId>
<scope>test</scope>
</dependency>
<!-- Test -->
<dependency>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
@ -75,4 +82,7 @@ limitations under the License.
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>

View File

@ -16,20 +16,20 @@
package de.muehlencord.shared.network.mail;
import de.muehlencord.shared.util.StringUtil;
import jakarta.mail.Flags;
import jakarta.mail.Folder;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Session;
import jakarta.mail.Store;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.search.MessageIDTerm;
import jakarta.mail.search.SearchTerm;
import jakarta.mail.util.SharedByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.internet.MimeMessage;
import javax.mail.search.MessageIDTerm;
import javax.mail.search.SearchTerm;
import javax.mail.util.SharedByteArrayInputStream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -15,12 +15,12 @@
*/
package de.muehlencord.shared.network.mail;
import jakarta.mail.Address;
import jakarta.mail.internet.InternetAddress;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import javax.mail.Address;
import javax.mail.internet.InternetAddress;
/**
* A mail message

View File

@ -16,19 +16,18 @@
package de.muehlencord.shared.network.mail;
import static de.muehlencord.shared.util.StringUtil.getStackTraceString;
import jakarta.mail.BodyPart;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringWriter;
import java.util.Locale;
import javax.mail.BodyPart;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -19,7 +19,7 @@ import de.muehlencord.shared.network.mail.DefaultMailReader;
import de.muehlencord.shared.network.mail.MailProtocol;
import de.muehlencord.shared.network.mail.MailReaderConfiguration;
import de.muehlencord.shared.network.mail.MailReaderConnectionException;
import jakarta.mail.Session;
import javax.mail.Session;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -25,16 +25,17 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
*
* @author Joern Muehlencord (joern@muehlencord.de)
*/
class HttpLayerTest extends BaseTest {
public class HttpLayerTest extends BaseTest {
@Test
@Disabled
void testPostByMap() throws Exception {
public void testPostByMap() throws Exception {
System.out.println("testPostByMap");
Map<String, String[]> map = new HashMap<>();
String[] value = { "Hello World!", "Hello World again" };
String[] value = {"Hello World!", "Hello World again"};
map.put("message", value);
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
@ -43,15 +44,15 @@ class HttpLayerTest extends BaseTest {
@Test
@Disabled
void testPostByMapList() throws Exception {
public void testPostByMapList() throws Exception {
System.out.println("testPostByMapList");
List<Map<String, String[]>> list = new LinkedList<>();
Map<String, String[]> map = new HashMap<>();
String[] value = { "Hello World!", "Hello World again" };
String[] value = {"Hello World!", "Hello World again"};
map.put("message", value);
list.add(map);
map = new HashMap<>();
String[] urlValue = { "http://localhost:8080/testurl" };
String[] urlValue = {"http://localhost:8080/testurl"};
map.put("url", urlValue);
list.add(map);
@ -61,14 +62,14 @@ class HttpLayerTest extends BaseTest {
@Test
@Disabled
void testByValue() throws Exception {
public void testByValue() throws Exception {
System.out.println("testByValue");
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
httpLayer.post("message", "Hello World by single parameter");
}
@Test
void testWithUnknownURL() throws MessageNotSendException {
public void testWithUnknownURL() throws MessageNotSendException {
System.out.println("testWithUnknownURL");
HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist");
Assertions.assertThrows(MessageNotSendException.class, () -> {
@ -78,7 +79,7 @@ class HttpLayerTest extends BaseTest {
}
@Test
void testInvalidURL() throws MessageNotSendException {
public void testInvalidURL() throws MessageNotSendException {
System.out.println("testInvalidURL");
HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de");
Assertions.assertThrows(MessageNotSendException.class, () -> {
@ -87,7 +88,7 @@ class HttpLayerTest extends BaseTest {
}
@Test
void testUnsupportedURL() throws MessageNotSendException {
public void testUnsupportedURL() throws MessageNotSendException {
System.out.println("testUnsupportedURL");
HttpLayer httpLayer = new HttpLayer("ftp://localhost");
Assertions.assertThrows(MessageNotSendException.class, () -> {

View File

@ -15,19 +15,6 @@
*/
package de.muehlencord.shared.network.mail;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import jakarta.mail.Message;
import jakarta.mail.MessagingException;
import jakarta.mail.Multipart;
import jakarta.mail.PasswordAuthentication;
import jakarta.mail.Session;
import jakarta.mail.Transport;
import jakarta.mail.internet.AddressException;
import jakarta.mail.internet.InternetAddress;
import jakarta.mail.internet.MimeBodyPart;
import jakarta.mail.internet.MimeMessage;
import jakarta.mail.internet.MimeMultipart;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
@ -35,6 +22,18 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import static org.junit.jupiter.api.Assumptions.assumeFalse;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -64,7 +63,7 @@ public class TestSendMail {
props.put("mail.smtp.port", "587");
props.put("mail.debug", "true");
Session mailSession = Session.getInstance(props, new jakarta.mail.Authenticator() {
Session mailSession = Session.getInstance(props, new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(RECEIVER, PASSWORD);

View File

@ -47,9 +47,9 @@ limitations under the License.
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</project>

87
pom.xml
View File

@ -20,7 +20,7 @@ limitations under the License.
<groupId>de.muehlencord</groupId>
<artifactId>shared</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
<name>shared</name>
<packaging>pom</packaging>
@ -87,10 +87,10 @@ limitations under the License.
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>2.0.12</slf4j.version>
<jackson.version>2.16.1</jackson.version>
<slf4j.version>2.0.9</slf4j.version>
<jackson.version>2.16.0</jackson.version>
<lombok.version>1.18.30</lombok.version>
<junit.version>5.10.2</junit.version>
<junit.version>5.10.1</junit.version>
<poi.version>5.2.5</poi.version>
<commons-net.version>3.10.0</commons-net.version>
@ -98,25 +98,14 @@ limitations under the License.
<gson.version>2.10.1</gson.version>
<fusionauth.version>5.3.1</fusionauth.version>
<bouncycastle.version>1.70</bouncycastle.version>
<hibernate.version>6.1.7.Final</hibernate.version>
<jakarta.mail-api.version>2.1.2</jakarta.mail-api.version>
<ews-java-api.version>2.0</ews-java-api.version>
<scrypt.version>1.4.0</scrypt.version>
<hibernate.version>6.2.15.Final</hibernate.version>
<com-sun-mail.version>1.6.2</com-sun-mail.version>
<jakarta-faces.version>4.0.5</jakarta-faces.version>
<joinfaces.version>5.1.8</joinfaces.version>
<joinfaces.version>5.1.6</joinfaces.version>
<jakarta.interceptor-api.version>2.1.0</jakarta.interceptor-api.version>
<jakarta-inject-api.version>2.0.1</jakarta-inject-api.version>
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<license-maven-plugin.version>1.14</license-maven-plugin.version>
<jaxws-api.version>2.3.1</jaxws-api.version>
</properties>
<dependencyManagement>
@ -176,15 +165,14 @@ limitations under the License.
<!-- mail -->
<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>${jakarta.mail-api.version}</version>
<artifactId>javax.mail</artifactId>
<groupId>com.sun.mail</groupId>
<version>${com-sun-mail.version}</version>
</dependency>
<dependency>
<artifactId>ews-java-api</artifactId>
<groupId>com.microsoft.ews-java-api</groupId>
<version>${ews-java-api.version}</version>
<version>2.0</version>
</dependency>
<!-- Faces -->
@ -227,11 +215,16 @@ limitations under the License.
<groupId>com.fasterxml.jackson.datatype</groupId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<artifactId>jaxws-api</artifactId>
<groupId>javax.xml.ws</groupId>
<version>${jaxws-api.version}</version>
</dependency>
<dependency>
<artifactId>scrypt</artifactId>
<groupId>com.lambdaworks</groupId>
<version>${scrypt.version}</version>
<version>1.4.0</version>
</dependency>
<dependency>
<artifactId>bcprov-jdk15on</artifactId>
@ -279,17 +272,17 @@ limitations under the License.
<build>
<plugins>
<!-- deploy artifacts to maven repository -->
<plugin>
<artifactId>nexus-staging-maven-plugin</artifactId>
<configuration>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<serverId>ossrh</serverId>
</configuration>
<extensions>true</extensions>
<groupId>org.sonatype.plugins</groupId>
<version>${nexus-staging-maven-plugin.version}</version>
</plugin>
<!-- <plugin>-->
<!-- <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <autoReleaseAfterClose>true</autoReleaseAfterClose>-->
<!-- <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<!-- <serverId>ossrh</serverId>-->
<!-- </configuration>-->
<!-- <extensions>true</extensions>-->
<!-- <groupId>org.sonatype.plugins</groupId>-->
<!-- <version>1.6.8</version>-->
<!-- </plugin>-->
<!-- ensure sources are build so they are also uploaded -->
<plugin>
@ -318,7 +311,7 @@ limitations under the License.
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven-javadoc-plugin.version}</version>
<version>3.1.1</version>
</plugin>
<!-- create license file -->
@ -342,7 +335,7 @@ limitations under the License.
</execution>
</executions>
<groupId>org.codehaus.mojo</groupId>
<version>${license-maven-plugin.version}</version>
<version>1.14</version>
</plugin>
<!-- sign jar archives -->
@ -361,7 +354,7 @@ limitations under the License.
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven-gpg-plugin.version}</version>
<version>1.6</version>
</plugin>
</plugins>
</build>
@ -381,20 +374,27 @@ limitations under the License.
<target>${maven.compiler.target}</target>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven-compiler-plugin.version}</version>
<version>3.8.1</version>
</plugin>
<!-- build maven ejb artifacts -->
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>3.0.1</version>
</plugin>
<!-- create new releases -->
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<version>2.5.3</version>
</plugin>
<!-- control junit tests from maven build -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>${maven-surefire-plugin.version}</version>
<version>2.22.2</version>
</plugin>
</plugins>
</pluginManagement>
@ -411,6 +411,7 @@ limitations under the License.
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
<version>2.5.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -420,7 +421,7 @@ limitations under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
<version>3.6.1</version>
</plugin>
</plugins>
</build>

View File

@ -1,3 +1,4 @@
<!--
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
@ -13,8 +14,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.muehlencord.shared</groupId>
@ -26,7 +26,7 @@ limitations under the License.
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.0.0-SNAPSHOT</version>
</parent>
@ -38,7 +38,7 @@ limitations under the License.
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -15,19 +15,18 @@
*/
package de.muehlencord.shared.util;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.security.SecureRandom;
import org.bouncycastle.util.encoders.Base64;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
/**
*
* @author Joern Muehlencord (joern@muehlencord.de)
*/
class PasswordUtilTest {
public class PasswordUtilTest {
private static SecureRandom secureRandom;
private static String systemSalt64Coded;
@ -38,21 +37,21 @@ class PasswordUtilTest {
secureRandom = new SecureRandom();
systemSaltBytes = new byte[32];
secureRandom.nextBytes(systemSaltBytes);
systemSalt64Coded = new String(Base64.encode(systemSaltBytes));
secureRandom.nextBytes (systemSaltBytes);
systemSalt64Coded = new String(Base64.encode (systemSaltBytes));
}
@Test
void testGetHash() {
public void testGetHash() {
PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded);
String password1 = pwUtil.getHash("password");
String password2 = pwUtil.getHash("password");
assertNotEquals(password1, password2);
assertTrue(pwUtil.matches("password", password1));
assertFalse(pwUtil.matches("wrongpassword", password1));
assertFalse (password1.equals(password2));
assertTrue (pwUtil.matches ("password", password1));
assertFalse (pwUtil.matches ("wrongpassword", password1));
}