-
Notifications
You must be signed in to change notification settings - Fork 642
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
[Enhancement] Do some code optimization[AuthTokenUtils] #3515
Comments
@Alonexc @xwm1992 @kyooosukedn Can I work on this issue? |
@himansh295 Currently there are pr submissions, you can look at other issues. |
It has been 90 days since the last activity on this issue. Apache EventMesh values the voices of the community. Please don't hesitate to share your latest insights on this matter at any time, as the community is more than willing to engage in discussions regarding the development and optimization directions of this feature. If you feel that your issue has been resolved, please feel free to close it. Should you have any additional information to share, you are welcome to reopen this issue. |
请问该问题已经有人解决了吗,如果没有,我可以做尝试吗 |
* Code optimization * Remove unused imports * Added one forgotten import 'Objects' * Added Constants import * removed unnecessary space * fixed code optimization * corrected some small changes * redundant lines * redundant lines * optimized returned reply in subscribe method * reverted correct change * reverted back
Search before asking
Enhancement Request
located at:
eventmesh-security-plugin/eventmesh-security-auth-token/src/main/java/org/apache/eventmesh/auth/token/impl/auth/AuthTokenUtils.java
analysis and explanation:
a. The logic of "authTokenByPublicKey" and "helloTaskAuthTokenByPublicKey" method in lines "54-87" and "99-132" is the same, so it can be extracted as one method.
b. Variable 'validationKeyBytes' initializer 'new byte[0]' is redundant.[line 66,111]
c. Argument 'publicKeyUrl' might be null.[line 68,113]
d. 'if' statement can be simplified.[line 146]
e. The "{}" is redundant.[line 90,134]
Describe the solution you'd like
a. Repeat the logic code extracted as a method.
b. Remove redundant initializers.
c. Use 'Objects.requireNonNull()' to avoid an NPE.
d. Replace this if-then-else statement by a single return statement
e. Remove the extra "{}".
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: