From 66be348fd3ed3db0590c225dd3a8f6ed27a87cc1 Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Wed, 25 Oct 2023 12:04:43 +0200 Subject: [PATCH 1/4] prepare version 2.0.0 remove shiro support --- configuration/pom.xml | 2 +- db/pom.xml | 2 +- jeeutil/pom.xml | 7 +- .../shared/jeeutil/jwt/JWTDecoder.java | 87 ------------ .../shared/jeeutil/jwt/JWTEncoder.java | 46 ------ .../shared/jeeutil/jwt/JWTException.java | 49 ------- .../shared/jeeutil/jwt/JWTGuard.java | 35 ----- network/pom.xml | 4 +- poi-util/pom.xml | 4 +- pom.xml | 19 +-- shiro-faces/pom.xml | 45 ------ ...AjaxAwarePassThruAuthenticationFilter.java | 50 ------- .../tags/AbstractAccessControlTag.java | 51 ------- .../tags/AbstractAuthenticationTag.java | 59 -------- .../tags/AbstractPermissionTag.java | 51 ------- .../shirofaces/tags/AbstractRoleTag.java | 43 ------ .../shirofaces/tags/AbstractTag.java | 37 ----- .../shirofaces/tags/AuthenticatedTag.java | 35 ----- .../muehlencord/shirofaces/tags/GuestTag.java | 39 ----- .../shirofaces/tags/HasAnyPermissionTag.java | 45 ------ .../shirofaces/tags/HasAnyRolesTag.java | 46 ------ .../shirofaces/tags/HasPermissionTag.java | 37 ----- .../shirofaces/tags/HasRoleTag.java | 38 ----- .../shirofaces/tags/LacksPermissionTag.java | 36 ----- .../shirofaces/tags/LacksRoleTag.java | 37 ----- .../shirofaces/tags/NotAuthenticatedTag.java | 36 ----- .../muehlencord/shirofaces/tags/UserTag.java | 35 ----- .../tags/unsupported/PrincipalTag.java | 57 -------- .../resources/META-INF/shiro-faces.taglib.xml | 134 ------------------ util/pom.xml | 2 +- 30 files changed, 9 insertions(+), 1159 deletions(-) delete mode 100644 jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTDecoder.java delete mode 100644 jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTEncoder.java delete mode 100644 jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTException.java delete mode 100644 jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTGuard.java delete mode 100644 shiro-faces/pom.xml delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/filter/FacesAjaxAwarePassThruAuthenticationFilter.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAccessControlTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAuthenticationTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractPermissionTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractRoleTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AuthenticatedTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/GuestTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyPermissionTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyRolesTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasPermissionTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasRoleTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksPermissionTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksRoleTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/NotAuthenticatedTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/UserTag.java delete mode 100644 shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/unsupported/PrincipalTag.java delete mode 100644 shiro-faces/src/main/resources/META-INF/shiro-faces.taglib.xml diff --git a/configuration/pom.xml b/configuration/pom.xml index 94a61b6..9468dc4 100644 --- a/configuration/pom.xml +++ b/configuration/pom.xml @@ -24,7 +24,7 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT shared-configuration diff --git a/db/pom.xml b/db/pom.xml index ad011d5..dfc0f2b 100644 --- a/db/pom.xml +++ b/db/pom.xml @@ -25,7 +25,7 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT shared-db diff --git a/jeeutil/pom.xml b/jeeutil/pom.xml index 9e2c0c5..573f024 100644 --- a/jeeutil/pom.xml +++ b/jeeutil/pom.xml @@ -20,7 +20,7 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT de.muehlencord.shared @@ -55,11 +55,6 @@ limitations under the License. jar provided - - org.apache.shiro - shiro-web - provided - diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTDecoder.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTDecoder.java deleted file mode 100644 index 52d8c72..0000000 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTDecoder.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shared.jeeutil.jwt; - -import io.fusionauth.jwt.Verifier; -import io.fusionauth.jwt.domain.JWT; -import io.fusionauth.jwt.hmac.HMACVerifier; -import java.time.ZonedDateTime; - -/** - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class JWTDecoder { - - private boolean parsedSuccessfully; - private JWT jwt = null; - - public JWTDecoder(String password, String issuer, String jwtString) throws JWTException { - if ((password == null) || (issuer == null) || (jwtString == null)) { - throw new JWTException("password, issuer and jwt must not be null"); - } - Verifier verifier = HMACVerifier.newVerifier(password); - jwt = JWT.getDecoder().decode(jwtString, verifier); - parsedSuccessfully = jwt != null && jwt.issuer.equals(issuer); - } - - public String getIssuer() { - if (jwt == null) { - return null; - } else { - return jwt.issuer; - } - } - - public ZonedDateTime getIssuedAt() { - if (jwt == null) { - return null; - } else { - return jwt.issuedAt; - } - } - - public String getSubject() { - if (jwt == null) { - return null; - } else { - return jwt.subject; - } - } - - public String getUniqueId() { - if (jwt == null) { - return null; - } else { - return jwt.uniqueId; - } - } - - public ZonedDateTime getExpiration() { - if (jwt == null) { - return null; - } else { - return jwt.expiration; - } - } - - public boolean isValid() { - if ((jwt == null) || (jwt.isExpired())) { - return false; - } else { - return this.parsedSuccessfully; - } - } -} diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTEncoder.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTEncoder.java deleted file mode 100644 index 7cdaef7..0000000 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTEncoder.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shared.jeeutil.jwt; - -import io.fusionauth.jwt.Signer; -import io.fusionauth.jwt.domain.JWT; -import io.fusionauth.jwt.hmac.HMACSigner; -import java.time.ZonedDateTime; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class JWTEncoder { - - public static String encode(String password, String issuer, ZonedDateTime issuedAt, String subject, String uniqueId, short expirationInMinutes ) throws JWTException { - if ((password == null) || (issuer == null)) { - throw new JWTException("password and issuer must not be null"); - } - Signer signer = HMACSigner.newSHA256Signer(password); -// Signer signer = RSASigner.newSHA256Signer(new String(Files.readAllBytes(Paths.get("private_key.pem")))); - - - JWT jwt = new JWT().setIssuer(issuer) // FIXME - make configurable - .setIssuedAt(issuedAt) - .setSubject(subject) - .setUniqueId(uniqueId) - .setExpiration(issuedAt.plusMinutes(expirationInMinutes)); - return JWT.getEncoder().encode(jwt, signer); - - } - -} diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTException.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTException.java deleted file mode 100644 index 16ca909..0000000 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTException.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shared.jeeutil.jwt; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class JWTException extends Exception { - - private static final long serialVersionUID = 423992803027530544L; - - /** - * Creates a new instance of JWTException without detail message. - */ - public JWTException() { - } - - - /** - * Constructs an instance of JWTException with the specified detail message. - * @param msg the detail message. - */ - public JWTException(String msg) { - super(msg); - } - - /** - * Constructs an instance of JWTException with the specified detail message and root cause. - * @param msg the detail message. - * @param th the root cause - */ - public JWTException(String msg, Throwable th) { - super(msg,th); - } -} diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTGuard.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTGuard.java deleted file mode 100644 index ffd40fb..0000000 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/jwt/JWTGuard.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shared.jeeutil.jwt; - -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; -import org.apache.shiro.web.filter.authc.AuthenticationFilter; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class JWTGuard extends AuthenticationFilter { - - @Override - protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { - HttpServletResponse httpResponse = (HttpServletResponse) response; - httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED); - return false; - } -} diff --git a/network/pom.xml b/network/pom.xml index 5aedb88..3b6d0be 100644 --- a/network/pom.xml +++ b/network/pom.xml @@ -72,7 +72,7 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT UTF-8 @@ -80,5 +80,5 @@ limitations under the License. http://maven.apache.org - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT diff --git a/poi-util/pom.xml b/poi-util/pom.xml index 83898bc..24a4b92 100644 --- a/poi-util/pom.xml +++ b/poi-util/pom.xml @@ -47,9 +47,9 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 402ded5..156abd1 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ limitations under the License. 4.0.0 shared - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT shared pom @@ -28,7 +28,6 @@ limitations under the License. network util jeeutil - shiro-faces poi-util db @@ -82,7 +81,6 @@ limitations under the License. UTF-8 2.0.6 2.14.2 - 1.11.0 1.18.26 5.9.2 12.0.0 @@ -104,11 +102,6 @@ limitations under the License. ejb ${project.version} - - shared-shiro-faces - de.muehlencord.shared - ${project.version} - shared-util de.muehlencord.shared @@ -187,16 +180,6 @@ limitations under the License. com.fasterxml.jackson.datatype ${jackson.version} - - shiro-core - org.apache.shiro - ${shiro.version} - - - shiro-web - org.apache.shiro - ${shiro.version} - javaee-api javax diff --git a/shiro-faces/pom.xml b/shiro-faces/pom.xml deleted file mode 100644 index 8caf544..0000000 --- a/shiro-faces/pom.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - 4.0.0 - de.muehlencord.shared - shared-shiro-faces - jar - - - de.muehlencord - shared - 1.3.2-SNAPSHOT - - - shared-shiro-faces - - - - org.apache.shiro - shiro-web - provided - - - javax - javaee-api - provided - - - - \ No newline at end of file diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/filter/FacesAjaxAwarePassThruAuthenticationFilter.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/filter/FacesAjaxAwarePassThruAuthenticationFilter.java deleted file mode 100644 index 1183ba8..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/filter/FacesAjaxAwarePassThruAuthenticationFilter.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.filter; - -import java.io.IOException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import org.apache.shiro.web.filter.authc.PassThruAuthenticationFilter; - -/** - * found at http://balusc.omnifaces.org/2013/01/apache-shiro-is-it-ready-for-java-ee-6.html#MakeShiroJSFAjaxAware) - * source by BalusC, adjusted to PassThruAuthenticationFilter by Joern Muehlencord - * @author BalusC - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class FacesAjaxAwarePassThruAuthenticationFilter extends PassThruAuthenticationFilter { - - private static final String FACES_REDIRECT_XML = "" - + ""; - - - @Override - protected void redirectToLogin(ServletRequest req, ServletResponse res) throws IOException { - HttpServletRequest request = (HttpServletRequest) req; - - if ("partial/ajax".equals(request.getHeader("Faces-Request"))) { - res.setContentType("text/xml"); - res.setCharacterEncoding("UTF-8"); - res.getWriter().printf(FACES_REDIRECT_XML, request.getContextPath() + getLoginUrl()); - } - else { - super.redirectToLogin(req, res); - } - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAccessControlTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAccessControlTag.java deleted file mode 100644 index 3a2230d..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAccessControlTag.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.el.ValueExpression; -import javax.faces.view.facelets.FaceletContext; -import javax.faces.view.facelets.TagAttribute; -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class AbstractAccessControlTag extends AbstractTag { - - protected TagAttribute attribute; - - protected AbstractAccessControlTag(TagConfig config) { - super(config); - } - - protected String getAttributeValue(FaceletContext ctx, TagAttribute attr) { - String value; - if (attr.isLiteral()) { - value = attr.getValue(ctx); - } else { - ValueExpression expression = attr.getValueExpression(ctx, String.class); - value = (String) expression.getValue(ctx); - } - return value; - } - - protected boolean isPermitted(String permission) { - return getSubject() != null && getSubject().isPermitted(permission); - } - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAuthenticationTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAuthenticationTag.java deleted file mode 100644 index a7665ad..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractAuthenticationTag.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import java.io.IOException; -import javax.faces.component.UIComponent; -import javax.faces.view.facelets.FaceletContext; -import javax.faces.view.facelets.TagConfig; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class AbstractAuthenticationTag extends AbstractTag { - - private static final Logger logger = LoggerFactory.getLogger(AbstractAuthenticationTag.class); - - protected AbstractAuthenticationTag(TagConfig config) { - super(config); - } - - protected abstract boolean isAuthenticated(); - - protected boolean applyTagHandler() { - if (isAuthenticated()) { - if (logger.isTraceEnabled()) { - logger.trace("Authentication verified, tag will be evaluated"); - } - return true; - } else { - if (logger.isTraceEnabled()) { - logger.trace("Authentifaction verification failed, tag will not be evaluated"); - } - return false; - } - } - - @Override - public void apply(FaceletContext fc, UIComponent uic) throws IOException { - if (applyTagHandler()) { - this.nextHandler.apply(fc, uic); - } - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractPermissionTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractPermissionTag.java deleted file mode 100644 index a008031..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractPermissionTag.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import java.io.IOException; -import javax.faces.component.UIComponent; -import javax.faces.view.facelets.FaceletContext; -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class AbstractPermissionTag extends AbstractAccessControlTag { - - protected AbstractPermissionTag(TagConfig config) { - super(config); - this.attribute = this.getRequiredAttribute("name"); - } - - protected abstract boolean hasPermission(String permission); - - - @Override - protected boolean isPermitted(String permission) { - return getSubject() != null && getSubject().isPermitted(permission); - } - - @Override - public void apply(FaceletContext fc, UIComponent uic) throws IOException { - String permissionName = getAttributeValue(fc, attribute); - if (hasPermission(permissionName)) { - this.nextHandler.apply(fc, uic); - } - - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractRoleTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractRoleTag.java deleted file mode 100644 index 068c6a5..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractRoleTag.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import java.io.IOException; -import javax.faces.component.UIComponent; -import javax.faces.view.facelets.FaceletContext; -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class AbstractRoleTag extends AbstractAccessControlTag { - - protected AbstractRoleTag(TagConfig config) { - super(config); - this.attribute = this.getRequiredAttribute("name"); - } - - protected abstract boolean hasRole(String role); - - public void apply(FaceletContext fc, UIComponent uic) throws IOException { - String roleName = getAttributeValue(fc, attribute); - if (hasRole(roleName)) { - this.nextHandler.apply(fc, uic); - } - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractTag.java deleted file mode 100644 index 355da1c..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AbstractTag.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; -import javax.faces.view.facelets.TagHandler; -import org.apache.shiro.SecurityUtils; -import org.apache.shiro.subject.Subject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public abstract class AbstractTag extends TagHandler { - - protected AbstractTag(TagConfig config) { - super(config); - } - - protected Subject getSubject() { - return SecurityUtils.getSubject(); - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AuthenticatedTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AuthenticatedTag.java deleted file mode 100644 index ddd1b30..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/AuthenticatedTag.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class AuthenticatedTag extends AbstractAuthenticationTag { - - public AuthenticatedTag(TagConfig config) { - super(config); - } - - @Override - protected boolean isAuthenticated() { - return getSubject() != null && getSubject().isAuthenticated(); - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/GuestTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/GuestTag.java deleted file mode 100644 index e6bbc8c..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/GuestTag.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class GuestTag extends AbstractAuthenticationTag { - - public GuestTag(TagConfig config) { - super(config); - } - - @Override - protected boolean isAuthenticated() { - return getSubject() == null || getSubject().getPrincipal() == null; - } - - - - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyPermissionTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyPermissionTag.java deleted file mode 100644 index 0707e51..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyPermissionTag.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import java.util.Arrays; -import java.util.List; -import javax.faces.view.facelets.TagConfig; -import org.apache.shiro.subject.Subject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class HasAnyPermissionTag extends AbstractPermissionTag { - - private final static String PERMISSIONS_DELIMETER = ","; - - public HasAnyPermissionTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasPermission(String permissions) { - Subject subject = getSubject(); - - if (subject != null) { - List permissionsList = Arrays.asList(permissions.split(PERMISSIONS_DELIMETER)); - return permissionsList.stream().anyMatch(permission -> subject.isPermitted(permission)); - } else return false; - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyRolesTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyRolesTag.java deleted file mode 100644 index c7bf9c1..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasAnyRolesTag.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import java.util.Arrays; -import java.util.List; -import javax.faces.view.facelets.TagConfig; -import org.apache.shiro.subject.Subject; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class HasAnyRolesTag extends AbstractRoleTag { - - private final static String ROLE_NAMES_DELIMETER = ","; - - public HasAnyRolesTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasRole(String roleNames) { - Subject subject = getSubject(); - - if (subject != null) { - List roleList = Arrays.asList(roleNames.split(ROLE_NAMES_DELIMETER)); - return roleList.stream().anyMatch(role -> subject.hasRole(role.trim())); - } - return false; - - } -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasPermissionTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasPermissionTag.java deleted file mode 100644 index 001cb22..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasPermissionTag.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class HasPermissionTag extends AbstractPermissionTag { - - public HasPermissionTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasPermission(String permission) { - return isPermitted(permission); - } - - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasRoleTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasRoleTag.java deleted file mode 100644 index bdd06c2..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/HasRoleTag.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class HasRoleTag extends AbstractRoleTag { - - public HasRoleTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasRole(String role) { - return getSubject() != null && getSubject().hasRole(role); - } - - - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksPermissionTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksPermissionTag.java deleted file mode 100644 index 974ce02..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksPermissionTag.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class LacksPermissionTag extends AbstractPermissionTag { - - public LacksPermissionTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasPermission(String permission) { - return !isPermitted(permission); - } - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksRoleTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksRoleTag.java deleted file mode 100644 index 6781e22..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/LacksRoleTag.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class LacksRoleTag extends AbstractRoleTag { - - public LacksRoleTag(TagConfig config) { - super(config); - } - - @Override - protected boolean hasRole(String role) { - return getSubject() != null && getSubject().hasRole(role); - } - - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/NotAuthenticatedTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/NotAuthenticatedTag.java deleted file mode 100644 index 6ef004d..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/NotAuthenticatedTag.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class NotAuthenticatedTag extends AbstractAuthenticationTag { - - public NotAuthenticatedTag(TagConfig config) { - super(config); - } - - @Override - protected boolean isAuthenticated() { - return getSubject() == null || !getSubject().isAuthenticated(); - } - - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/UserTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/UserTag.java deleted file mode 100644 index 49adda9..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/UserTag.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags; - -import javax.faces.view.facelets.TagConfig; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class UserTag extends AbstractAuthenticationTag { - - public UserTag(TagConfig config) { - super(config); - } - - @Override - protected boolean isAuthenticated() { - return getSubject() != null && getSubject().getPrincipal() != null; - } - -} diff --git a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/unsupported/PrincipalTag.java b/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/unsupported/PrincipalTag.java deleted file mode 100644 index 0136d87..0000000 --- a/shiro-faces/src/main/java/de/muehlencord/shirofaces/tags/unsupported/PrincipalTag.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shirofaces.tags.unsupported; - -import de.muehlencord.shirofaces.tags.AbstractTag; -import java.io.IOException; -import javax.faces.component.UIComponent; -import javax.faces.view.facelets.FaceletContext; -import javax.faces.view.facelets.TagConfig; - -/** - *
- * Tag used to print out the String value of a user's default principal, or a - * specific principal as specified by the tag's attributes. - *
- * - *
- * If no attributes are specified, the tag prints out the toString() - * value of the user's default principal. If the type attribute is - * specified, the tag looks for a principal with the given type. If the - * property attribute is specified, the tag prints the string value of - * the specified property of the principal. If no principal is found or the user - * is not authenticated, the tag displays nothing unless a defaultValue - * is specified. - *
- * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -public class PrincipalTag extends AbstractTag { - - /** - * creates a new principal tag - * - * @param config the configuration to use - */ - public PrincipalTag(TagConfig config) { - super(config); - } - - @Override - public void apply(FaceletContext fc, UIComponent uic) throws IOException { - throw new UnsupportedOperationException("PrincipalTag Not supported yet."); - } -} diff --git a/shiro-faces/src/main/resources/META-INF/shiro-faces.taglib.xml b/shiro-faces/src/main/resources/META-INF/shiro-faces.taglib.xml deleted file mode 100644 index f6721b7..0000000 --- a/shiro-faces/src/main/resources/META-INF/shiro-faces.taglib.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - - http://shiro.apache.org/tags - - - - - authenticated - de.muehlencord.shirofaces.tags.AuthenticatedTag - Displays body content only if the current user has successfully authenticated - _during their current session_. It is more restrictive than the 'user' tag. - It is logically opposite to the 'notAuthenticated' tag. - - - - - guest - de.muehlencord.shirofaces.tags.GuestTag - Displays body content only if the current Subject IS NOT known to the system, either - because they have not logged in or they have no corresponding 'RememberMe' identity. It is logically - opposite to the 'user' tag. - - - - - hasAnyPermission - de.muehlencord.shirofaces.tags.HasAnyPermissionTag - Displays body content only if the current user has one of the specified permissions from a comma-separated list of permissions. - - comma-separated list of permissions to check for - name - true - - - - - hasAnyRoles - de.muehlencord.shirofaces.tags.HasAnyRolesTag - Displays body content only if the current user has one of the specified roles from a comma-separated list of role names. - - comma-separated list of roles to check for - name - true - - - - - hasPermission - de.muehlencord.shirofaces.tags.HasPermissionTag - Displays body content only if the current user the given permission. - - the permission to check for - name - true - - - - - hasRole - de.muehlencord.shirofaces.tags.HasRoleTag - Displays body content only if the current user has the given role. - - the role to check for - name - true - - - - - lacksPermission - de.muehlencord.shirofaces.tags.LacksPermissionTag - Displays body content only if the current user has NOT the given permission. - - the permission to check for - name - true - - - - - lacksRole - de.muehlencord.shirofaces.tags.LacksRoleTag - Displays body content only if the current user has NOT the given role. - - the role to check for - name - true - - - - - notAuthenticated - de.muehlencord.shirofaces.tags.NotAuthenticatedTag - Displays body content only if the current user has NOT succesfully authenticated - _during their current session_. It is logically opposite to the 'authenticated' tag. - - - - - user - de.muehlencord.shirofaces.tags.UserTag - Displays body content only if the current Subject has a known identity, either - from a previous login or from 'RememberMe' services. Note that this is semantically different - from the 'authenticated' tag, which is more restrictive. It is logically - opposite to the 'guest' tag. - - - - - - - - - \ No newline at end of file diff --git a/util/pom.xml b/util/pom.xml index 47f62f0..b4b4f75 100644 --- a/util/pom.xml +++ b/util/pom.xml @@ -26,7 +26,7 @@ limitations under the License. shared de.muehlencord - 1.3.2-SNAPSHOT + 2.0.0-SNAPSHOT -- 2.39.5 From 55655a5de2642971807c323b9d2c974fb91df29b Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Wed, 25 Oct 2023 13:10:38 +0200 Subject: [PATCH 2/4] started to migrate to Jakarta EE 10 --- db/pom.xml | 88 +++++++------- .../shared/db/AbstractController.java | 25 ++-- .../muehlencord/shared/db/ApplicationPU.java | 5 +- ...ApplicationTransactionJoinInterceptor.java | 17 +-- .../java/de/muehlencord/shared/db/Audit.java | 8 +- .../shared/db/CommonAbstractController.java | 53 +++------ .../shared/db/ControllerException.java | 14 +-- .../de/muehlencord/shared/db/EntityUtil.java | 9 +- .../db/NumericallyIdentifiedEntity.java | 10 +- .../shared/db/StandardController.java | 29 ----- .../de/muehlencord/shared/db/Validity.java | 12 +- .../muehlencord/shared/db/CounterEntity.java | 18 +-- .../de/muehlencord/shared/db/TestEntity.java | 26 ++--- jeeutil/pom.xml | 110 ++++++++++-------- .../shared/jeeutil/DefaultUIMessage.java | 4 +- .../muehlencord/shared/jeeutil/FacesUtil.java | 4 +- .../muehlencord/shared/jeeutil/UIMessage.java | 2 +- .../shared/jeeutil/restexfw/APIError.java | 2 +- .../jeeutil/restexfw/APIErrorResponse.java | 2 +- .../shared/jeeutil/restexfw/APIException.java | 4 +- .../restexfw/APIExceptionInterceptor.java | 10 +- .../jeeutil/restexfw/BadRequestMapper.java | 8 +- .../restexfw/ConstraintViolationEntry.java | 4 +- .../restexfw/ConstraintViolationMapper.java | 20 ++-- .../jeeutil/restexfw/ForbiddenMapper.java | 8 +- .../jeeutil/restexfw/NotAcceptableMapper.java | 8 +- .../jeeutil/restexfw/NotAllowedMapper.java | 8 +- .../jeeutil/restexfw/NotAuthorizedMapper.java | 8 +- .../jeeutil/restexfw/NotFoundMapper.java | 8 +- .../jeeutil/restexfw/NotSupportMapper.java | 8 +- .../restexfw/ResponseStatusAdapter.java | 4 +- .../restexfw/ValidationController.java | 10 +- .../shared/jeeutil/validator/Email.java | 13 ++- .../EmailClientValidationConstraint.java | 13 +-- .../validator/EmailConstraintValidator.java | 4 +- .../jeeutil/validator/EmailValidator.java | 12 +- pom.xml | 96 ++++++++------- 37 files changed, 321 insertions(+), 363 deletions(-) delete mode 100644 db/src/main/java/de/muehlencord/shared/db/StandardController.java diff --git a/db/pom.xml b/db/pom.xml index dfc0f2b..cbfde88 100644 --- a/db/pom.xml +++ b/db/pom.xml @@ -15,7 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. --> - + 4.0.0 de.muehlencord.shared @@ -30,6 +31,48 @@ limitations under the License. shared-db + + + org.hibernate.orm + hibernate-core + + + + + jakarta.inject + jakarta.inject-api + + + jakarta.interceptor + jakarta.interceptor-api + + + jakarta.validation + jakarta.validation-api + + + + + + org.slf4j + slf4j-api + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + + + org.projectlombok + lombok + provided + + + org.apache.commons commons-lang3 @@ -47,50 +90,7 @@ limitations under the License. com.fasterxml.jackson.datatype jackson-datatype-jsr310 - - - org.junit.jupiter - junit-jupiter-engine - test - - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-jdk14 - test - - - javax - javaee-web-api - provided - - - - - org.projectlombok - lombok - provided - - - - - - org.apache.maven.plugins - maven-ejb-plugin - - 3.1 - - **/persistence.xml - - - - - diff --git a/db/src/main/java/de/muehlencord/shared/db/AbstractController.java b/db/src/main/java/de/muehlencord/shared/db/AbstractController.java index af0269f..8efdf73 100644 --- a/db/src/main/java/de/muehlencord/shared/db/AbstractController.java +++ b/db/src/main/java/de/muehlencord/shared/db/AbstractController.java @@ -15,22 +15,20 @@ */ package de.muehlencord.shared.db; +import jakarta.persistence.EntityGraph; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Order; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import javax.ejb.Lock; -import javax.ejb.LockType; -import javax.persistence.EntityGraph; -import javax.persistence.Query; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Order; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; /** * @@ -52,7 +50,6 @@ public abstract class AbstractController extends CommonA * @param id the primary key of the entity to search for. * @return the found entity instance or null if the entity does not exist */ - @Lock(LockType.READ) public T find(Object id) { return em.find(entityClass, id); } @@ -66,7 +63,6 @@ public abstract class AbstractController extends CommonA * Typically this is the name of the 1:n set or list. * @return the found entity instance or null if the entity does not exist */ - @Lock(LockType.READ) public T find(Object id, String... subGraphItems) { EntityGraph graph = this.em.createEntityGraph(entityClass); for (String subGraphItem : subGraphItems) { @@ -79,7 +75,6 @@ public abstract class AbstractController extends CommonA return em.find(entityClass, id, hints); } - @Lock(LockType.READ) public List find(String queryName, Map parameterMap) { Query query = em.createNamedQuery(queryName); parameterMap.entrySet().forEach(entry -> query.setParameter(entry.getKey(), entry.getValue())); @@ -91,7 +86,6 @@ public abstract class AbstractController extends CommonA * * @return a list of all entities. */ - @Lock(LockType.READ) public List findAll() throws ControllerException { return findAll(new ArrayList<>()); } @@ -102,7 +96,6 @@ public abstract class AbstractController extends CommonA * @param orderFields the list of field names to order the result by. * @return a list of all entities. */ - @Lock(LockType.READ) public List findAll(String... orderFields) throws ControllerException { return findAll(Arrays.asList(orderFields)); } @@ -112,7 +105,6 @@ public abstract class AbstractController extends CommonA * @param orderFields the list of field names to order the result by. * @return a list of all entities. */ - @Lock(LockType.READ) public List findAll(List orderFields) throws ControllerException { return findAll(entityClass, orderFields); } @@ -125,7 +117,6 @@ public abstract class AbstractController extends CommonA * @param orderFields the fields to order the result by. * @return a list of found entities. */ - @Lock(LockType.READ) public List find(Map filters, List orderFields) { final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery criteria = cb.createQuery(entityClass); diff --git a/db/src/main/java/de/muehlencord/shared/db/ApplicationPU.java b/db/src/main/java/de/muehlencord/shared/db/ApplicationPU.java index f9d7efe..7cbc578 100644 --- a/db/src/main/java/de/muehlencord/shared/db/ApplicationPU.java +++ b/db/src/main/java/de/muehlencord/shared/db/ApplicationPU.java @@ -19,10 +19,11 @@ import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.ElementType.TYPE; -import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import jakarta.inject.Qualifier; +import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.inject.Qualifier; /** * diff --git a/db/src/main/java/de/muehlencord/shared/db/ApplicationTransactionJoinInterceptor.java b/db/src/main/java/de/muehlencord/shared/db/ApplicationTransactionJoinInterceptor.java index 81427fe..43fae12 100644 --- a/db/src/main/java/de/muehlencord/shared/db/ApplicationTransactionJoinInterceptor.java +++ b/db/src/main/java/de/muehlencord/shared/db/ApplicationTransactionJoinInterceptor.java @@ -15,14 +15,15 @@ */ package de.muehlencord.shared.db; -import javax.annotation.Priority; -import javax.inject.Inject; -import javax.interceptor.AroundInvoke; -import javax.interceptor.Interceptor; -import javax.interceptor.InvocationContext; -import javax.persistence.EntityManager; -import javax.transaction.Transactional; -import static javax.transaction.Transactional.TxType.REQUIRED; +import static jakarta.transaction.Transactional.TxType.REQUIRED; + +import jakarta.annotation.Priority; +import jakarta.inject.Inject; +import jakarta.interceptor.AroundInvoke; +import jakarta.interceptor.Interceptor; +import jakarta.interceptor.InvocationContext; +import jakarta.persistence.EntityManager; +import jakarta.transaction.Transactional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/db/src/main/java/de/muehlencord/shared/db/Audit.java b/db/src/main/java/de/muehlencord/shared/db/Audit.java index b171cae..4607075 100644 --- a/db/src/main/java/de/muehlencord/shared/db/Audit.java +++ b/db/src/main/java/de/muehlencord/shared/db/Audit.java @@ -19,13 +19,13 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.time.LocalDateTime; import java.time.ZoneOffset; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; diff --git a/db/src/main/java/de/muehlencord/shared/db/CommonAbstractController.java b/db/src/main/java/de/muehlencord/shared/db/CommonAbstractController.java index d3a82a1..0071bde 100644 --- a/db/src/main/java/de/muehlencord/shared/db/CommonAbstractController.java +++ b/db/src/main/java/de/muehlencord/shared/db/CommonAbstractController.java @@ -16,9 +16,20 @@ package de.muehlencord.shared.db; import de.muehlencord.shared.util.DateUtil; +import jakarta.inject.Inject; +import jakarta.persistence.EntityGraph; +import jakarta.persistence.EntityManager; +import jakarta.persistence.TypedQuery; +import jakarta.persistence.criteria.CriteriaBuilder; +import jakarta.persistence.criteria.CriteriaQuery; +import jakarta.persistence.criteria.Order; +import jakarta.persistence.criteria.Path; +import jakarta.persistence.criteria.Predicate; +import jakarta.persistence.criteria.Root; +import jakarta.transaction.Transactional; +import jakarta.transaction.Transactional.TxType; import java.io.Serializable; import java.time.LocalDateTime; -import java.time.ZoneId; import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Arrays; @@ -28,21 +39,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.UUID; -import javax.ejb.Lock; -import javax.ejb.LockType; -import javax.ejb.TransactionAttribute; -import javax.ejb.TransactionAttributeType; -import javax.inject.Inject; -import javax.persistence.EntityGraph; -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; -import javax.persistence.criteria.CriteriaBuilder; -import javax.persistence.criteria.CriteriaQuery; -import javax.persistence.criteria.Order; -import javax.persistence.criteria.Path; -import javax.persistence.criteria.Predicate; -import javax.persistence.criteria.Root; -import javax.transaction.Transactional; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; @@ -64,7 +60,6 @@ public abstract class CommonAbstractController { this.em = em; } - @Lock(LockType.READ) public T find(Class clazz, Object id) { return em.find(clazz, id); } @@ -79,7 +74,6 @@ public abstract class CommonAbstractController { return graph; } - @Lock(LockType.READ) public T find(Class clazz, Object id, String... subGraphItems) { EntityGraph graph = getEntityGraph(clazz, subGraphItems); Map hints = new HashMap<>(); @@ -89,12 +83,10 @@ public abstract class CommonAbstractController { return entity; } - @Lock(LockType.READ) public List find(Class clazz, Map filters, List orderFields, String... subGraphItems) { return find(clazz, filters, orderFields, 0, 0, subGraphItems); } - @Lock(LockType.READ) public List find(Class clazz, Map filters, List orderFields, int limit, int offset, String... subGraphItems) { final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery criteria = cb.createQuery(clazz); @@ -118,12 +110,10 @@ public abstract class CommonAbstractController { return query.getResultList(); } - @Lock(LockType.READ) public List find(Class clazz, List filters, List orderFields, String... subGraphItems) throws ControllerException { return find(clazz, filters, orderFields, 0, 0); } - @Lock(LockType.READ) public List find(Class clazz, List filters, List orderFields, int limit, int offset, String... subGraphItems) throws ControllerException { final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery criteria = cb.createQuery(clazz); @@ -157,7 +147,6 @@ public abstract class CommonAbstractController { * @return a list of all entities found * @throws ControllerException if the search cannot be executed. */ - @Lock(LockType.READ) public List findAll(Class entityClass) throws ControllerException { return findAll(entityClass, new ArrayList<>()); } @@ -170,7 +159,6 @@ public abstract class CommonAbstractController { * @return a list of all entities found * @throws ControllerException if the search cannot be executed. */ - @Lock(LockType.READ) public List findAll(Class entityClass, String... orderFields) throws ControllerException { return findAll(entityClass, Arrays.asList(orderFields)); } @@ -183,7 +171,6 @@ public abstract class CommonAbstractController { * @return a list of all entities found * @throws ControllerException if the search cannot be executed. */ - @Lock(LockType.READ) public List findAll(Class entityClass, List orderFields) throws ControllerException { final CriteriaBuilder cb = em.getCriteriaBuilder(); final CriteriaQuery criteria = cb.createQuery(entityClass); @@ -239,9 +226,7 @@ public abstract class CommonAbstractController { * @return the entity after it has been written to the database. * @throws ControllerException if the the creation or update of the entity fails. */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - @Transactional - @Lock(LockType.WRITE) + @Transactional(TxType.REQUIRED) public T createOrUpdate(T entity, String createdBy) throws ControllerException { if (entity.getId() == null) { create(entity, createdBy); @@ -260,9 +245,7 @@ public abstract class CommonAbstractController { * @return the entity after it has been written to the database. * @throws ControllerException if the the creation fails */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - @Transactional - @Lock(LockType.WRITE) + @Transactional(TxType.REQUIRED) public T create(T entity, String createdBy) throws ControllerException { if (Auditable.class.isAssignableFrom(entity.getClass())) { Audit audit = ((Auditable) entity).getAudit(); @@ -324,9 +307,7 @@ public abstract class CommonAbstractController { * @return the entity after it has been written to the database. * @throws ControllerException if the the updates fails */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - @Transactional - @Lock(LockType.WRITE) + @Transactional(TxType.REQUIRED) public T update(T entity, String updatedBy) throws ControllerException { T currentEntity = executeUpdate(entity, updatedBy); if (EndDateable.class.isAssignableFrom(entity.getClass())) { @@ -348,9 +329,7 @@ public abstract class CommonAbstractController { * @param deletedBy the username to apply write into the audit history * @throws ControllerException if the deletion fails. */ - @TransactionAttribute(TransactionAttributeType.REQUIRED) - @Transactional - @Lock(LockType.WRITE) + @Transactional(TxType.REQUIRED) public void delete(T entity, String deletedBy) throws ControllerException { // if the entity is endDateable just set the validToDate to now intead of executing the deletion if (EndDateable.class.isAssignableFrom(entity.getClass())) { diff --git a/db/src/main/java/de/muehlencord/shared/db/ControllerException.java b/db/src/main/java/de/muehlencord/shared/db/ControllerException.java index 684914e..30a87c2 100644 --- a/db/src/main/java/de/muehlencord/shared/db/ControllerException.java +++ b/db/src/main/java/de/muehlencord/shared/db/ControllerException.java @@ -15,17 +15,19 @@ */ package de.muehlencord.shared.db; -import javax.ejb.ApplicationException; + +import lombok.Getter; /** * Generic exception if an exception inside a Controller class occurs * * @author Joern Muehlencord (joern@muehlencord.de) */ -@ApplicationException(rollback = true) +@Getter public class ControllerException extends Exception { private static final long serialVersionUID = 5190280225284514859L; + public static final int INTERNAL_ERROR = 0; public static final int CAUSE_ALREADY_EXISTS = 1; public static final int CAUSE_NOT_FOUND = 2; @@ -60,12 +62,4 @@ public class ControllerException extends Exception { this.causeCode = causeCode; } - /** - * returns the cause code - * - * @return the cause code - */ - public int getCauseCode() { - return causeCode; - } } diff --git a/db/src/main/java/de/muehlencord/shared/db/EntityUtil.java b/db/src/main/java/de/muehlencord/shared/db/EntityUtil.java index f0e16e8..a86d1fa 100644 --- a/db/src/main/java/de/muehlencord/shared/db/EntityUtil.java +++ b/db/src/main/java/de/muehlencord/shared/db/EntityUtil.java @@ -16,14 +16,15 @@ package de.muehlencord.shared.db; import de.muehlencord.shared.util.DateUtil; +import jakarta.persistence.Id; import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; -import javax.persistence.Id; import org.apache.commons.lang3.SerializationUtils; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** @@ -32,7 +33,7 @@ import org.slf4j.LoggerFactory; */ public class EntityUtil { - private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(EntityUtil.class); + private static final Logger logger = LoggerFactory.getLogger(EntityUtil.class); public static Field getIdField(Class entity) { if (entity == null) { @@ -63,8 +64,8 @@ public class EntityUtil { if (field == null) { return entity; } - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("id column of {} is {}", entity.getClass().getSimpleName(), field.getName()); + if (logger.isDebugEnabled()) { + logger.debug("id column of {} is {}", entity.getClass().getSimpleName(), field.getName()); } try { diff --git a/db/src/main/java/de/muehlencord/shared/db/NumericallyIdentifiedEntity.java b/db/src/main/java/de/muehlencord/shared/db/NumericallyIdentifiedEntity.java index 4fb8b79..c8cafe0 100644 --- a/db/src/main/java/de/muehlencord/shared/db/NumericallyIdentifiedEntity.java +++ b/db/src/main/java/de/muehlencord/shared/db/NumericallyIdentifiedEntity.java @@ -1,11 +1,11 @@ package de.muehlencord.shared.db; +import jakarta.persistence.Basic; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; @MappedSuperclass public abstract class NumericallyIdentifiedEntity implements Serializable { diff --git a/db/src/main/java/de/muehlencord/shared/db/StandardController.java b/db/src/main/java/de/muehlencord/shared/db/StandardController.java deleted file mode 100644 index 0352124..0000000 --- a/db/src/main/java/de/muehlencord/shared/db/StandardController.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2019 Joern Muehlencord (joern@muehlencord.de). - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -package de.muehlencord.shared.db; - -import javax.ejb.Stateless; - -/** - * - * @author Joern Muehlencord (joern@muehlencord.de) - */ -@Stateless -public class StandardController extends CommonAbstractController { - - - -} diff --git a/db/src/main/java/de/muehlencord/shared/db/Validity.java b/db/src/main/java/de/muehlencord/shared/db/Validity.java index 2da93e5..019a5cd 100644 --- a/db/src/main/java/de/muehlencord/shared/db/Validity.java +++ b/db/src/main/java/de/muehlencord/shared/db/Validity.java @@ -15,14 +15,14 @@ */ package de.muehlencord.shared.db; +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.validation.constraints.NotNull; /** * diff --git a/db/src/test/java/de/muehlencord/shared/db/CounterEntity.java b/db/src/test/java/de/muehlencord/shared/db/CounterEntity.java index 064e5bd..3cc3dc5 100644 --- a/db/src/test/java/de/muehlencord/shared/db/CounterEntity.java +++ b/db/src/test/java/de/muehlencord/shared/db/CounterEntity.java @@ -15,16 +15,16 @@ */ package de.muehlencord.shared.db; +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.Serializable; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; /** * diff --git a/db/src/test/java/de/muehlencord/shared/db/TestEntity.java b/db/src/test/java/de/muehlencord/shared/db/TestEntity.java index a403d82..93233c9 100644 --- a/db/src/test/java/de/muehlencord/shared/db/TestEntity.java +++ b/db/src/test/java/de/muehlencord/shared/db/TestEntity.java @@ -15,21 +15,21 @@ */ package de.muehlencord.shared.db; +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.validation.constraints.Max; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.UUID; -import javax.persistence.Basic; -import javax.persistence.Column; -import javax.persistence.Embedded; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.validation.constraints.Max; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; /** * diff --git a/jeeutil/pom.xml b/jeeutil/pom.xml index 573f024..27c1fcf 100644 --- a/jeeutil/pom.xml +++ b/jeeutil/pom.xml @@ -15,58 +15,70 @@ See the License for the specific language governing permissions and limitations under the License. --> - - 4.0.0 - - shared - de.muehlencord - 2.0.0-SNAPSHOT - + + 4.0.0 + + shared + de.muehlencord + 2.0.0-SNAPSHOT + - de.muehlencord.shared - shared-jeeutil - ejb + de.muehlencord.shared + shared-jeeutil + ejb - shared-jeeutil + shared-jeeutil - - - io.fusionauth - fusionauth-jwt - - - javax - javaee-api - provided - - - org.slf4j - slf4j-api - provided - - - org.hibernate - hibernate-core - provided - - - org.primefaces - primefaces - jar - provided - - + + + + org.glassfish + jakarta.faces + + + org.primefaces + primefaces + jar + provided + - - - - org.apache.maven.plugins - maven-ejb-plugin - - 3.1 - - - - + + + jakarta.ws.rs + jakarta.ws.rs-api + provided + + + jakarta.validation + jakarta.validation-api + + + jakarta.interceptor + jakarta.interceptor-api + + + + + org.slf4j + slf4j-api + + + + + + + io.fusionauth + fusionauth-jwt + + + + + org.hibernate + hibernate-core + provided + + + diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/DefaultUIMessage.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/DefaultUIMessage.java index c3d9d64..284be8d 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/DefaultUIMessage.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/DefaultUIMessage.java @@ -15,8 +15,8 @@ */ package de.muehlencord.shared.jeeutil; -import javax.faces.application.FacesMessage; -import javax.faces.application.FacesMessage.Severity; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.application.FacesMessage.Severity; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java index 9599d97..3af6ef0 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/FacesUtil.java @@ -15,9 +15,9 @@ */ package de.muehlencord.shared.jeeutil; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.context.FacesContext; import java.util.List; -import javax.faces.application.FacesMessage; -import javax.faces.context.FacesContext; /** * Helper class for java faces application. diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/UIMessage.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/UIMessage.java index dd5a44f..32deb15 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/UIMessage.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/UIMessage.java @@ -15,8 +15,8 @@ */ package de.muehlencord.shared.jeeutil; +import jakarta.faces.application.FacesMessage; import java.io.Serializable; -import javax.faces.application.FacesMessage; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIError.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIError.java index 8d28636..6114867 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIError.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIError.java @@ -15,7 +15,7 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIErrorResponse.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIErrorResponse.java index a803ed4..8939c72 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIErrorResponse.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIErrorResponse.java @@ -15,6 +15,7 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.ws.rs.core.Response; import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlRootElement; @@ -22,7 +23,6 @@ import jakarta.xml.bind.annotation.XmlType; import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import java.util.Locale; import java.util.ResourceBundle; -import javax.ws.rs.core.Response; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIException.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIException.java index 12bdce7..d56eedc 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIException.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIException.java @@ -16,9 +16,9 @@ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.ResponseBuilder; import java.util.Locale; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.ResponseBuilder; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIExceptionInterceptor.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIExceptionInterceptor.java index b4c031b..cd4fe45 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIExceptionInterceptor.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/APIExceptionInterceptor.java @@ -15,12 +15,12 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.inject.Inject; +import jakarta.interceptor.AroundInvoke; +import jakarta.interceptor.InvocationContext; +import jakarta.validation.ConstraintViolationException; +import jakarta.ws.rs.core.Response; import java.util.Locale; -import javax.inject.Inject; -import javax.interceptor.AroundInvoke; -import javax.interceptor.InvocationContext; -import javax.validation.ConstraintViolationException; -import javax.ws.rs.core.Response; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/BadRequestMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/BadRequestMapper.java index 7cf5736..10e5597 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/BadRequestMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/BadRequestMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.BadRequestException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.BadRequestException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationEntry.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationEntry.java index a19500c..68bb0b6 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationEntry.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationEntry.java @@ -15,12 +15,12 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Path; import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlRootElement; import java.util.Iterator; -import javax.validation.ConstraintViolation; -import javax.validation.Path; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationMapper.java index f6e68f6..a1aee95 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ConstraintViolationMapper.java @@ -15,19 +15,19 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.GenericEntity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Request; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Variant; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import java.util.ArrayList; import java.util.List; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.GenericEntity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Variant; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ForbiddenMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ForbiddenMapper.java index 4a3e2d3..2a34c8a 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ForbiddenMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ForbiddenMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.ForbiddenException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.ForbiddenException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAcceptableMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAcceptableMapper.java index 33b6e97..ad3f58c 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAcceptableMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAcceptableMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.NotAcceptableException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.NotAcceptableException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAllowedMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAllowedMapper.java index 7c41854..9dc1fb7 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAllowedMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAllowedMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.NotAllowedException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.NotAllowedException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAuthorizedMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAuthorizedMapper.java index 8ae00d2..07789a0 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAuthorizedMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotAuthorizedMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.NotAuthorizedException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.NotAuthorizedException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotFoundMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotFoundMapper.java index 96e7d30..a60342a 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotFoundMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotFoundMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotSupportMapper.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotSupportMapper.java index 761b661..a2713b8 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotSupportMapper.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/NotSupportMapper.java @@ -15,10 +15,10 @@ */ package de.muehlencord.shared.jeeutil.restexfw; -import javax.ws.rs.NotSupportedException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.NotSupportedException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ResponseStatusAdapter.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ResponseStatusAdapter.java index e77fe50..ffe1d55 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ResponseStatusAdapter.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ResponseStatusAdapter.java @@ -15,9 +15,9 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import jakarta.xml.bind.annotation.adapters.XmlAdapter; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; /** * @author Joern Muehlencord (joern@muehlencord.de) diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ValidationController.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ValidationController.java index 03d0af8..7bb3aa5 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ValidationController.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/restexfw/ValidationController.java @@ -15,12 +15,12 @@ */ package de.muehlencord.shared.jeeutil.restexfw; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.ConstraintViolationException; +import jakarta.validation.Validation; +import jakarta.validation.Validator; +import jakarta.validation.ValidatorFactory; import java.util.Set; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/Email.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/Email.java index 6e88270..ae93291 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/Email.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/Email.java @@ -15,16 +15,16 @@ */ package de.muehlencord.shared.jeeutil.validator; -import java.lang.annotation.Documented; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; -import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import jakarta.validation.Constraint; +import jakarta.validation.Payload; +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.validation.Constraint; -import javax.validation.Payload; -import org.primefaces.validate.bean.ClientConstraint; /** * @@ -33,7 +33,8 @@ import org.primefaces.validate.bean.ClientConstraint; @Target({METHOD, FIELD, ANNOTATION_TYPE}) @Retention(RUNTIME) @Constraint(validatedBy = EmailConstraintValidator.class) -@ClientConstraint(resolvedBy = EmailClientValidationConstraint.class) +// FIXME - broken ClientValidationConstraint from Primefaces 13 still uses javax.xx +//@ClientConstraint(resolvedBy = EmailClientValidationConstraint.class) @Documented public @interface Email { diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailClientValidationConstraint.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailClientValidationConstraint.java index 1c3d66f..6629ba4 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailClientValidationConstraint.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailClientValidationConstraint.java @@ -15,21 +15,20 @@ */ package de.muehlencord.shared.jeeutil.validator; +import jakarta.validation.metadata.ConstraintDescriptor; import java.util.HashMap; import java.util.Map; -import javax.validation.metadata.ConstraintDescriptor; -import org.primefaces.validate.bean.ClientValidationConstraint; /** - * + * FIXME - broken ClientValidationConstraint from Primefaces 13 still uses javax.xx * @author Joern Muehlencord (joern@muehlencord.de) */ -public class EmailClientValidationConstraint implements ClientValidationConstraint { +public class EmailClientValidationConstraint { // {implements ClientValidationConstraint { public static final String MESSAGE_METADATA = "data-p-email-msg"; - @Override - public Map getMetadata(ConstraintDescriptor constraintDescriptor) { +// @Override + public Map getMetadata(ConstraintDescriptor constraintDescriptor) { Map metadata = new HashMap<>(); Map attrs = constraintDescriptor.getAttributes(); Object message = attrs.get("message"); @@ -40,7 +39,7 @@ public class EmailClientValidationConstraint implements ClientValidationConstrai return metadata; } - @Override +// @Override public String getValidatorId() { return Email.class.getSimpleName(); } diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailConstraintValidator.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailConstraintValidator.java index 0bc821b..0f00bd2 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailConstraintValidator.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailConstraintValidator.java @@ -15,9 +15,9 @@ */ package de.muehlencord.shared.jeeutil.validator; +import jakarta.validation.ConstraintValidator; +import jakarta.validation.ConstraintValidatorContext; import java.util.regex.Pattern; -import javax.validation.ConstraintValidator; -import javax.validation.ConstraintValidatorContext; /** * diff --git a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailValidator.java b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailValidator.java index 8654f0d..0db9b22 100644 --- a/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailValidator.java +++ b/jeeutil/src/main/java/de/muehlencord/shared/jeeutil/validator/EmailValidator.java @@ -15,14 +15,14 @@ */ package de.muehlencord.shared.jeeutil.validator; +import jakarta.faces.application.FacesMessage; +import jakarta.faces.component.UIComponent; +import jakarta.faces.context.FacesContext; +import jakarta.faces.validator.FacesValidator; +import jakarta.faces.validator.Validator; +import jakarta.faces.validator.ValidatorException; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.faces.application.FacesMessage; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.validator.FacesValidator; -import javax.faces.validator.Validator; -import javax.faces.validator.ValidatorException; /** * diff --git a/pom.xml b/pom.xml index 156abd1..ee4d6d8 100644 --- a/pom.xml +++ b/pom.xml @@ -83,23 +83,35 @@ limitations under the License. 2.14.2 1.18.26 5.9.2 - 12.0.0 - 1.6.1 - 4.0.1 + 5.2.3 3.9.0 + 3.12.0 2.10.1 5.2.2 1.70 6.1.7.Final + 1.6.2 + + 4.0.4 + 5.1.4 + 2.1.0 + 2.0.0
+ + org.joinfaces + joinfaces-dependencies + ${joinfaces.version} + pom + import + + shared-db de.muehlencord.shared - ejb ${project.version} @@ -112,11 +124,8 @@ limitations under the License. de.muehlencord.shared ${project.version} - - commons-codec - commons-codec - 1.15 - + + commons-net commons-net @@ -125,13 +134,10 @@ limitations under the License. commons-lang3 org.apache.commons - 3.12.0 - - - commons-io - commons-io - 2.11.0 + ${commons-lang.version} + + slf4j-api org.slf4j @@ -148,16 +154,36 @@ limitations under the License. ${slf4j.version} + javax.mail com.sun.mail - 1.6.2 + ${com-sun-mail.version} ews-java-api com.microsoft.ews-java-api 2.0 + + + + org.glassfish + jakarta.faces + ${jakarta-faces.version} + + + jakarta.interceptor + jakarta.interceptor-api + ${jakarta.interceptor-api.version} + + + jakarta.inject + jakarta.inject-api + ${jakarta-inject-api.version} + + + gson com.google.code.gson @@ -180,17 +206,7 @@ limitations under the License. com.fasterxml.jackson.datatype ${jackson.version} - - javaee-api - javax - 8.0.1 - - - javaee-web-api - javax - provided - 8.0.1 - + scrypt com.lambdaworks @@ -208,21 +224,6 @@ limitations under the License. jar ${hibernate.version} - - primefaces - org.primefaces - ${primefaces.version} - - - admin-template - com.github.adminfaces - ${adminfaces-template.version} - - - omnifaces - org.omnifaces - ${omnifaces.version} - poi-ooxml org.apache.poi @@ -387,10 +388,11 @@ limitations under the License. - maven-compiler-plugin org.apache.maven.plugins + maven-compiler-plugin + org.apache.maven.plugins maven-release-plugin v@{project.version} @@ -398,8 +400,14 @@ limitations under the License. 2.5.3 - maven-surefire-plugin org.apache.maven.plugins + maven-surefire-plugin + + + + org.apache.maven.plugins + maven-dependency-plugin + 3.6.1
-- 2.39.5 From db1d81bcd997491f7039352533f5c8d511460858 Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Thu, 15 Feb 2024 23:45:13 +0100 Subject: [PATCH 3/4] change to jakarta.mail --- db/pom.xml | 2 +- jeeutil/pom.xml | 2 +- network/pom.xml | 4 +- .../network/mail/DefaultMailReader.java | 20 +++--- .../shared/network/mail/MailMessage.java | 4 +- .../shared/network/mail/MailMessageUtils.java | 13 ++-- .../network/mail/imap/ImapMailReader.java | 2 +- .../shared/network/mail/TestSendMail.java | 27 +++---- pom.xml | 71 ++++++++++--------- 9 files changed, 76 insertions(+), 69 deletions(-) diff --git a/db/pom.xml b/db/pom.xml index cbfde88..cb19bea 100644 --- a/db/pom.xml +++ b/db/pom.xml @@ -21,7 +21,7 @@ limitations under the License. de.muehlencord.shared shared-db - ejb + jar shared diff --git a/jeeutil/pom.xml b/jeeutil/pom.xml index 27c1fcf..d25d78b 100644 --- a/jeeutil/pom.xml +++ b/jeeutil/pom.xml @@ -26,7 +26,7 @@ limitations under the License. de.muehlencord.shared shared-jeeutil - ejb + jar shared-jeeutil diff --git a/network/pom.xml b/network/pom.xml index 3b6d0be..d82a5d6 100644 --- a/network/pom.xml +++ b/network/pom.xml @@ -42,8 +42,8 @@ limitations under the License. - javax.mail - com.sun.mail + jakarta.mail + jakarta.mail-api ews-java-api diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java b/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java index 93f1912..5ad0e4d 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/DefaultMailReader.java @@ -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; diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java index 8396d5f..edf7bd1 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessage.java @@ -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 diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java index cd98c60..5185b65 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/MailMessageUtils.java @@ -16,18 +16,19 @@ 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; diff --git a/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java b/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java index fc18ee1..301671b 100644 --- a/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java +++ b/network/src/main/java/de/muehlencord/shared/network/mail/imap/ImapMailReader.java @@ -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 javax.mail.Session; +import jakarta.mail.Session; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java b/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java index 3cebecf..5d8ed62 100644 --- a/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java +++ b/network/src/test/java/de/muehlencord/shared/network/mail/TestSendMail.java @@ -15,6 +15,19 @@ */ 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; @@ -22,18 +35,6 @@ 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; @@ -63,7 +64,7 @@ public class TestSendMail { props.put("mail.smtp.port", "587"); props.put("mail.debug", "true"); - Session mailSession = Session.getInstance(props, new javax.mail.Authenticator() { + Session mailSession = Session.getInstance(props, new jakarta.mail.Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(RECEIVER, PASSWORD); diff --git a/pom.xml b/pom.xml index ee4d6d8..a12875a 100644 --- a/pom.xml +++ b/pom.xml @@ -79,24 +79,36 @@ limitations under the License. 17 UTF-8 - 2.0.6 - 2.14.2 - 1.18.26 - 5.9.2 + 2.0.12 + 2.16.1 + 1.18.30 + 5.10.2 - 5.2.3 - 3.9.0 - 3.12.0 + 5.2.5 + 3.10.0 + 3.14.0 2.10.1 - 5.2.2 + 5.3.1 1.70 6.1.7.Final - 1.6.2 + 2.1.2 + 2.0 + 1.4.0 - 4.0.4 - 5.1.4 + 4.0.5 + 5.1.8 2.1.0 - 2.0.0 + 2.0.1 + + 3.1.1 + 1.6 + 3.8.1 + 2.5.3 + 2.22.2 + 3.6.1 + 1.6.8 + 1.14 + @@ -156,14 +168,15 @@ limitations under the License. - javax.mail - com.sun.mail - ${com-sun-mail.version} + jakarta.mail + jakarta.mail-api + ${jakarta.mail-api.version} + ews-java-api com.microsoft.ews-java-api - 2.0 + ${ews-java-api.version} @@ -210,7 +223,7 @@ limitations under the License. scrypt com.lambdaworks - 1.4.0 + ${scrypt.version} bcprov-jdk15on @@ -267,7 +280,7 @@ limitations under the License. true org.sonatype.plugins - 1.6.8 + ${nexus-staging-maven-plugin.version} @@ -297,7 +310,7 @@ limitations under the License. org.apache.maven.plugins - 3.1.1 + ${maven-javadoc-plugin.version} @@ -321,7 +334,7 @@ limitations under the License. org.codehaus.mojo - 1.14 + ${license-maven-plugin.version} @@ -340,7 +353,7 @@ limitations under the License. org.apache.maven.plugins - 1.6 + ${maven-gpg-plugin.version} @@ -360,27 +373,20 @@ limitations under the License. ${maven.compiler.target} org.apache.maven.plugins - 3.8.1 - - - - - maven-ejb-plugin - org.apache.maven.plugins - 3.0.1 + ${maven-compiler-plugin.version} maven-release-plugin - 2.5.3 + ${maven-release-plugin.version} maven-surefire-plugin org.apache.maven.plugins - 2.22.2 + ${maven-surefire-plugin.version} @@ -397,7 +403,6 @@ limitations under the License. v@{project.version} - 2.5.3 org.apache.maven.plugins @@ -407,7 +412,7 @@ limitations under the License. org.apache.maven.plugins maven-dependency-plugin - 3.6.1 + ${maven-dependency-plugin.version} -- 2.39.5 From 85c181a433ff6fb50933a4e63d8f8bc8a84e1e03 Mon Sep 17 00:00:00 2001 From: Joern Muehlencord Date: Fri, 16 Feb 2024 00:12:49 +0100 Subject: [PATCH 4/4] fixed typo --- .../java/de/muehlencord/shared/network/http/HttpLayerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java b/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java index 996bab4..0ffb4a5 100644 --- a/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java +++ b/network/src/test/java/de/muehlencord/shared/network/http/HttpLayerTest.java @@ -22,7 +22,7 @@ import java.util.List; import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test;k +import org.junit.jupiter.api.Test; /** * @author Joern Muehlencord (joern@muehlencord.de) -- 2.39.5