upgrade to spring boot 3.2.0

This commit is contained in:
_Bastler 2023-11-27 15:21:42 +01:00
parent 8c2ab5d12c
commit 9ea02f8208
94 changed files with 535 additions and 391 deletions

23
.gitignore vendored
View File

@ -1,8 +1,31 @@
bin/ bin/
target/ target/
config/
.settings/ .settings/
.project .project
.classpath .classpath
hs_err*.log hs_err*.log
application.properties application.properties
usernames.txt usernames.txt
# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# Visual Studio Code
.vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# System files
.DS_Store
Thumbs.db

View File

@ -5,9 +5,9 @@ package de.bstly.we;
import java.util.EnumSet; import java.util.EnumSet;
import javax.servlet.ServletContext; import jakarta.servlet.ServletContext;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.SessionTrackingMode; import jakarta.servlet.SessionTrackingMode;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -33,7 +33,7 @@ public class Application extends SpringBootServletInitializer {
/* /*
* @see * @see
* org.springframework.boot.web.servlet.support.SpringBootServletInitializer# * org.springframework.boot.web.servlet.support.SpringBootServletInitializer#
* onStartup(javax.servlet.ServletContext) * onStartup(jakarta.servlet.ServletContext)
*/ */
@Override @Override
public void onStartup(ServletContext servletContext) throws ServletException { public void onStartup(ServletContext servletContext) throws ServletException {

View File

@ -22,5 +22,13 @@
<artifactId>webstly-jwt</artifactId> <artifactId>webstly-jwt</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -6,8 +6,8 @@ package de.bstly.we.borrow.controller;
import java.text.ParseException; import java.text.ParseException;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -6,16 +6,16 @@ package de.bstly.we.borrow.model;
import java.time.Duration; import java.time.Duration;
import java.util.List; import java.util.List;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.Transient; import jakarta.persistence.Transient;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -5,9 +5,9 @@ package de.bstly.we.borrow.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class BorrowItemManualSlot. * The Class BorrowItemManualSlot.

View File

@ -6,11 +6,11 @@ package de.bstly.we.borrow.model;
import java.time.DayOfWeek; import java.time.DayOfWeek;
import java.time.LocalTime; import java.time.LocalTime;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class BorrowItemPeriodSlot. * The Class BorrowItemPeriodSlot.

View File

@ -3,15 +3,15 @@
*/ */
package de.bstly.we.borrow.model; package de.bstly.we.borrow.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.DiscriminatorColumn; import jakarta.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType; import jakarta.persistence.DiscriminatorType;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Inheritance; import jakarta.persistence.Inheritance;
import javax.persistence.InheritanceType; import jakarta.persistence.InheritanceType;
import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;

View File

@ -5,16 +5,16 @@ package de.bstly.we.borrow.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.Transient; import jakarta.persistence.Transient;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;

View File

@ -41,12 +41,15 @@
<!-- Query DSL --> <!-- Query DSL -->
<dependency> <dependency>
<groupId>com.querydsl</groupId> <groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId> <artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.querydsl</groupId> <groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId> <artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency> </dependency>
<!-- Utils --> <!-- Utils -->
@ -70,7 +73,7 @@
<dependency> <dependency>
<groupId>org.passay</groupId> <groupId>org.passay</groupId>
<artifactId>passay</artifactId> <artifactId>passay</artifactId>
<version>1.6.1</version> <version>1.6.4</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -3,7 +3,7 @@
*/ */
package de.bstly.we; package de.bstly.we;
import javax.persistence.EntityManager; import jakarta.persistence.EntityManager;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;

View File

@ -10,8 +10,9 @@ import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.StringTokenizer;
import javax.servlet.ServletOutputStream; import jakarta.servlet.ServletOutputStream;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -238,7 +239,14 @@ public class UserManager implements UserDataProvider {
myWriter.write(publicKey); myWriter.write(publicKey);
myWriter.close(); myWriter.close();
String command = "gpg --import " + publicKeyPath; String command = "gpg --import " + publicKeyPath;
Runtime.getRuntime().exec(command); StringTokenizer st = new StringTokenizer(command);
String[] cmdarray = new String[st.countTokens()];
int i = 0;
while (st.hasMoreTokens()) {
cmdarray[i] = st.nextToken();
i++;
}
Runtime.getRuntime().exec(cmdarray);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -3,13 +3,13 @@
*/ */
package de.bstly.we.businesslogic.support; package de.bstly.we.businesslogic.support;
import javax.persistence.PostLoad; import jakarta.persistence.PostLoad;
import javax.persistence.PostPersist; import jakarta.persistence.PostPersist;
import javax.persistence.PostRemove; import jakarta.persistence.PostRemove;
import javax.persistence.PostUpdate; import jakarta.persistence.PostUpdate;
import javax.persistence.PrePersist; import jakarta.persistence.PrePersist;
import javax.persistence.PreRemove; import jakarta.persistence.PreRemove;
import javax.persistence.PreUpdate; import jakarta.persistence.PreUpdate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;

View File

@ -6,8 +6,8 @@ package de.bstly.we.controller;
import java.io.IOException; import java.io.IOException;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;

View File

@ -6,7 +6,7 @@ package de.bstly.we.controller;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -5,7 +5,7 @@ package de.bstly.we.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -6,7 +6,7 @@ package de.bstly.we.controller;
import java.io.IOException; import java.io.IOException;
import java.util.Map.Entry; import java.util.Map.Entry;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;

View File

@ -5,7 +5,7 @@ package de.bstly.we.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -3,7 +3,7 @@
*/ */
package de.bstly.we.controller; package de.bstly.we.controller;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -7,7 +7,7 @@ import javax.annotation.Nullable;
import org.springframework.core.NestedExceptionUtils; import org.springframework.core.NestedExceptionUtils;
import org.springframework.core.NestedRuntimeException; import org.springframework.core.NestedRuntimeException;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
@ -20,7 +20,7 @@ public class EntityResponseStatusException extends NestedRuntimeException {
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private final HttpStatus status; private final HttpStatusCode status;
@Nullable @Nullable
private final Object body; private final Object body;
@ -30,7 +30,7 @@ public class EntityResponseStatusException extends NestedRuntimeException {
* *
* @param status the status * @param status the status
*/ */
public EntityResponseStatusException(HttpStatus status) { public EntityResponseStatusException(HttpStatusCode status) {
this(null, status); this(null, status);
} }
@ -40,7 +40,7 @@ public class EntityResponseStatusException extends NestedRuntimeException {
* @param body the body * @param body the body
* @param status the status * @param status the status
*/ */
public EntityResponseStatusException(@Nullable Object body, HttpStatus status) { public EntityResponseStatusException(@Nullable Object body, HttpStatusCode status) {
this(body, status, null); this(body, status, null);
} }
@ -51,7 +51,7 @@ public class EntityResponseStatusException extends NestedRuntimeException {
* @param status the status * @param status the status
* @param cause the cause * @param cause the cause
*/ */
public EntityResponseStatusException(@Nullable Object body, HttpStatus status, @Nullable Throwable cause) { public EntityResponseStatusException(@Nullable Object body, HttpStatusCode status, @Nullable Throwable cause) {
super(null, cause); super(null, cause);
Assert.notNull(status, "HttpStatus is required"); Assert.notNull(status, "HttpStatus is required");
this.status = status; this.status = status;
@ -63,7 +63,7 @@ public class EntityResponseStatusException extends NestedRuntimeException {
* *
* @return the status * @return the status
*/ */
public HttpStatus getStatus() { public HttpStatusCode getStatus() {
return this.status; return this.status;
} }

View File

@ -7,7 +7,7 @@ import java.time.Instant;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import javax.servlet.http.HttpSession; import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;

View File

@ -5,12 +5,12 @@ package de.bstly.we.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class Permission. * The Class Permission.

View File

@ -7,17 +7,17 @@ import java.time.Instant;
import java.time.temporal.ChronoUnit; import java.time.temporal.ChronoUnit;
import java.util.Set; import java.util.Set;
import javax.persistence.AttributeConverter; import jakarta.persistence.AttributeConverter;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Convert; import jakarta.persistence.Convert;
import javax.persistence.Converter; import jakarta.persistence.Converter;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -5,10 +5,10 @@ package de.bstly.we.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class PersistentLogin. * The Class PersistentLogin.

View File

@ -3,12 +3,12 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class Quota. * The Class Quota.

View File

@ -5,14 +5,14 @@ package de.bstly.we.model;
import java.util.Set; import java.util.Set;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -3,10 +3,10 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class SystemProfileField. * The Class SystemProfileField.

View File

@ -3,11 +3,11 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class SystemProperty. * The Class SystemProperty.

View File

@ -3,13 +3,13 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;

View File

@ -3,13 +3,13 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
/** /**
* The Class UserAlias. * The Class UserAlias.

View File

@ -3,13 +3,13 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
/** /**
* The Class UserDomain. * The Class UserDomain.

View File

@ -5,13 +5,13 @@ package de.bstly.we.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.IdClass; import jakarta.persistence.IdClass;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import de.bstly.we.model.UserProfileField.UserProfileFieldId; import de.bstly.we.model.UserProfileField.UserProfileFieldId;

View File

@ -5,15 +5,15 @@ package de.bstly.we.model;
import java.util.List; import java.util.List;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -3,12 +3,12 @@
*/ */
package de.bstly.we.model; package de.bstly.we.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class VoucherMapping. * The Class VoucherMapping.

View File

@ -6,9 +6,9 @@ package de.bstly.we.security;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
@ -35,8 +35,8 @@ public class LocalAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPo
/* /*
* @see org.springframework.security.web.authentication. * @see org.springframework.security.web.authentication.
* LoginUrlAuthenticationEntryPoint#commence(javax.servlet.http. * LoginUrlAuthenticationEntryPoint#commence(jakarta.servlet.http.
* HttpServletRequest, javax.servlet.http.HttpServletResponse, * HttpServletRequest, jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.AuthenticationException) * org.springframework.security.core.AuthenticationException)
*/ */
@Override @Override

View File

@ -9,8 +9,8 @@ import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.log.LogMessage; import org.springframework.core.log.LogMessage;
@ -54,7 +54,7 @@ public class LocalRememberMeServices extends PersistentTokenBasedRememberMeServi
/* /*
* @see org.springframework.security.web.authentication.rememberme. * @see org.springframework.security.web.authentication.rememberme.
* AbstractRememberMeServices#rememberMeRequested(javax.servlet.http. * AbstractRememberMeServices#rememberMeRequested(jakarta.servlet.http.
* HttpServletRequest, java.lang.String) * HttpServletRequest, java.lang.String)
*/ */
@Override @Override

View File

@ -7,6 +7,18 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder; import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
import dev.samstevens.totp.code.CodeGenerator;
import dev.samstevens.totp.code.CodeVerifier;
import dev.samstevens.totp.code.DefaultCodeGenerator;
import dev.samstevens.totp.code.DefaultCodeVerifier;
import dev.samstevens.totp.code.HashingAlgorithm;
import dev.samstevens.totp.qr.QrDataFactory;
import dev.samstevens.totp.recovery.RecoveryCodeGenerator;
import dev.samstevens.totp.secret.DefaultSecretGenerator;
import dev.samstevens.totp.secret.SecretGenerator;
import dev.samstevens.totp.time.SystemTimeProvider;
import dev.samstevens.totp.time.TimeProvider;
/** /**
* The Class PasswordEncoderConfig. * The Class PasswordEncoderConfig.
*/ */
@ -20,6 +32,40 @@ public class PasswordEncoderConfig {
*/ */
@Bean(name = "passwordEncoder") @Bean(name = "passwordEncoder")
public Argon2PasswordEncoder passwordEncoder() { public Argon2PasswordEncoder passwordEncoder() {
return new Argon2PasswordEncoder(); return Argon2PasswordEncoder.defaultsForSpringSecurity_v5_8();
}
@Bean
public SecretGenerator secretGenerator() {
return new DefaultSecretGenerator(32);
}
@Bean
public TimeProvider timeProvider() {
return new SystemTimeProvider();
}
@Bean
public CodeGenerator codeGenerator() {
return new DefaultCodeGenerator(HashingAlgorithm.SHA1, 6);
}
@Bean
public CodeVerifier codeVerifier() {
DefaultCodeVerifier verifier = new DefaultCodeVerifier(codeGenerator(), timeProvider());
verifier.setTimePeriod(30);
verifier.setAllowedTimePeriodDiscrepancy(1);
return verifier;
}
@Bean
public QrDataFactory qrDataFactory() {
return new QrDataFactory(HashingAlgorithm.SHA1, 6, 30);
}
@Bean
public RecoveryCodeGenerator recoveryCodeGenerator() {
return new RecoveryCodeGenerator();
} }
} }

View File

@ -13,9 +13,10 @@ import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.config.http.SessionCreationPolicy;
@ -51,7 +52,8 @@ import dev.samstevens.totp.code.HashingAlgorithm;
* The Class SecurityConfig. * The Class SecurityConfig.
*/ */
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableMethodSecurity(prePostEnabled = true)
@Configuration
public class SecurityConfig { public class SecurityConfig {
@Autowired @Autowired

View File

@ -5,9 +5,9 @@ package de.bstly.we.security.filter;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
@ -42,8 +42,8 @@ public class FormSecondFactorAuthenticationFilter extends AbstractAuthentication
/* /*
* @see org.springframework.security.web.authentication. * @see org.springframework.security.web.authentication.
* AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet. * AbstractAuthenticationProcessingFilter#attemptAuthentication(jakarta.servlet.
* http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)
*/ */
@Override @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
@ -76,7 +76,7 @@ public class FormSecondFactorAuthenticationFilter extends AbstractAuthentication
/* /*
* @see org.springframework.security.web.authentication. * @see org.springframework.security.web.authentication.
* AbstractAuthenticationProcessingFilter#unsuccessfulAuthentication(javax. * AbstractAuthenticationProcessingFilter#unsuccessfulAuthentication(javax.
* servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, * servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.AuthenticationException) * org.springframework.security.core.AuthenticationException)
*/ */
@Override @Override

View File

@ -5,11 +5,11 @@ package de.bstly.we.security.filter;
import java.io.IOException; import java.io.IOException;
import javax.servlet.FilterChain; import jakarta.servlet.FilterChain;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.ServletRequest; import jakarta.servlet.ServletRequest;
import javax.servlet.ServletResponse; import jakarta.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
@ -35,8 +35,8 @@ public class LocalAnonymousAuthenticationFilter extends AnonymousAuthenticationF
/* /*
* @see * @see
* org.springframework.security.web.authentication.AnonymousAuthenticationFilter * org.springframework.security.web.authentication.AnonymousAuthenticationFilter
* #doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, * #doFilter(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse,
* javax.servlet.FilterChain) * jakarta.servlet.FilterChain)
*/ */
@Override @Override
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
@ -50,7 +50,7 @@ public class LocalAnonymousAuthenticationFilter extends AnonymousAuthenticationF
/* /*
* @see * @see
* org.springframework.security.web.authentication.AnonymousAuthenticationFilter * org.springframework.security.web.authentication.AnonymousAuthenticationFilter
* #createAuthentication(javax.servlet.http.HttpServletRequest) * #createAuthentication(jakarta.servlet.http.HttpServletRequest)
*/ */
@Override @Override
protected Authentication createAuthentication(HttpServletRequest request) { protected Authentication createAuthentication(HttpServletRequest request) {

View File

@ -5,9 +5,9 @@ package de.bstly.we.security.filter;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
import org.springframework.security.authentication.AuthenticationServiceException; import org.springframework.security.authentication.AuthenticationServiceException;
@ -45,8 +45,8 @@ public class RestAuthenticationFilter extends AbstractAuthenticationProcessingFi
/* /*
* @see org.springframework.security.web.authentication. * @see org.springframework.security.web.authentication.
* AbstractAuthenticationProcessingFilter#attemptAuthentication(javax.servlet. * AbstractAuthenticationProcessingFilter#attemptAuthentication(jakarta.servlet.
* http.HttpServletRequest, javax.servlet.http.HttpServletResponse) * http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)
*/ */
@Override @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)

View File

@ -3,9 +3,9 @@ package de.bstly.we.security.filter;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException; import org.springframework.security.authentication.AuthenticationCredentialsNotFoundException;
import org.springframework.security.authentication.AuthenticationServiceException; import org.springframework.security.authentication.AuthenticationServiceException;
@ -41,8 +41,8 @@ public class RestSecondFactorAuthenticationFilter extends FormSecondFactorAuthen
/* /*
* @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter# * @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter#
* attemptAuthentication(javax.servlet.http.HttpServletRequest, * attemptAuthentication(jakarta.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse) * jakarta.servlet.http.HttpServletResponse)
*/ */
@Override @Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
@ -91,8 +91,8 @@ public class RestSecondFactorAuthenticationFilter extends FormSecondFactorAuthen
/* /*
* @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter# * @see de.bstly.we.security.filter.FormSecondFactorAuthenticationFilter#
* unsuccessfulAuthentication(javax.servlet.http.HttpServletRequest, * unsuccessfulAuthentication(jakarta.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse, * jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.AuthenticationException) * org.springframework.security.core.AuthenticationException)
*/ */
@Override @Override

View File

@ -3,9 +3,9 @@ package de.bstly.we.security.handler;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.RememberMeServices; import org.springframework.security.web.authentication.RememberMeServices;
@ -66,7 +66,7 @@ public class FormAuthenticationSuccessHandler extends SavedRequestAwareAuthentic
/* /*
* @see org.springframework.security.web.authentication. * @see org.springframework.security.web.authentication.
* SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax. * SavedRequestAwareAuthenticationSuccessHandler#onAuthenticationSuccess(javax.
* servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, * servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.Authentication) * org.springframework.security.core.Authentication)
*/ */
@Override @Override

View File

@ -2,9 +2,9 @@ package de.bstly.we.security.handler;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.AuthenticationException;
@ -20,8 +20,8 @@ public class RestAuthenticationFailureHandler implements AuthenticationFailureHa
/* /*
* @see * @see
* org.springframework.security.web.authentication.AuthenticationFailureHandler# * org.springframework.security.web.authentication.AuthenticationFailureHandler#
* onAuthenticationFailure(javax.servlet.http.HttpServletRequest, * onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse, * jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.AuthenticationException) * org.springframework.security.core.AuthenticationException)
*/ */
@Override @Override

View File

@ -2,9 +2,9 @@ package de.bstly.we.security.handler;
import java.io.IOException; import java.io.IOException;
import javax.servlet.ServletException; import jakarta.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
@ -31,8 +31,8 @@ public class RestAuthenticationSuccessHandler extends FormAuthenticationSuccessH
/* /*
* @see de.bstly.we.security.handler.FormAuthenticationSuccessHandler# * @see de.bstly.we.security.handler.FormAuthenticationSuccessHandler#
* onAuthenticationSuccess(javax.servlet.http.HttpServletRequest, * onAuthenticationSuccess(jakarta.servlet.http.HttpServletRequest,
* javax.servlet.http.HttpServletResponse, * jakarta.servlet.http.HttpServletResponse,
* org.springframework.security.core.Authentication) * org.springframework.security.core.Authentication)
*/ */
@Override @Override

View File

@ -17,5 +17,13 @@
<artifactId>webstly-core</artifactId> <artifactId>webstly-core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -6,7 +6,7 @@ package de.bstly.we.i18n.controller;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;

View File

@ -3,12 +3,12 @@
*/ */
package de.bstly.we.i18n.model; package de.bstly.we.i18n.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
/** /**
* The Class I18n. * The Class I18n.

View File

@ -17,5 +17,13 @@
<artifactId>webstly-core</artifactId> <artifactId>webstly-core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -5,13 +5,13 @@ package de.bstly.we.invite.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;

View File

@ -5,10 +5,10 @@ package de.bstly.we.invite.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class InviteMapping. * The Class InviteMapping.

View File

@ -26,7 +26,15 @@
<dependency> <dependency>
<groupId>com.nimbusds</groupId> <groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId> <artifactId>nimbus-jose-jwt</artifactId>
<version>9.21</version> <version>${nimbus.version}</version>
</dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -5,13 +5,13 @@ package de.bstly.we.jitsi.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.springframework.data.annotation.Reference; import org.springframework.data.annotation.Reference;

View File

@ -10,7 +10,7 @@ import java.time.temporal.ChronoUnit;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -6,7 +6,7 @@ package de.bstly.we.jukebox.controller;
import java.io.IOException; import java.io.IOException;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;

View File

@ -21,7 +21,16 @@
<dependency> <dependency>
<groupId>com.nimbusds</groupId> <groupId>com.nimbusds</groupId>
<artifactId>nimbus-jose-jwt</artifactId> <artifactId>nimbus-jose-jwt</artifactId>
<version>9.21</version> <version>${nimbus.version}</version>
</dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -9,7 +9,7 @@ import java.time.temporal.ChronoUnit;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import javax.transaction.Transactional; import jakarta.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.PageRequest;

View File

@ -5,8 +5,8 @@ package de.bstly.we.jwt.controller;
import java.text.ParseException; import java.text.ParseException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -5,13 +5,13 @@ package de.bstly.we.jwt.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.jwk.Curve; import com.nimbusds.jose.jwk.Curve;
@ -33,8 +33,7 @@ public class JwtKey {
private String name; private String name;
@Column(name = "key_id", nullable = true) @Column(name = "key_id", nullable = true)
private String keyID; private String keyID;
@Lob @Column(name = "data", nullable = true, columnDefinition="LONGTEXT")
@Column(name = "data", nullable = true)
private String data; private String data;
@Column(name = "key_type", nullable = false) @Column(name = "key_type", nullable = false)
private String keyType = KeyType.EC.getValue(); private String keyType = KeyType.EC.getValue();

View File

@ -7,7 +7,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -3,11 +3,11 @@
*/ */
package de.bstly.we.minetest.model; package de.bstly.we.minetest.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;

View File

@ -17,5 +17,13 @@
<artifactId>webstly-jwt</artifactId> <artifactId>webstly-jwt</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -5,7 +5,7 @@ package de.bstly.we.oidc.businesslogic;
import java.util.Set; import java.util.Set;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -364,7 +365,7 @@ public class OidcSessionManager {
try { try {
response = webClient.method(HttpMethod.POST).uri(client.getBackchannelLogoutUri()) response = webClient.method(HttpMethod.POST).uri(client.getBackchannelLogoutUri())
.contentType(MediaType.APPLICATION_FORM_URLENCODED).body(BodyInserters.fromFormData(formData)) .contentType(MediaType.APPLICATION_FORM_URLENCODED).body(BodyInserters.fromFormData(formData))
.retrieve().onStatus(HttpStatus::isError, error -> Mono.empty()).toBodilessEntity().block(); .retrieve().onStatus(HttpStatusCode::isError, error -> Mono.empty()).toBodilessEntity().block();
} catch (Exception e) { } catch (Exception e) {
logger.warn("backchannelLogout POST '" + client.getBackchannelLogoutUri() + "' failed", e); logger.warn("backchannelLogout POST '" + client.getBackchannelLogoutUri() + "' failed", e);
} }

View File

@ -8,8 +8,8 @@ import java.net.URI;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -6,8 +6,8 @@ package de.bstly.we.oidc.controller;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;

View File

@ -8,8 +8,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -9,9 +9,9 @@ import java.time.Instant;
import java.util.Base64; import java.util.Base64;
import java.util.Set; import java.util.Set;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import javax.transaction.Transactional; import jakarta.transaction.Transactional;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -5,14 +5,14 @@ package de.bstly.we.oidc.model;
import java.util.Set; import java.util.Set;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -5,16 +5,16 @@ package de.bstly.we.oidc.model;
import java.util.Set; import java.util.Set;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -3,12 +3,12 @@
*/ */
package de.bstly.we.oidc.model; package de.bstly.we.oidc.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
/** /**
* The Class OidcSession. * The Class OidcSession.

View File

@ -6,13 +6,13 @@ package de.bstly.we.oidc.model;
import java.time.Instant; import java.time.Instant;
import java.util.Set; import java.util.Set;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -27,5 +27,13 @@
<artifactId>webstly-i18n</artifactId> <artifactId>webstly-i18n</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -5,8 +5,8 @@ package de.bstly.we.partey.api.controller;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;

View File

@ -5,8 +5,8 @@ package de.bstly.we.partey.api.controller;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -3,7 +3,7 @@
*/ */
package de.bstly.we.partey.api.controller; package de.bstly.we.partey.api.controller;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;

View File

@ -6,7 +6,7 @@ package de.bstly.we.partey.api.controller;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -6,7 +6,7 @@ package de.bstly.we.partey.api.controller;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -6,7 +6,7 @@ package de.bstly.we.partey.api.controller.support;
import java.util.Iterator; import java.util.Iterator;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -3,7 +3,7 @@
*/ */
package de.bstly.we.partey.api.security; package de.bstly.we.partey.api.security;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -8,7 +8,7 @@ import java.net.URISyntaxException;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;

View File

@ -5,13 +5,13 @@ package de.bstly.we.partey.model;
import java.util.List; import java.util.List;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -5,12 +5,12 @@ package de.bstly.we.partey.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
/** /**
* The Class ParteyUserReport. * The Class ParteyUserReport.

View File

@ -3,11 +3,11 @@
*/ */
package de.bstly.we.partey.model; package de.bstly.we.partey.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
/** /**
* The Class ParteyUserReportModerator. * The Class ParteyUserReportModerator.

View File

@ -6,11 +6,11 @@ package de.bstly.we.partey.model;
import java.io.Serializable; import java.io.Serializable;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.IdClass; import jakarta.persistence.IdClass;
import javax.persistence.Table; import jakarta.persistence.Table;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId; import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId;

View File

@ -5,12 +5,12 @@ package de.bstly.we.partey.model;
import java.util.List; import java.util.List;
import javax.persistence.CollectionTable; import jakarta.persistence.CollectionTable;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.ElementCollection; import jakarta.persistence.ElementCollection;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption; import org.hibernate.annotations.LazyCollectionOption;

View File

@ -5,16 +5,16 @@ package de.bstly.we.partey.timeslot.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EnumType; import jakarta.persistence.EnumType;
import javax.persistence.Enumerated; import jakarta.persistence.Enumerated;
import javax.persistence.GeneratedValue; import jakarta.persistence.GeneratedValue;
import javax.persistence.GenerationType; import jakarta.persistence.GenerationType;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.Transient; import jakarta.persistence.Transient;
import de.bstly.we.model.UserData; import de.bstly.we.model.UserData;
import de.bstly.we.model.Visibility; import de.bstly.we.model.Visibility;

31
pom.xml
View File

@ -11,15 +11,17 @@
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version> <java.version>17</java.version>
<log4j2.version>2.20.0</log4j2.version> <querydsl.version>5.0.0</querydsl.version>
<revision>2.0.6-SNAPSHOT</revision> <nimbus.version>9.37.1</nimbus.version>
<hibernate.version>6.4.0.Final</hibernate.version>
<revision>3.0.0-SNAPSHOT</revision>
</properties> </properties>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.9</version> <version>3.2.0</version>
<relativePath /> <relativePath />
</parent> </parent>
@ -41,25 +43,4 @@
<module>urlshortener</module> <module>urlshortener</module>
<module>wireguard</module> <module>wireguard</module>
</modules> </modules>
<build>
<plugins>
<plugin>
<groupId>com.mysema.maven</groupId>
<artifactId>apt-maven-plugin</artifactId>
<version>1.1.3</version>
<executions>
<execution>
<goals>
<goal>process</goal>
</goals>
<configuration>
<outputDirectory>target/generated-sources/java</outputDirectory>
<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -22,5 +22,13 @@
<artifactId>webstly-oidc</artifactId> <artifactId>webstly-oidc</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -3,11 +3,11 @@
*/ */
package de.bstly.we.services.model; package de.bstly.we.services.model;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
/** /**
* The Class Service. * The Class Service.

View File

@ -17,5 +17,13 @@
<artifactId>webstly-core</artifactId> <artifactId>webstly-core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -8,8 +8,8 @@ import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import java.util.Optional; import java.util.Optional;
import javax.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;

View File

@ -5,13 +5,13 @@ package de.bstly.we.urlshortener.model;
import java.time.Instant; import java.time.Instant;
import javax.persistence.Column; import jakarta.persistence.Column;
import javax.persistence.Entity; import jakarta.persistence.Entity;
import javax.persistence.EntityListeners; import jakarta.persistence.EntityListeners;
import javax.persistence.Id; import jakarta.persistence.Id;
import javax.persistence.Lob; import jakarta.persistence.Lob;
import javax.persistence.Table; import jakarta.persistence.Table;
import javax.persistence.Transient; import jakarta.persistence.Transient;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;

View File

@ -17,5 +17,13 @@
<artifactId>webstly-core</artifactId> <artifactId>webstly-core</artifactId>
<version>${revision}</version> <version>${revision}</version>
</dependency> </dependency>
<!-- Query DSL -->
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<classifier>jakarta</classifier>
</dependency>
</dependencies> </dependencies>
</project> </project>