From f0092d55cd6f942a4f3fe8bc7cd2be343b1228f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szrnka?= Date: Sun, 14 Jan 2024 22:19:52 +0100 Subject: [PATCH] GMS-91 EOD commit to branch --- .../gms/auth/AuthorizationServiceImpl.java | 29 ++++++++++--------- .../github/gms/auth/model/GmsUserDetails.java | 2 ++ .../gms/secure/model/EnabledAlgorithm.java | 4 +++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/code/gms-backend/src/main/java/io/github/gms/auth/AuthorizationServiceImpl.java b/code/gms-backend/src/main/java/io/github/gms/auth/AuthorizationServiceImpl.java index 5425378a..a918e632 100644 --- a/code/gms-backend/src/main/java/io/github/gms/auth/AuthorizationServiceImpl.java +++ b/code/gms-backend/src/main/java/io/github/gms/auth/AuthorizationServiceImpl.java @@ -1,18 +1,5 @@ package io.github.gms.auth; -import static io.github.gms.common.util.Constants.ACCESS_JWT_TOKEN; - -import java.util.Date; -import java.util.stream.Stream; - -import org.slf4j.MDC; -import org.springframework.data.util.Pair; -import org.springframework.http.HttpStatus; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; -import org.springframework.stereotype.Service; -import org.springframework.web.util.WebUtils; - import io.github.gms.auth.model.AuthorizationResponse; import io.github.gms.auth.model.GmsUserDetails; import io.github.gms.common.abstraction.AbstractAuthService; @@ -25,7 +12,23 @@ import jakarta.servlet.http.Cookie; import jakarta.servlet.http.HttpServletRequest; import lombok.extern.slf4j.Slf4j; +import org.slf4j.MDC; +import org.springframework.data.util.Pair; +import org.springframework.http.HttpStatus; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Service; +import org.springframework.web.util.WebUtils; + +import java.util.Date; +import java.util.stream.Stream; + +import static io.github.gms.common.util.Constants.ACCESS_JWT_TOKEN; +/** + * @author Peter Szrnka + * @since 1.0 + */ @Slf4j @Service public class AuthorizationServiceImpl extends AbstractAuthService implements AuthorizationService { diff --git a/code/gms-backend/src/main/java/io/github/gms/auth/model/GmsUserDetails.java b/code/gms-backend/src/main/java/io/github/gms/auth/model/GmsUserDetails.java index 822e6a27..fd555640 100644 --- a/code/gms-backend/src/main/java/io/github/gms/auth/model/GmsUserDetails.java +++ b/code/gms-backend/src/main/java/io/github/gms/auth/model/GmsUserDetails.java @@ -9,6 +9,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; +import java.io.Serial; import java.util.Collection; import java.util.Set; import java.util.stream.Collectors; @@ -23,6 +24,7 @@ @NoArgsConstructor public class GmsUserDetails implements UserDetails { + @Serial private static final long serialVersionUID = 3437066490159576929L; private String name; private String email; diff --git a/code/gms-backend/src/main/java/io/github/gms/secure/model/EnabledAlgorithm.java b/code/gms-backend/src/main/java/io/github/gms/secure/model/EnabledAlgorithm.java index 912ec838..7315b740 100644 --- a/code/gms-backend/src/main/java/io/github/gms/secure/model/EnabledAlgorithm.java +++ b/code/gms-backend/src/main/java/io/github/gms/secure/model/EnabledAlgorithm.java @@ -2,6 +2,10 @@ import lombok.Getter; +/** + * @author Peter Szrnka + * @since 1.0 + */ public enum EnabledAlgorithm { SHA1WITHRSA("SHA1WITHRSA"), SHA224WITHRSA("SHA224WITHRSA"),