-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SHIRO-898] Jakarta EE integration #563
Conversation
6eeeb71
to
a51fd7f
Compare
support/jakarta-ee/src/main/resources/META-INF/services/javax.enterprise.inject.spi.Extension
Show resolved
Hide resolved
import lombok.Getter; | ||
import lombok.experimental.Delegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 for lombok as it does bytecode modification.
We can use immutables.org if you like which generates source code files instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using maven-lombok-plugin
which generates source code instead of manipulating bytecode directly, and does not touch bytecode. It's in generated-source
directory and that's what gets used
<groupId>org.omnifaces</groupId> | ||
<artifactId>omnifaces</artifactId> | ||
<version>3.14.1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for testing, -0.5 for pulling it in into prod code for just util classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did some OF audit and there are literally 100s of feature that are on by default it's a huge loss not to have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most JSF peope will use OF anyway (afaik) - I have no opinion here ;-)
support/jakarta-ee/pom.xml
Outdated
<dependency> | ||
<groupId>org.jsoup</groupId> | ||
<artifactId>jsoup</artifactId> | ||
<version>1.15.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.flowlogix</groupId> | ||
<artifactId>flowlogix-jee</artifactId> | ||
<version>5.1.5</version> | ||
</dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I would love to see if we could go without those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSoup is necessary to parse HTML. I don't think there any build-in html parsers in Jakarta EE and jsoup is widely used and tiny.
I removed FL dependency from code as it's no longer required
private final @Delegate(types = AT.class) AnnotatedType<T> wrapped; | ||
private final @Getter Set<Annotation> annotations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't justify lombok, we can use our IDEs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE won't maintain the generated code. Neither does 'delombok'
Lombok discussion in slack
* @author lprimak | ||
*/ | ||
public class KeyGen { | ||
private final Lazy<AesCipherService> cipherService = new Lazy<>(AesCipherService::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very elegant and easy to read, but a static inner Holder
class would also do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to be concise and limit the lines of code here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess it is a question, if one want to replace OF or not ;-)
43e2324
to
9a932a6
Compare
integration-tests/jakarta-ee/src/main/java/org/apache/shiro/testing/jakarta/ee/FormBean.java
Outdated
Show resolved
Hide resolved
support/jakarta-ee/src/main/java/org/apache/shiro/ee/cdi/AopHelper.java
Outdated
Show resolved
Hide resolved
* @author lprimak | ||
*/ | ||
public class KeyGen { | ||
private final Lazy<AesCipherService> cipherService = new Lazy<>(AesCipherService::new); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess it is a question, if one want to replace OF or not ;-)
support/jakarta-ee/src/main/java/org/apache/shiro/ee/cdi/ShiroOmniViewScoped.java
Outdated
Show resolved
Hide resolved
support/jakarta-ee/src/main/java/org/apache/shiro/ee/cdi/ShiroSecurityInterceptor.java
Outdated
Show resolved
Hide resolved
Thanks @rzo1 for your review! All good comments and I’ll work on those. |
f7df574
to
20f1c65
Compare
11551b2
to
30f70f3
Compare
3bd8593
to
305af0d
Compare
Assuming Java 11 base for Shiro 2.x, the comments no longer apply
69e7732
to
7ce5039
Compare
38d275d
to
8bd55b2
Compare
f2913c3
to
8b4d0a5
Compare
8b4d0a5
to
d0432fc
Compare
Feature content
https://github.com/lprimak/shiro/blob/jakartaee-integration/support/jakarta-ee/README.adoc
Integrates Shiro functionality into Jakarta EE Web / Full Profile
Notes for reviewers:
This is an integration module with the full Jakarta EE web profile.
The purpose of this module is for the consumer to integrate with Jakarta EE Web Profile to the fullest extent possible.
As an integration module, it pulls in the pieces necessary to develop a complete application.
It is not the intent of this module to be minimalistic. Core Shiro packages already serve that purpose well.
This module incorporates features of the whole Web Profile..
I thought long and hard which dependencies to pull in, and I think I have achieved good balance between minimal necessary, quality of the resulting code, and ease of maintenance.
I would like for the reviewers to look for the following:
What I think is out of scope for this review:
See README for the documentation on feature set.
Thank you very much and I appreciate all the feedback
Following this checklist to help us incorporate your contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
[SHIRO-XXX] - Fixes bug in SessionManager
,where you replace
SHIRO-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the commit message.
mvn clean install apache-rat:check
to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.git rebase -i
.Trivial changes like typos do not require a JIRA issue (javadoc, comments...).
In this case, just format the pull request title like
(DOC) - Add javadoc in SessionManager
.If this is your first contribution, you have to read the Contribution Guidelines
If your pull request is about ~20 lines of code you don't need to sign an Individual Contributor License Agreement
if you are unsure please ask on the developers list.
To make clear that you license your contribution under the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.