upgrade to Spring Boot 4, add webauthn support, some cleanup
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.businesslogic;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.businesslogic;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.businesslogic;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.controller;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -100,7 +97,7 @@ public class BorrowItemController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@GetMapping("/{id}")
|
||||
public BorrowItem getBorrowItem(@PathVariable("id") Long id) {
|
||||
public BorrowItem getBorrowItem(@PathVariable Long id) {
|
||||
if (!permissionManager.hasPermission(getCurrentUserId(), BorrowPermissions.BORROW_REQUESTS)
|
||||
|| !permissionManager.isFullUser(getCurrentUserId())) {
|
||||
throw new EntityResponseStatusException(HttpStatus.FORBIDDEN);
|
||||
@@ -109,7 +106,7 @@ public class BorrowItemController extends BaseController {
|
||||
BorrowItem borrowItem = borrowItemManager.get(id);
|
||||
|
||||
if (borrowItem == null) {
|
||||
throw new EntityResponseStatusException(HttpStatus.UNPROCESSABLE_ENTITY);
|
||||
throw new EntityResponseStatusException(HttpStatus.CONFLICT);
|
||||
}
|
||||
|
||||
if (!borrowItem.getOwner().equals(getCurrentUserId())) {
|
||||
@@ -166,7 +163,7 @@ public class BorrowItemController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteBorrowItem(@PathVariable("id") Long id) {
|
||||
public void deleteBorrowItem(@PathVariable Long id) {
|
||||
BorrowItem borrowItem = borrowItemManager.get(id);
|
||||
if (borrowItem == null || !borrowItem.getOwner().equals(getCurrentUserId())) {
|
||||
throw new EntityResponseStatusException(HttpStatus.FORBIDDEN);
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.controller;
|
||||
|
||||
import java.text.ParseException;
|
||||
@@ -163,7 +160,7 @@ public class BorrowRequestController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@DeleteMapping("/{id}")
|
||||
public void deleteBorrowRequest(@PathVariable("id") Long id) {
|
||||
public void deleteBorrowRequest(@PathVariable Long id) {
|
||||
BorrowRequest borrowRequest = borrowRequestManager.get(id);
|
||||
if (borrowRequest == null || !borrowRequest.getUser().equals(getCurrentUserId())) {
|
||||
throw new EntityResponseStatusException(HttpStatus.FORBIDDEN);
|
||||
@@ -212,14 +209,14 @@ public class BorrowRequestController extends BaseController {
|
||||
*/
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
@GetMapping("/code/{id}")
|
||||
public String getCode(@PathVariable("id") Long id, HttpServletRequest request) {
|
||||
public String getCode(@PathVariable Long id, HttpServletRequest request) {
|
||||
BorrowRequest borrowRequest = borrowRequestManager.get(id);
|
||||
if (borrowRequest == null || !borrowRequest.getUser().equals(getCurrentUserId())) {
|
||||
throw new EntityResponseStatusException(HttpStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
if (!borrowRequest.getStatus().equals(BorrowRequestStatus.ACCEPTED)) {
|
||||
throw new EntityResponseStatusException(HttpStatus.UNPROCESSABLE_ENTITY);
|
||||
throw new EntityResponseStatusException(HttpStatus.CONFLICT);
|
||||
}
|
||||
|
||||
String issuer = jwtBorrowIssuer;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.controller.validation;
|
||||
|
||||
import org.apache.commons.validator.routines.EmailValidator;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.controller.validation;
|
||||
|
||||
import java.text.ParseException;
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.controller.validation;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.model;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.repository;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package de.bstly.we.borrow.repository;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
Reference in New Issue
Block a user