Skip to content

Conversation

@RobertWangWang
Copy link

@RobertWangWang RobertWangWang commented Dec 25, 2025

What problem does this PR solve?

refactor(auth): support multi-session login with user session management

  • Add UserSession data model to support multiple concurrent login sessions
  • Prioritize retrieving user data from UserSession in authentication flow
  • Implement rolling expiration mechanism based on last activity time with 30-day inactivity timeout
  • Refactor login logic to create UserSession records for maintaining multi-session state
  • Provide session logout, logout all sessions, and expired session cleanup functionality
  • Optimize exception handling to ensure backward compatibility and clear logging

Type of change

  • New Feature (non-breaking change which adds functionality)

KevinHuSh and others added 15 commits July 16, 2025 12:56
### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
### What problem does this PR solve?

Add Kimi model series support.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
### What problem does this PR solve?

Correct the logging message from "OpenAI cat_with_tools" to "OpenAI
chat_with_tools" in the `_exceptions` method of the `Base` class to
accurately reflect the method name and improve error traceability.

### Type of change

- [x] Typo
fix: modify the connection ports of minio and redis in
service_conf.yaml.template

### What problem does this PR solve?

If you modify the external ports of minio and redis in the .env file, it
will also affect the connection ports inside the container in the
service_conf.yaml.template file, which is unreasonable.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):
# Conflicts:
#	conf/llm_factories.json
#	graphrag/utils.py
- 新增 UserSession 模型支持多点登录会话数据存储
- 实现 UserSessionService 提供会话创建、查询、登出等功能
- 修改身份验证流程,优先从 UserSession 获取用户会话信息
- 用户登录时创建会话记录,返回对应的访问令牌
- 新增登出接口支持单会话或全部会话登出功能
- 增加获取用户活动会话列表接口
- 增加删除指定用户会话接口,支持会话管理
- 调整相关配置与依赖, Redis 端口调整为 6378
- 优化异步超时设置及 Redis 连接参数添加用户名支持
- 改进 Docker 启动脚本自动检测运行环境并调整配置路径
- Add UserSession data model to support multiple concurrent login sessions
- Prioritize retrieving user data from UserSession in authentication flow
- Implement rolling expiration mechanism based on last activity time with 30-day inactivity timeout
- Refactor login logic to create UserSession records for maintaining multi-session state
- Provide session logout, logout all sessions, and expired session cleanup functionality
- Optimize exception handling to ensure backward compatibility and clear logging
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🌈 python Pull requests that update Python code 💞 feature Feature request, pull request that fullfill a new feature. labels Dec 25, 2025
@KevinHuSh KevinHuSh changed the title multipoint login Feat: multipoint login Dec 25, 2025
@JinHai-CN
Copy link
Contributor

Would you please update the Chinese comments to English ? @RobertWangWang

robertwangwang and others added 2 commits December 25, 2025 14:59
…ging

- Convert API comments from Chinese to English for better code internationalization and readability
- Add logging for logout all sessions and single session operations to facilitate user activity tracking
- Optimize session logout logic with clear distinction between logout all sessions and current session
- Update API response descriptions to provide more accurate API documentation
@RobertWangWang
Copy link
Author

Would you please update the Chinese comments to English ? @RobertWangWang

I have updated the related python files.

# Replace env variables in the service_conf.yaml file
# -----------------------------------------------------------------------------
CONF_DIR="/ragflow/conf"
# 自动检测是否在Docker容器中或本地开发环境
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please update the comments?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thank you

HOST = ""
PORT = "9382"
HOST_API_KEY = ""
HOST_API_KEY = "ragflow-RkM2VmNTc4NGI2YTExZjA5NjM3Y2VhZG"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preset api key?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thank you

env_file: .env
ports:
- ${REDIS_PORT}:6379
- 6378:6379
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use variable?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have deployed a local redis on the port 6379.For development reason I need to use 6378 for the ragflow redis to expose the port. You can keep the original seetings. Sorry for the confusion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

{
context: ['/api/v1/admin'],
target: 'http://127.0.0.1:9381/',
target: 'http://127.0.0.1:9380/',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

raise last_exc if last_exc else Exception("LLM chat failed without exception")

@timeout(20)
@timeout(20*60)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

if password:
conn_params["password"] = password

conn_params["username"] = self.config.get("username", "default")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.


BASE_URL = "http://127.0.0.1:9380"
HOST = "127.0.0.1"
HOST = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

@@ -0,0 +1,153 @@
ragflow:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

esac
done

# -----------------------------------------------------------------------------
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

host: 'localhost'
port: 2881
redis:
db: 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

@@ -0,0 +1,152 @@
ragflow:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These alteration is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💞 feature Feature request, pull request that fullfill a new feature. 🌈 python Pull requests that update Python code size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants