You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@linkis.apache.org by GitBox <gi...@apache.org> on 2022/08/25 07:45:20 UTC

[GitHub] [incubator-linkis] zhaoyun006 opened a new pull request, #2996: linkis redis sso service

zhaoyun006 opened a new pull request, #2996:
URL: https://github.com/apache/incubator-linkis/pull/2996

   <!--
   Thank you for sending the PR! We appreciate you spending the time to work on these changes.
   You can learn more about contributing to Apache Linkis here: https://linkis.apache.org/community/how-to-contribute
   Happy contributing!
   -->
   
   ### What is the purpose of the change
   
   Support multiple gateways to provide services at the same time
   Modified the memory storage rules of SSOUtils into redis
   
   ### Brief change log
   
   - Modified the memory storage rules of SSOUtils into redis
   
   ### Checklist
   
   - [x] I have read the [Contributing Guidelines on pull requests](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#pull-requests).
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [Linkis mailing list](https://linkis.apache.org/community/how-to-subscribe) first)
   - [ ] **If this is a code change**: I have written unit tests to fully verify the new behavior.
   
   
   
   <!--
   
   Note
   
   1. Mark the PR title as `[WIP] title` until it's ready to be reviewed.
      如果PR还未准备好被review,请在标题上添加[WIP]标识(WIP work in progress)
   
   2. Always add/update tests for any changes unless you have a good reason.
      除非您有充分的理由,否则任何修改都需要添加/更新测试
      
   3. Always update the documentation to reflect the changes made in the PR.
      始终更新文档以反映 PR 中所做的更改  
      
   4. After the PR is submitted, please pay attention to the execution result of git action check. 
      If there is any failure, please adjust it in time
      PR提交后,请关注git action check 执行结果,关键的check失败时,请及时修正
      
   5. Before the pr is merged, if the commit is missing, you can continue to commit the code
       在未合并前,如果提交有遗漏,您可以继续提交代码 
   
   6. After you submit PR, you can add assistant WeChat, the WeChat QR code is 
      https://user-images.githubusercontent.com/7869972/176336986-d6b9be8f-d1d3-45f1-aa45-8e6adf5dd244.png 
      您提交pr后,可以添加助手微信,微信二维码为
      https://user-images.githubusercontent.com/7869972/176336986-d6b9be8f-d1d3-45f1-aa45-8e6adf5dd244.png
   
   -->
   


-- 
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: notifications-unsubscribe@linkis.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] peacewong merged pull request #2996: linkis redis sso service

Posted by GitBox <gi...@apache.org>.
peacewong merged PR #2996:
URL: https://github.com/apache/incubator-linkis/pull/2996


-- 
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: notifications-unsubscribe@linkis.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] peacewong commented on a diff in pull request #2996: linkis redis sso service

Posted by GitBox <gi...@apache.org>.
peacewong commented on code in PR #2996:
URL: https://github.com/apache/incubator-linkis/pull/2996#discussion_r954856459


##########
linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/security/SSOUtils.scala:
##########
@@ -41,7 +41,7 @@ object SSOUtils extends Logging {
 
   private val sessionTimeout = ServerConfiguration.BDP_SERVER_WEB_SESSION_TIMEOUT.getValue.toLong
 
-  private val userTicketIdToLastAccessTime = new ConcurrentHashMap[String, Long]()

Review Comment:
   It is recommended to instantiate it here to determine whether to use redis or the current way



##########
linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/ticket/RedisClient.scala:
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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 org.apache.linkis.server.ticket
+
+import org.apache.commons.lang3.StringUtils
+import org.apache.commons.pool2.impl.GenericObjectPoolConfig
+import org.apache.linkis.common.conf.CommonVars
+import redis.clients.jedis.{Jedis, JedisPool, JedisSentinelPool}
+import scala.collection.JavaConverters.setAsJavaSetConverter
+
+object RedisClient {
+
+  private val RedisHost: String = CommonVars("linkis.redis.host", "127.0.0.1").getValue

Review Comment:
   It is recommended that the configuration be moved to the package org.apache.linkis.server.conf.SessionHAConfiguration



-- 
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: notifications-unsubscribe@linkis.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org


[GitHub] [incubator-linkis] codecov[bot] commented on pull request #2996: linkis redis sso service

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #2996:
URL: https://github.com/apache/incubator-linkis/pull/2996#issuecomment-1228092591

   # [Codecov](https://codecov.io/gh/apache/incubator-linkis/pull/2996?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2996](https://codecov.io/gh/apache/incubator-linkis/pull/2996?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (babe93e) into [dev-1.3.0](https://codecov.io/gh/apache/incubator-linkis/commit/ee53644722d262ab0782b71c4aa23b74aebb8377?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee53644) will **increase** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             dev-1.3.0    #2996   +/-   ##
   ============================================
     Coverage        15.17%   15.17%           
     Complexity        1210     1210           
   ============================================
     Files              776      776           
     Lines            25222    25222           
     Branches          3567     3567           
   ============================================
   + Hits              3827     3828    +1     
   + Misses           20880    20878    -2     
   - Partials           515      516    +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-linkis/pull/2996?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...s/scheduler/queue/fifoqueue/FIFOUserConsumer.scala](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLWNvbW1vbnMvbGlua2lzLXNjaGVkdWxlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2xpbmtpcy9zY2hlZHVsZXIvcXVldWUvZmlmb3F1ZXVlL0ZJRk9Vc2VyQ29uc3VtZXIuc2NhbGE=) | `35.77% <0.00%> (-0.92%)` | :arrow_down: |
   | [.../src/main/scala/org/apache/linkis/rpc/Sender.scala](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLWNvbW1vbnMvbGlua2lzLXJwYy9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2xpbmtpcy9ycGMvU2VuZGVyLnNjYWxh) | `0.00% <0.00%> (ø)` | |
   | [...inkis/variable/restful/api/VariableRestfulApi.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLXZhcmlhYmxlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9saW5raXMvdmFyaWFibGUvcmVzdGZ1bC9hcGkvVmFyaWFibGVSZXN0ZnVsQXBpLmphdmE=) | | |
   | [...linkis/configuration/service/CategoryService.scala](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWNvbmZpZ3VyYXRpb24vc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9saW5raXMvY29uZmlndXJhdGlvbi9zZXJ2aWNlL0NhdGVnb3J5U2VydmljZS5zY2FsYQ==) | | |
   | [...e/linkis/variable/exception/VariableException.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLXZhcmlhYmxlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9saW5raXMvdmFyaWFibGUvZXhjZXB0aW9uL1ZhcmlhYmxlRXhjZXB0aW9uLmphdmE=) | | |
   | [...he/linkis/configuration/entity/ConfigKeyValue.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWNvbmZpZ3VyYXRpb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2xpbmtpcy9jb25maWd1cmF0aW9uL2VudGl0eS9Db25maWdLZXlWYWx1ZS5qYXZh) | | |
   | [.../configuration/validate/ValidatorManagerImpl.scala](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWNvbmZpZ3VyYXRpb24vc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9saW5raXMvY29uZmlndXJhdGlvbi92YWxpZGF0ZS9WYWxpZGF0b3JNYW5hZ2VySW1wbC5zY2FsYQ==) | | |
   | [...a/org/apache/linkis/jobhistory/util/Constants.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWpvYmhpc3Rvcnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2xpbmtpcy9qb2JoaXN0b3J5L3V0aWwvQ29uc3RhbnRzLmphdmE=) | | |
   | [...rg/apache/linkis/jobhistory/entity/JobHistory.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWpvYmhpc3Rvcnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2xpbmtpcy9qb2JoaXN0b3J5L2VudGl0eS9Kb2JIaXN0b3J5LmphdmE=) | | |
   | [...obhistory/cache/impl/DefaultQueryCacheManager.java](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGlua2lzLXB1YmxpYy1lbmhhbmNlbWVudHMvbGlua2lzLXB1YmxpY3NlcnZpY2UvbGlua2lzLWpvYmhpc3Rvcnkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2xpbmtpcy9qb2JoaXN0b3J5L2NhY2hlL2ltcGwvRGVmYXVsdFF1ZXJ5Q2FjaGVNYW5hZ2VyLmphdmE=) | | |
   | ... and [117 more](https://codecov.io/gh/apache/incubator-linkis/pull/2996/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@linkis.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@linkis.apache.org
For additional commands, e-mail: notifications-help@linkis.apache.org