You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eventmesh.apache.org by "Alonexc (via GitHub)" <gi...@apache.org> on 2023/03/22 08:06:13 UTC

[GitHub] [incubator-eventmesh] Alonexc opened a new issue, #3515: [Enhancement] Do some code optimization[AuthTokenUtils]

Alonexc opened a new issue, #3515:
URL: https://github.com/apache/incubator-eventmesh/issues/3515

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/eventmesh/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### 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]
   ![image](https://user-images.githubusercontent.com/91315508/226837013-8e9dabef-0283-4ee4-af8e-6b5707203df0.png)
   
   d. 'if' statement can be simplified.[line 146]
   ![image](https://user-images.githubusercontent.com/91315508/226837052-acce4d6a-8674-4f0c-b224-2ab79524198a.png)
   
   e. The "{}" is redundant.[line 90,134]
   ![image](https://user-images.githubusercontent.com/91315508/226837100-ebe51044-b44d-45ac-af3a-316ae70ddec9.png)
   
   
   ### 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.
   ![image](https://user-images.githubusercontent.com/91315508/226837141-d5d01b94-4391-4871-a14a-3e3d43e0523f.png)
   
   d. Replace this if-then-else statement by a single return statement
   ![image](https://user-images.githubusercontent.com/91315508/226837194-860608fe-e0c1-44ca-b428-57f27c243daf.png)
   
   e. Remove the extra "{}".
   ![image](https://user-images.githubusercontent.com/91315508/226837239-3021ae1b-920f-4ec8-81c9-879c2146e2a4.png)
   
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] himansh295 commented on issue #3515: [Enhancement] Do some code optimization[AuthTokenUtils]

Posted by "himansh295 (via GitHub)" <gi...@apache.org>.
himansh295 commented on issue #3515:
URL: https://github.com/apache/eventmesh/issues/3515#issuecomment-1546652352

   @Alonexc @xwm1992 @kyooosukedn Can I work on this issue?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


[GitHub] [eventmesh] Alonexc commented on issue #3515: [Enhancement] Do some code optimization[AuthTokenUtils]

Posted by "Alonexc (via GitHub)" <gi...@apache.org>.
Alonexc commented on issue #3515:
URL: https://github.com/apache/eventmesh/issues/3515#issuecomment-1547345464

   @himansh295 Sure, welcome!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org


Re: [I] [Enhancement] Do some code optimization[AuthTokenUtils] (eventmesh)

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #3515:
URL: https://github.com/apache/eventmesh/issues/3515#issuecomment-2070570394

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: issues-help@eventmesh.apache.org